-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from ahudson20/54-make-timer-persist-when-app-…
…closed Recreate timer when active/paused and app closed
- Loading branch information
Showing
17 changed files
with
306 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/app/whakaara/module/CoroutinesDispatchersModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.app.whakaara.module | ||
|
||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
import javax.inject.Qualifier | ||
|
||
@Retention(AnnotationRetention.RUNTIME) | ||
@Qualifier | ||
annotation class DefaultDispatcher | ||
|
||
@Retention(AnnotationRetention.RUNTIME) | ||
@Qualifier | ||
annotation class IoDispatcher | ||
|
||
@Retention(AnnotationRetention.RUNTIME) | ||
@Qualifier | ||
annotation class MainDispatcher | ||
|
||
@Retention(AnnotationRetention.BINARY) | ||
@Qualifier | ||
annotation class MainImmediateDispatcher | ||
|
||
@InstallIn(SingletonComponent::class) | ||
@Module | ||
object CoroutinesDispatchersModule { | ||
|
||
@DefaultDispatcher | ||
@Provides | ||
fun providesDefaultDispatcher(): CoroutineDispatcher = Dispatchers.Default | ||
|
||
@IoDispatcher | ||
@Provides | ||
fun providesIoDispatcher(): CoroutineDispatcher = Dispatchers.IO | ||
|
||
@MainDispatcher | ||
@Provides | ||
fun providesMainDispatcher(): CoroutineDispatcher = Dispatchers.Main | ||
|
||
@MainImmediateDispatcher | ||
@Provides | ||
fun providesMainImmediateDispatcher(): CoroutineDispatcher = Dispatchers.Main.immediate | ||
} |
Oops, something went wrong.