Skip to content

Commit

Permalink
Add modules for sydney-trains feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz committed Sep 3, 2024
1 parent b7fcb56 commit f57c43c
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 90 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/xyz/ksharma/krail/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.lifecycle.lifecycleScope
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import timber.log.Timber
import xyz.ksharma.krail.database.api.SydneyTrainsStaticDB
import xyz.ksharma.krail.database.sydney.trains.database.api.SydneyTrainsStaticDB
import xyz.ksharma.krail.design.system.theme.StartTheme
import javax.inject.Inject

Expand Down
2 changes: 1 addition & 1 deletion feature/sydney-trains/database/api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
sqldelight {
databases {
create("KrailDB") {
packageName.set("xyz.ksharma.krail")
packageName.set("xyz.ksharma.krail.sydney_trains.database.api")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package xyz.ksharma.krail.database.api
package xyz.ksharma.krail.database.sydney.trains.database.api

import xyz.ksharma.krail.StopTimes
import xyz.ksharma.krail.sydney.trains.database.StopTimes

interface SydneyTrainsStaticDB {

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.ksharma.krail
package xyz.ksharma.krail.sydney.trains.database.real.di

import android.content.Context
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
Expand All @@ -7,9 +7,11 @@ import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async
import xyz.ksharma.krail.database.api.SydneyTrainsStaticDB
import xyz.ksharma.krail.database.sydney.trains.database.api.SydneyTrainsStaticDB
import xyz.ksharma.krail.di.AppDispatchers
import xyz.ksharma.krail.di.Dispatcher
import xyz.ksharma.krail.sydney.trains.database.StopTimes
import xyz.ksharma.krail.sydney_trains.database.api.KrailDB
import javax.inject.Inject
import javax.inject.Singleton

Expand All @@ -35,7 +37,7 @@ class RealSydneyTrainsStaticDb @Inject constructor(
private suspend fun getSydneyTrainsDb(): KrailDB = sydneyTrainsDB.await()

override suspend fun insertStopTimes() {
getSydneyTrainsDb().stoptimesQueries.insertStopTimes(
getSydneyTrainsDb().stoptimesQueries.insertIntoStopTime(
trip_id = "id_1",
arrival_time = "arr",
departure_time = "depart",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package xyz.ksharma.krail.di
package xyz.ksharma.krail.sydney.trains.database.real.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import xyz.ksharma.krail.RealSydneyTrainsStaticDb
import xyz.ksharma.krail.database.api.SydneyTrainsStaticDB
import xyz.ksharma.krail.database.sydney.trains.database.api.SydneyTrainsStaticDB
import javax.inject.Singleton

@Module
Expand Down

This file was deleted.

7 changes: 7 additions & 0 deletions feature/sydney-trains/domain/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
alias(libs.plugins.krail.android.library)
}

android {
namespace = "xyz.ksharma.krail.sydney_trains.demain"
}
7 changes: 7 additions & 0 deletions feature/sydney-trains/model/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
alias(libs.plugins.krail.android.library)
}

android {
namespace = "xyz.ksharma.krail.sydney_trains.model"
}
7 changes: 7 additions & 0 deletions feature/sydney-trains/ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
alias(libs.plugins.krail.android.library)
}

android {
namespace = "xyz.ksharma.krail.sydney_trains.ui"
}
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ include(":core:network")
include(":core:utils")
include(":feature:sydney-trains:database:api")
include(":feature:sydney-trains:database:real")
include(":feature:sydney-trains:domain")
include(":feature:sydney-trains:model")
include(":feature:sydney-trains:network:api")
include(":feature:sydney-trains:network:real")
include(":feature:sydney-trains:ui")

0 comments on commit f57c43c

Please sign in to comment.