Skip to content

Commit

Permalink
fix: Removed unused room packages and classes. This addresses #52
Browse files Browse the repository at this point in the history
  • Loading branch information
wangerekaharun committed Jan 16, 2020
1 parent b61148c commit 57813ac
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 226 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 2 additions & 7 deletions app/src/main/java/com/android254/droidconke19/di/modules.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.android254.droidconke19.di

import android.content.Context
import androidx.room.Room
import com.android254.droidconke19.database.AppDatabase
import com.android254.droidconke19.firebase.FirebaseRemoteConfigFactory
import com.android254.droidconke19.repository.*
import com.android254.droidconke19.utils.SharedPref
Expand All @@ -12,7 +10,6 @@ import com.google.firebase.database.FirebaseDatabase
import com.google.firebase.firestore.ktx.firestore
import com.google.firebase.ktx.Firebase
import com.google.firebase.messaging.FirebaseMessaging
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module

Expand Down Expand Up @@ -44,8 +41,8 @@ val appModule = module {
val dataModule = module {
// Repos
single<AboutDetailsRepo> { AboutDetailsRepoImpl(get()) }
single<SessionsRepo> { SessionsRepoImpl(get(), get()) }
single<SessionDataRepo> { SessionDataRepoImpl(get(), get()) }
single<SessionsRepo> { SessionsRepoImpl(get()) }
single<SessionDataRepo> { SessionDataRepoImpl(get()) }
single<SpeakersRepo> { SpeakersRepoImpl(get()) }
single<RoomRepo> { RoomRepoImpl(get()) }
single<SessionFeedbackRepo> { SessionFeedbackRepoImpl(get()) }
Expand All @@ -57,6 +54,4 @@ val dataModule = module {
single<ReserveSeatRepo> { ReserveSeatRepoImpl(get()) }
single<WifiDetailsRepo> { WifiDetailsRepoImpl(get()) }

// Database
single { Room.databaseBuilder(get(), AppDatabase::class.java, "droidconKE_db").fallbackToDestructiveMigration().build() }
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.android254.droidconke19.repository

import com.android254.droidconke19.datastates.FirebaseResult
import com.android254.droidconke19.datastates.runCatching
import com.android254.droidconke19.models.ReserveSeatModel
import com.google.firebase.firestore.FirebaseFirestore
import com.google.firebase.firestore.FirebaseFirestoreException
import kotlinx.coroutines.tasks.await
import com.android254.droidconke19.datastates.FirebaseResult
import com.android254.droidconke19.datastates.runCatching

interface ReserveSeatRepo {
suspend fun reserveSeat(reserveSeatModel: ReserveSeatModel): FirebaseResult<String>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.android254.droidconke19.repository

import com.android254.droidconke19.database.AppDatabase
import com.android254.droidconke19.database.dao.SessionsDao
import com.android254.droidconke19.datastates.FirebaseResult
import com.android254.droidconke19.datastates.runCatching
import com.android254.droidconke19.models.SessionsModel
Expand All @@ -21,9 +19,7 @@ interface SessionDataRepo {
suspend fun clearStarredSessions(userId: String)
}

class SessionDataRepoImpl(db: AppDatabase, private val firestore: FirebaseFirestore) : SessionDataRepo {
private val sessionsDao: SessionsDao = db.sessionsDao()

class SessionDataRepoImpl(private val firestore: FirebaseFirestore) : SessionDataRepo {
private val starredSessionCollection = "starred_sessions"

override suspend fun getSessionData(dayNumber: String, sessionId: Int): FirebaseResult<SessionsModel> =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.android254.droidconke19.repository

import com.android254.droidconke19.database.AppDatabase
import com.android254.droidconke19.datastates.FirebaseResult
import com.android254.droidconke19.datastates.runCatching
import com.android254.droidconke19.models.SessionsModel
Expand All @@ -14,7 +13,7 @@ interface SessionsRepo {
suspend fun getSessions(sessionDay: String): FirebaseResult<List<SessionsModel>>
}

class SessionsRepoImpl(db: AppDatabase, private val firestore: FirebaseFirestore) : SessionsRepo {
class SessionsRepoImpl(private val firestore: FirebaseFirestore) : SessionsRepo {

override suspend fun getSessions(sessionDay: String): FirebaseResult<List<SessionsModel>> =
runCatching {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.android254.droidconke19.repository

import com.android254.droidconke19.datastates.FirebaseResult
import com.android254.droidconke19.models.WifiDetailsModel
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.android254.droidconke19.datastates.runCatching
import com.android254.droidconke19.models.WifiDetailsModel
import com.android254.droidconke19.models.utils.WifiDetailsModelFactory
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import kotlinx.coroutines.tasks.await

interface WifiDetailsRepo {
Expand Down

0 comments on commit 57813ac

Please sign in to comment.