Show "shift double pages" as default enabled in settings on for tablets

This commit is contained in:
Jays2Kings 2021-04-15 03:42:56 -04:00
parent 3b23a95985
commit 05558f5733
2 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.ui.reader.ReaderActivity
import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PageLayout import eu.kanade.tachiyomi.ui.reader.viewer.pager.PageLayout
import eu.kanade.tachiyomi.util.lang.addBetaTag import eu.kanade.tachiyomi.util.lang.addBetaTag
import eu.kanade.tachiyomi.util.system.isTablet
import eu.kanade.tachiyomi.util.view.activityBinding import eu.kanade.tachiyomi.util.view.activityBinding
import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.launchIn
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
@ -76,7 +77,11 @@ class SettingsReaderController : SettingsController() {
allSelectionRes = R.string.display_options allSelectionRes = R.string.display_options
allIsAlwaysSelected = true allIsAlwaysSelected = true
showAllLast = true showAllLast = true
defaultValue = ReaderActivity.BUTTONS_DEFAULTS val defaults = ReaderActivity.BUTTONS_DEFAULTS.toMutableList()
if (context.isTablet()) {
defaults.add(ReaderActivity.BottomButton.ShiftDoublePage.value)
}
defaultValue = defaults
} }
infoPreference(R.string.certain_buttons_can_be_found) infoPreference(R.string.certain_buttons_can_be_found)
} }

View File

@ -40,7 +40,7 @@ class MultiListMatPreference @JvmOverloads constructor(
override fun onSetInitialValue(defaultValue: Any?) { override fun onSetInitialValue(defaultValue: Any?) {
super.onSetInitialValue(defaultValue) super.onSetInitialValue(defaultValue)
defValue = (defaultValue as? Set<*>).orEmpty().mapNotNull { it as? String }.toSet() defValue = (defaultValue as? Collection<*>).orEmpty().mapNotNull { it as? String }.toSet()
} }
override var customSummaryProvider: SummaryProvider<MatPreference>? = SummaryProvider<MatPreference> { override var customSummaryProvider: SummaryProvider<MatPreference>? = SummaryProvider<MatPreference> {