diff --git a/app/build.gradle b/app/build.gradle index 777934e..5332d82 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId "xyz.teamgravity.todo" minSdk 21 targetSdk 33 - versionCode 6 - versionName "1.1.4" + versionCode 7 + versionName "1.1.5" javaCompileOptions { annotationProcessorOptions { @@ -92,19 +92,19 @@ android { dependencies { // core - implementation 'androidx.core:core-ktx:1.8.0' + implementation 'androidx.core:core-ktx:1.9.0' // compose - implementation "androidx.compose.ui:ui:1.3.0-beta01" + implementation "androidx.compose.ui:ui:1.3.0-beta02" // compose material2 - implementation "androidx.compose.material:material:1.3.0-beta01" + implementation "androidx.compose.material:material:1.3.0-beta02" // compose material3 - implementation 'androidx.compose.material3:material3:1.0.0-beta01' + implementation 'androidx.compose.material3:material3:1.0.0-beta02' // compose preview - implementation "androidx.compose.ui:ui-tooling-preview:1.3.0-beta01" + implementation "androidx.compose.ui:ui-tooling-preview:1.3.0-beta02" // compose activity implementation 'androidx.activity:activity-compose:1.5.1' @@ -113,7 +113,7 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout-compose:1.0.1' // compose icons - implementation "androidx.compose.material:material-icons-extended:1.3.0-beta01" + implementation "androidx.compose.material:material-icons-extended:1.3.0-beta02" // compose viewmodel implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1" diff --git a/app/src/main/java/xyz/teamgravity/todo/data/local/preferences/Preferences.kt b/app/src/main/java/xyz/teamgravity/todo/data/local/preferences/Preferences.kt index 675e2b5..4054bb6 100644 --- a/app/src/main/java/xyz/teamgravity/todo/data/local/preferences/Preferences.kt +++ b/app/src/main/java/xyz/teamgravity/todo/data/local/preferences/Preferences.kt @@ -1,7 +1,6 @@ package xyz.teamgravity.todo.data.local.preferences import android.content.Context -import androidx.datastore.core.DataStore import androidx.datastore.preferences.core.* import androidx.datastore.preferences.core.Preferences import androidx.datastore.preferences.preferencesDataStore @@ -12,8 +11,6 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.withContext import java.io.IOException -private val Context.dataStore: DataStore by preferencesDataStore(name = xyz.teamgravity.todo.data.local.preferences.Preferences.PREFS) - class Preferences(context: Context) { companion object { @@ -35,7 +32,8 @@ class Preferences(context: Context) { private const val DEFAULT_HIDE_COMPLETED = false } - private val store = context.dataStore + private val Context.store by preferencesDataStore(name = PREFS) + private val store = context.store /////////////////////////////////////////////////////////////////////////// // UPDATE @@ -58,7 +56,7 @@ class Preferences(context: Context) { /////////////////////////////////////////////////////////////////////////// val preferences: Flow = store.data - .catch { handleIOException(it) } + .catch { emit(handleIOException(it)) } .map { preferences -> val sort = TodoSort.valueOf(preferences[TODO_SORT] ?: DEFAULT_TODO_SORT)