From 54773afb684f6ffa9b9af29594e6dc7e68512acd Mon Sep 17 00:00:00 2001 From: Jeff Boek Date: Wed, 20 Nov 2019 10:32:38 -0800 Subject: [PATCH] For #2477 - Removes the feature flag for Force Enable Zoom (#6646) * For #2477 - Removes the feature flag for Force Enable Zoom * For #2477 - Fixes bug where zoom preference doesnt persist between launches --- .../main/java/org/mozilla/fenix/FeatureFlags.kt | 2 -- .../java/org/mozilla/fenix/components/Core.kt | 3 ++- .../fenix/settings/AccessibilityFragment.kt | 16 ++++++---------- app/src/main/res/values/static_strings.xml | 5 ----- app/src/main/res/values/strings.xml | 4 ++++ .../main/res/xml/accessibility_preferences.xml | 1 - 6 files changed, 12 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt index 81de7e6ef..cfc412b23 100644 --- a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt +++ b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt @@ -34,8 +34,6 @@ object FeatureFlags { */ val progressiveWebApps = Config.channel.isNightlyOrDebug - val forceZoomPreference = Config.channel.isNightlyOrDebug - /** * Gives option in Settings to see logins and sync logins */ diff --git a/app/src/main/java/org/mozilla/fenix/components/Core.kt b/app/src/main/java/org/mozilla/fenix/components/Core.kt index e287d0785..9cf2c10dd 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Core.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Core.kt @@ -69,7 +69,8 @@ class Core(private val context: Context) { automaticFontSizeAdjustment = context.settings().shouldUseAutoSize, fontInflationEnabled = context.settings().shouldUseAutoSize, suspendMediaWhenInactive = !FeatureFlags.mediaIntegration, - allowAutoplayMedia = context.settings().isAutoPlayEnabled + allowAutoplayMedia = context.settings().isAutoPlayEnabled, + forceUserScalableContent = context.settings().forceEnableZoom ) GeckoEngine(context, defaultSettings, GeckoProvider.getOrCreateRuntime(context)).also { diff --git a/app/src/main/java/org/mozilla/fenix/settings/AccessibilityFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/AccessibilityFragment.kt index dca6b3ed9..fb331634a 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/AccessibilityFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/AccessibilityFragment.kt @@ -8,7 +8,6 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference -import org.mozilla.fenix.FeatureFlags import org.mozilla.fenix.R import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.getPreferenceKey @@ -29,18 +28,15 @@ class AccessibilityFragment : PreferenceFragmentCompat() { val forceZoomPreference = findPreference( getPreferenceKey(R.string.pref_key_accessibility_force_enable_zoom) ) - forceZoomPreference?.isVisible = FeatureFlags.forceZoomPreference - if (FeatureFlags.forceZoomPreference) { - forceZoomPreference?.setOnPreferenceChangeListener { preference, shouldForce -> - val settings = preference.context.settings() - val components = preference.context.components + forceZoomPreference?.setOnPreferenceChangeListener { preference, shouldForce -> + val settings = preference.context.settings() + val components = preference.context.components - settings.forceEnableZoom = shouldForce - components.core.engine.settings.forceUserScalableContent = shouldForce + settings.forceEnableZoom = shouldForce + components.core.engine.settings.forceUserScalableContent = shouldForce - true - } + true } val textSizePreference = findPreference( diff --git a/app/src/main/res/values/static_strings.xml b/app/src/main/res/values/static_strings.xml index aacf66eb7..c94b703e8 100644 --- a/app/src/main/res/values/static_strings.xml +++ b/app/src/main/res/values/static_strings.xml @@ -24,9 +24,4 @@ - - - Zoom on all websites - - Enable to allow pinch and zoom, even on websites that prevent this gesture. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 63f5cee14..7cd63124c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1014,6 +1014,10 @@ Set up now Unlock your device + + Zoom on all websites + + Enable to allow pinch and zoom, even on websites that prevent this gesture. Add search engine diff --git a/app/src/main/res/xml/accessibility_preferences.xml b/app/src/main/res/xml/accessibility_preferences.xml index e8405e986..f04cdf1a4 100644 --- a/app/src/main/res/xml/accessibility_preferences.xml +++ b/app/src/main/res/xml/accessibility_preferences.xml @@ -29,7 +29,6 @@ android:key="@string/pref_key_accessibility_force_enable_zoom" android:summary="@string/preference_accessibility_force_enable_zoom_summary" android:title="@string/preference_accessibility_force_enable_zoom" - app:isPreferenceVisible="false" app:allowDividerAbove="true" app:iconSpaceReserved="false" />