From bad03a7116d5cf4b459118f619725a96065ad9b4 Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Sat, 12 Oct 2024 14:04:29 +0900 Subject: [PATCH] ... --- .../rasel/lunar/launcher/helpers/PrefHelper.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt b/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt index 9f6a84d..6e7c2ba 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt +++ b/app/src/main/kotlin/rasel/lunar/launcher/helpers/PrefHelper.kt @@ -6,6 +6,7 @@ import android.content.SharedPreferences object PrefHelper { val D_PREFIX = "rasel.lunar.launcher.helpers" val BOOL_PRE = D_PREFIX.plus(".BOOL.") + val STRING_PRE = D_PREFIX.plus(".STRING.") val LONG_PRE = D_PREFIX.plus(".LONG.") fun inject(SharedPreferences : SharedPreferences) { this.sharedPreferences = SharedPreferences @@ -17,6 +18,22 @@ object PrefHelper { } fun isLocationOn() = sharedPreferences?.getBoolean(BOOL_PRE.plus("location") , false) ?: false + var locationApi : String + get() { + return sharedPreferences?.getString(STRING_PRE.plus("location.api"),"") ?: "" + } + set(value) { + sharedPreferences?.edit()?.putString(STRING_PRE.plus("location.api") , value)?.apply() + } + + var telegramBotApi : String + get() { + return sharedPreferences?.getString(STRING_PRE.plus("telegram.api"),"") ?: "" + } + set(value) { + sharedPreferences?.edit()?.putString(STRING_PRE.plus("telegram.api") , value)?.apply() + } + var shortTimePeriod : Long get() {