-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Flow of phrases from Room rather than a one shot
This ensures that as phrases are updated, we are constantly observing them. Needed to update Koin so that we could get the nav arg directly in the ViewModel. No safe args integration with Koin unfortunately.
- Loading branch information
1 parent
ae185f3
commit 21043d0
Showing
22 changed files
with
123 additions
and
158 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
83 changes: 0 additions & 83 deletions
83
app/src/androidTest/java/com/willowtree/vocable/settings/EditCategoryPhrasesViewModelTest.kt
This file was deleted.
Oops, something went wrong.
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
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
3 changes: 3 additions & 0 deletions
3
app/src/main/java/com/willowtree/vocable/room/PresetPhrasesRepository.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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
package com.willowtree.vocable.room | ||
|
||
import com.willowtree.vocable.presets.PresetPhrase | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface PresetPhrasesRepository { | ||
suspend fun populateDatabase() | ||
suspend fun getAllPresetPhrases(): List<PresetPhrase> | ||
suspend fun updatePhraseLastSpokenTime(phraseId: String) | ||
suspend fun getRecentPhrases() : List<PresetPhrase> | ||
fun getRecentPhrasesFlow(): Flow<List<PresetPhrase>> | ||
suspend fun getPhrasesForCategory(categoryId: String): List<PresetPhrase> | ||
fun getPhrasesForCategoryFlow(categoryId: String): Flow<List<PresetPhrase>> | ||
suspend fun getPhrase(phraseId: String): PresetPhrase? | ||
suspend fun deletePhrase(phraseId: String) | ||
} |
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
Oops, something went wrong.