Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/misc.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
Expand Down
53 changes: 0 additions & 53 deletions .idea/misc.xml

This file was deleted.

8 changes: 7 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}

android {
Expand Down Expand Up @@ -50,4 +51,9 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
//splash screen api
implementation 'androidx.core:core-splashscreen:1.0.0-alpha02'
}

def room_version = "2.4.0"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/gdsc/laundropool/OnBoarding.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import com.gdsc.laundropool.ViewModels.OnBoardingViewModel
import com.gdsc.laundropool.viewModels.OnBoardingViewModel
import com.gdsc.laundropool.databinding.ActivityOnBoardingBinding

class OnBoarding : AppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.gdsc.laundropool.datasource.db

import androidx.room.Database
import androidx.room.RoomDatabase
import com.gdsc.laundropool.datasource.db.pastPools.PastPoolsDao
import com.gdsc.laundropool.datasource.db.pastPools.PastPoolsEntity

@Database(entities = [PastPoolsEntity::class], version = 1)
abstract class AppDatabase : RoomDatabase() {
abstract fun pastPoolDao(): PastPoolsDao
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.gdsc.laundropool.datasource.db

import android.content.Context
import androidx.room.Room

object DatabaseProvider {
private lateinit var instance: AppDatabase

@Synchronized
operator fun invoke(context: Context): AppDatabase {
if (!::instance.isInitialized) {

instance = Room.databaseBuilder(
context.applicationContext,
AppDatabase::class.java,
"app_database"
)
.fallbackToDestructiveMigration()
.build()
}
return instance
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.gdsc.laundropool.datasource.db.pastPools

import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

interface PastPoolsDao {
@Query("SELECT * FROM past_pools WHERE pool_id = :poolID")
suspend fun searchByID(poolID: Int): PastPoolsEntity

// TODO replace is probably not the best way to go about this.
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(pool: PastPoolsEntity)

@Query("SELECT* FROM past_pools")
suspend fun getAllPastPools(): PastPoolsEntity
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.gdsc.laundropool.datasource.db.pastPools

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity(tableName = "past_pools")
data class PastPoolsEntity(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "pool_id")
val poolId: Int

)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.About
package com.gdsc.laundropool.ui.about

import androidx.lifecycle.ViewModelProvider
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.About
package com.gdsc.laundropool.ui.about

import androidx.lifecycle.ViewModel

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.Help
package com.gdsc.laundropool.ui.help

import androidx.lifecycle.ViewModelProvider
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.Help
package com.gdsc.laundropool.ui.help

import androidx.lifecycle.ViewModel

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.MyOpenPool
package com.gdsc.laundropool.ui.myOpenPool

import androidx.lifecycle.ViewModelProvider
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.MyOpenPool
package com.gdsc.laundropool.ui.myOpenPool

import androidx.lifecycle.ViewModel

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.Notifications
package com.gdsc.laundropool.ui.notifications

import androidx.lifecycle.ViewModelProvider
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ui.Notifications
package com.gdsc.laundropool.ui.notifications

import androidx.lifecycle.ViewModel

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.gdsc.laundropool.ui.pastPools

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import com.gdsc.laundropool.databinding.PastPoolsFragmentBinding

class PastPoolsFragment : Fragment() {

private var _binding: PastPoolsFragmentBinding? = null

private val binding
get() = _binding!!

private val viewModel: PastPoolsViewModel by viewModels()

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = PastPoolsFragmentBinding.inflate(layoutInflater, container, false)

return binding.root
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.gdsc.laundropool.ui.PastPools
package com.gdsc.laundropool.ui.pastPools

import androidx.lifecycle.ViewModel

class PastPoolsViewModel : ViewModel() {
// TODO: Implement the ViewModel

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gdsc.laundropool.ViewModels
package com.gdsc.laundropool.viewModels

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/about_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.About.AboutFragment">
tools:context=".ui.about.AboutFragment">

<TextView
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/help_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.Help.HelpFragment">
tools:context=".ui.help.HelpFragment">

<TextView
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/my_open_pool_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.MyOpenPool.MyOpenPoolFragment">
tools:context=".ui.myOpenPool.MyOpenPoolFragment">

<TextView
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/notifications_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.Notifications.NotificationsFragment">
tools:context=".ui.notifications.NotificationsFragment">

<TextView
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/past_pools_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.PastPools.PastPoolsFragment">
tools:context=".ui.pastPools.PastPoolsFragment">

<TextView
android:layout_width="match_parent"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@

<fragment
android:id="@+id/nav_about"
android:name="com.gdsc.laundropool.ui.About.AboutFragment"
android:name="com.gdsc.laundropool.ui.about.AboutFragment"
android:label="about_fragment"
tools:layout="@layout/about_fragment" />
<fragment
android:id="@+id/nav_help"
android:name="com.gdsc.laundropool.ui.Help.HelpFragment"
android:name="com.gdsc.laundropool.ui.help.HelpFragment"
android:label="help_fragment"
tools:layout="@layout/help_fragment" />
<fragment
android:id="@+id/nav_my_open_pool"
android:name="com.gdsc.laundropool.ui.MyOpenPool.MyOpenPoolFragment"
android:name="com.gdsc.laundropool.ui.myOpenPool.MyOpenPoolFragment"
android:label="my_open_pool_fragment"
tools:layout="@layout/my_open_pool_fragment" />
<fragment
android:id="@+id/nav_notifications"
android:name="com.gdsc.laundropool.ui.Notifications.NotificationsFragment"
android:name="com.gdsc.laundropool.ui.notifications.NotificationsFragment"
android:label="notifications_fragment"
tools:layout="@layout/notifications_fragment" />
<fragment
android:id="@+id/nav_past_pool"
android:name="com.gdsc.laundropool.ui.PastPools.PastPoolsFragment"
android:name="com.gdsc.laundropool.ui.pastPools.PastPoolsFragment"
android:label="past_pools_fragment"
tools:layout="@layout/past_pools_fragment" />
</navigation>