From ee7780f9e75d01bb10d0f97de834beaab742dca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 28 Sep 2023 13:17:17 +0200 Subject: [PATCH] Use `asFlow` from BaseConfig --- .../com/simplemobiletools/flashlight/helpers/Config.kt | 6 ------ gradle/libs.versions.toml | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/Config.kt index 16301a2..c71467b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/Config.kt @@ -2,11 +2,7 @@ package com.simplemobiletools.flashlight.helpers import android.content.Context import android.graphics.Color -import com.simplemobiletools.commons.extensions.sharedPreferencesCallback import com.simplemobiletools.commons.helpers.BaseConfig -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.filterNotNull -import kotlin.reflect.KProperty0 class Config(context: Context) : BaseConfig(context) { companion object { @@ -66,6 +62,4 @@ class Config(context: Context) : BaseConfig(context) { var sleepInTS: Long get() = prefs.getLong(SLEEP_IN_TS, 0) set(sleepInTS) = prefs.edit().putLong(SLEEP_IN_TS, sleepInTS).apply() - - private fun KProperty0.asFlow(): Flow = prefs.run { sharedPreferencesCallback { this@asFlow.get() } }.filterNotNull() } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c1c3ef6..b84bbd2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ androidx-lifecycle = "2.7.0-alpha02" #EventBus eventbusVersion = "3.3.1" #Simple tools -simple-commons = "f87e960171" +simple-commons = "13f995cb51" #Compose composeActivity = "1.8.0-rc01" compose = "1.6.0-alpha06"