mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-17 19:35:36 -04:00
Fixed: lint error.
This commit is contained in:
parent
e472d11dc2
commit
54811ed897
@ -21,6 +21,7 @@ import android.content.Context
|
|||||||
import android.content.ContextWrapper
|
import android.content.ContextWrapper
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import androidx.annotation.ChecksSdkIntAtLeast
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
@ -136,9 +137,6 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) {
|
|||||||
ContextWrapper(context).externalMediaDirs[0]?.path
|
ContextWrapper(context).externalMediaDirs[0]?.path
|
||||||
?: context.filesDir.path // a workaround for emulators
|
?: context.filesDir.path // a workaround for emulators
|
||||||
|
|
||||||
fun getPrefStorageTitle(defaultTitle: String): String =
|
|
||||||
sharedPreferences.getString(PREF_STORAGE_TITLE, defaultTitle) ?: defaultTitle
|
|
||||||
|
|
||||||
fun putPrefBookMarkMigrated(isMigrated: Boolean) =
|
fun putPrefBookMarkMigrated(isMigrated: Boolean) =
|
||||||
sharedPreferences.edit { putBoolean(PREF_BOOKMARKS_MIGRATED, isMigrated) }
|
sharedPreferences.edit { putBoolean(PREF_BOOKMARKS_MIGRATED, isMigrated) }
|
||||||
|
|
||||||
@ -168,9 +166,6 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) {
|
|||||||
_prefWifiOnlys.onNext(wifiOnly)
|
_prefWifiOnlys.onNext(wifiOnly)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun putPrefStorageTitle(storageTitle: String) =
|
|
||||||
sharedPreferences.edit { putString(PREF_STORAGE_TITLE, storageTitle) }
|
|
||||||
|
|
||||||
fun putPrefStorage(storage: String) {
|
fun putPrefStorage(storage: String) {
|
||||||
sharedPreferences.edit { putString(PREF_STORAGE, storage) }
|
sharedPreferences.edit { putString(PREF_STORAGE, storage) }
|
||||||
_prefStorages.onNext(storage)
|
_prefStorages.onNext(storage)
|
||||||
@ -294,9 +289,11 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) {
|
|||||||
path.substringBefore(context.getString(R.string.android_directory_seperator))
|
path.substringBefore(context.getString(R.string.android_directory_seperator))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ChecksSdkIntAtLeast(api = Build.VERSION_CODES.R)
|
||||||
fun isPlayStoreBuildWithAndroid11OrAbove(): Boolean =
|
fun isPlayStoreBuildWithAndroid11OrAbove(): Boolean =
|
||||||
isPlayStoreBuild && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
|
isPlayStoreBuild && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
|
||||||
|
|
||||||
|
@ChecksSdkIntAtLeast(api = Build.VERSION_CODES.R)
|
||||||
fun isNotPlayStoreBuildWithAndroid11OrAbove(): Boolean =
|
fun isNotPlayStoreBuildWithAndroid11OrAbove(): Boolean =
|
||||||
!isPlayStoreBuild && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
|
!isPlayStoreBuild && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
|
||||||
|
|
||||||
@ -316,7 +313,6 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) {
|
|||||||
private const val PREF_BACK_TO_TOP = "pref_backtotop"
|
private const val PREF_BACK_TO_TOP = "pref_backtotop"
|
||||||
private const val PREF_FULLSCREEN = "pref_fullscreen"
|
private const val PREF_FULLSCREEN = "pref_fullscreen"
|
||||||
private const val PREF_NEW_TAB_BACKGROUND = "pref_newtab_background"
|
private const val PREF_NEW_TAB_BACKGROUND = "pref_newtab_background"
|
||||||
private const val PREF_STORAGE_TITLE = "pref_selected_title"
|
|
||||||
const val PREF_EXTERNAL_LINK_POPUP = "pref_external_link_popup"
|
const val PREF_EXTERNAL_LINK_POPUP = "pref_external_link_popup"
|
||||||
const val PREF_SHOW_STORAGE_OPTION = "show_storgae_option"
|
const val PREF_SHOW_STORAGE_OPTION = "show_storgae_option"
|
||||||
private const val PREF_IS_FIRST_RUN = "isFirstRun"
|
private const val PREF_IS_FIRST_RUN = "isFirstRun"
|
||||||
|
@ -52,5 +52,4 @@
|
|||||||
<ignore path="**/androidTest/**.kt" />
|
<ignore path="**/androidTest/**.kt" />
|
||||||
</issue>
|
</issue>
|
||||||
<issue id="PrivateResource" severity="warning" />
|
<issue id="PrivateResource" severity="warning" />
|
||||||
<issue id="AnnotateVersionCheck" severity="warning" />
|
|
||||||
</lint>
|
</lint>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user