Hide reader "Split tall images" option in release build (#8235)

This commit is contained in:
AntsyLich 2022-10-21 08:41:42 +06:00 committed by GitHub
parent a8ca7b690f
commit 44cabf2f0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.data.preference.PreferenceValues.TappingInvertMode
import eu.kanade.tachiyomi.ui.reader.setting.OrientationType import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
import eu.kanade.tachiyomi.util.system.isReleaseFlavor
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -293,6 +294,7 @@ class SettingsReaderScreen : SearchableSettings {
pref = readerPreferences.longStripSplitWebtoon(), pref = readerPreferences.longStripSplitWebtoon(),
title = stringResource(R.string.pref_long_strip_split), title = stringResource(R.string.pref_long_strip_split),
subtitle = stringResource(R.string.split_tall_images_summary), subtitle = stringResource(R.string.split_tall_images_summary),
enabled = !isReleaseFlavor, // TODO: Show in release build when the feature is stable
), ),
), ),
) )

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.setting
import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.core.preference.PreferenceStore
import eu.kanade.tachiyomi.core.preference.getEnum import eu.kanade.tachiyomi.core.preference.getEnum
import eu.kanade.tachiyomi.data.preference.PreferenceValues import eu.kanade.tachiyomi.data.preference.PreferenceValues
import eu.kanade.tachiyomi.util.system.isReleaseFlavor
class ReaderPreferences( class ReaderPreferences(
private val preferenceStore: PreferenceStore, private val preferenceStore: PreferenceStore,
@ -30,7 +31,8 @@ class ReaderPreferences(
fun defaultOrientationType() = preferenceStore.getInt("pref_default_orientation_type_key", OrientationType.FREE.flagValue) fun defaultOrientationType() = preferenceStore.getInt("pref_default_orientation_type_key", OrientationType.FREE.flagValue)
fun longStripSplitWebtoon() = preferenceStore.getBoolean("pref_long_strip_split_webtoon", true) // TODO: Enable in release build when the feature is stable
fun longStripSplitWebtoon() = preferenceStore.getBoolean("pref_long_strip_split_webtoon", !isReleaseFlavor)
fun imageScaleType() = preferenceStore.getInt("pref_image_scale_type_key", 1) fun imageScaleType() = preferenceStore.getInt("pref_image_scale_type_key", 1)

View File

@ -4,3 +4,6 @@ import eu.kanade.tachiyomi.BuildConfig
val isDevFlavor: Boolean val isDevFlavor: Boolean
get() = BuildConfig.FLAVOR == "dev" get() = BuildConfig.FLAVOR == "dev"
val isReleaseFlavor: Boolean
get() = BuildConfig.BUILD_TYPE == "release"