mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-30 05:47:57 +01:00
Comfortable grid code cleanup
This commit is contained in:
@@ -73,7 +73,7 @@ object PreferenceKeys {
|
||||
|
||||
const val lastUsedCategory = "last_used_category"
|
||||
|
||||
const val catalogueDisplayMode = "pref_display_catalogue_display_mode"
|
||||
const val catalogueDisplayMode = "pref_catalogue_display_mode"
|
||||
|
||||
const val enabledLanguages = "source_languages"
|
||||
|
||||
@@ -131,7 +131,7 @@ object PreferenceKeys {
|
||||
|
||||
const val downloadNewCategories = "download_new_categories"
|
||||
|
||||
const val libraryDisplayMode = "pref_display_library_display_mode"
|
||||
const val libraryDisplayMode = "pref_library_display_mode"
|
||||
|
||||
const val lang = "app_language"
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ object PreferenceValues {
|
||||
const val THEME_DARK_BLUE = "blue"
|
||||
const val THEME_DARK_AMOLED = "amoled"
|
||||
|
||||
const val DISPLAY_COMPACT_GRID = 0
|
||||
const val DISPLAY_LIST = 1
|
||||
const val DISPLAY_COMFORTABLE_GRID = 2
|
||||
enum class DisplayMode(val value: Int) {
|
||||
COMPACT_GRID(0),
|
||||
COMFORTABLE_GRID(1),
|
||||
LIST(2),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ import androidx.preference.PreferenceManager
|
||||
import com.tfcporciuncula.flow.FlowSharedPreferences
|
||||
import com.tfcporciuncula.flow.Preference
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceValues.DISPLAY_COMPACT_GRID
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceValues as Values
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.data.track.anilist.Anilist
|
||||
import java.io.File
|
||||
@@ -139,7 +139,7 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun lastVersionCode() = flowPrefs.getInt("last_version_code", 0)
|
||||
|
||||
fun catalogueDisplayMode() = flowPrefs.getInt(Keys.catalogueDisplayMode, DISPLAY_COMPACT_GRID)
|
||||
fun catalogueDisplayMode() = flowPrefs.getInt(Keys.catalogueDisplayMode, DisplayMode.COMPACT_GRID.value)
|
||||
|
||||
fun enabledLanguages() = flowPrefs.getStringSet(Keys.enabledLanguages, setOf("en", Locale.getDefault().language))
|
||||
|
||||
@@ -185,7 +185,7 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun libraryUpdatePrioritization() = flowPrefs.getInt(Keys.libraryUpdatePrioritization, 0)
|
||||
|
||||
fun libraryDisplayMode() = flowPrefs.getInt(Keys.libraryDisplayMode, DISPLAY_COMPACT_GRID)
|
||||
fun libraryDisplayMode() = flowPrefs.getInt(Keys.libraryDisplayMode, DisplayMode.COMPACT_GRID.value)
|
||||
|
||||
fun downloadBadge() = flowPrefs.getBoolean(Keys.downloadBadge, false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user