mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Tablet UI override (#5830)
* Tablet UI override * Tablet UI advanced pref
This commit is contained in:
@@ -223,6 +223,8 @@ object PreferenceKeys {
|
||||
|
||||
const val incognitoMode = "incognito_mode"
|
||||
|
||||
const val tabletUiMode = "tablet_ui_mode"
|
||||
|
||||
fun trackUsername(syncId: Int) = "pref_mangasync_username_$syncId"
|
||||
|
||||
fun trackPassword(syncId: Int) = "pref_mangasync_password_$syncId"
|
||||
|
||||
@@ -51,4 +51,10 @@ object PreferenceValues {
|
||||
LOW(31),
|
||||
LOWEST(47)
|
||||
}
|
||||
|
||||
enum class TabletUiMode {
|
||||
ALWAYS,
|
||||
LANDSCAPE,
|
||||
NEVER
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.ui.library.setting.SortDirectionSetting
|
||||
import eu.kanade.tachiyomi.ui.library.setting.SortModeSetting
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
|
||||
import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
|
||||
import eu.kanade.tachiyomi.util.system.isTablet
|
||||
import eu.kanade.tachiyomi.widget.ExtendedNavigationView
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
@@ -317,6 +318,11 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun incognitoMode() = flowPrefs.getBoolean(Keys.incognitoMode, false)
|
||||
|
||||
fun tabletUiMode() = flowPrefs.getEnum(
|
||||
Keys.tabletUiMode,
|
||||
if (context.applicationContext.isTablet()) Values.TabletUiMode.ALWAYS else Values.TabletUiMode.NEVER
|
||||
)
|
||||
|
||||
fun setChapterSettingsDefault(manga: Manga) {
|
||||
prefs.edit {
|
||||
putInt(Keys.defaultChapterFilterByRead, manga.readFilter)
|
||||
|
||||
Reference in New Issue
Block a user