Provides kotlinx.datetime.Clock in wear

This commit is contained in:
Ryan Haining 2023-09-15 08:33:49 -07:00
parent 0c1224faf6
commit 1bed0251d2
2 changed files with 7 additions and 1 deletions

View file

@ -118,6 +118,7 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// for old fashioned support-app version // for old fashioned support-app version
@ -145,4 +146,4 @@ configurations {
all { all {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx' exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
} }
} }

View file

@ -3,11 +3,13 @@ package info.nightscout.androidaps.di
import android.content.Context import android.content.Context
import dagger.Binds import dagger.Binds
import dagger.Module import dagger.Module
import dagger.Provides
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.WearApp import info.nightscout.androidaps.WearApp
import info.nightscout.rx.di.RxModule import info.nightscout.rx.di.RxModule
import info.nightscout.shared.di.SharedModule import info.nightscout.shared.di.SharedModule
import info.nightscout.shared.impl.di.SharedImplModule import info.nightscout.shared.impl.di.SharedImplModule
import kotlinx.datetime.Clock
@Suppress("unused") @Suppress("unused")
@Module( @Module(
@ -27,5 +29,8 @@ open class WearModule {
@Binds fun bindContext(aaps: WearApp): Context @Binds fun bindContext(aaps: WearApp): Context
@Binds fun bindInjector(aaps: WearApp): HasAndroidInjector @Binds fun bindInjector(aaps: WearApp): HasAndroidInjector
} }
@Provides
fun providesClock(): Clock = Clock.System
} }