From 44cabf2f0b9db3ae60d5739676fb8777c474ea6b Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Fri, 21 Oct 2022 08:41:42 +0600 Subject: [PATCH] Hide reader "Split tall images" option in release build (#8235) --- .../presentation/more/settings/screen/SettingsReaderScreen.kt | 2 ++ .../kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt | 4 +++- .../main/java/eu/kanade/tachiyomi/util/system/BuildConfig.kt | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt index d49b4f21a..1a4d4fbd5 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt @@ -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.ReaderPreferences import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType +import eu.kanade.tachiyomi.util.system.isReleaseFlavor import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -293,6 +294,7 @@ class SettingsReaderScreen : SearchableSettings { pref = readerPreferences.longStripSplitWebtoon(), title = stringResource(R.string.pref_long_strip_split), subtitle = stringResource(R.string.split_tall_images_summary), + enabled = !isReleaseFlavor, // TODO: Show in release build when the feature is stable ), ), ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt index 31fde9d81..434f68a25 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.ui.reader.setting import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.core.preference.getEnum import eu.kanade.tachiyomi.data.preference.PreferenceValues +import eu.kanade.tachiyomi.util.system.isReleaseFlavor class ReaderPreferences( private val preferenceStore: PreferenceStore, @@ -30,7 +31,8 @@ class ReaderPreferences( 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) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/BuildConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/BuildConfig.kt index cd74287fa..ba720b32a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/BuildConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/BuildConfig.kt @@ -4,3 +4,6 @@ import eu.kanade.tachiyomi.BuildConfig val isDevFlavor: Boolean get() = BuildConfig.FLAVOR == "dev" + +val isReleaseFlavor: Boolean + get() = BuildConfig.BUILD_TYPE == "release"