1
0
Fork 0

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
master
Jeff Boek 2019-11-20 10:32:38 -08:00 committed by GitHub
parent dba2186e86
commit 54773afb68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 19 deletions

View File

@ -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
*/

View File

@ -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 {

View File

@ -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<SwitchPreference>(
getPreferenceKey(R.string.pref_key_accessibility_force_enable_zoom)
)
forceZoomPreference?.isVisible = FeatureFlags.forceZoomPreference
if (FeatureFlags.forceZoomPreference) {
forceZoomPreference?.setOnPreferenceChangeListener<Boolean> { preference, shouldForce ->
val settings = preference.context.settings()
val components = preference.context.components
forceZoomPreference?.setOnPreferenceChangeListener<Boolean> { 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<TextPercentageSeekBarPreference>(

View File

@ -24,9 +24,4 @@
<!--suppress CheckTagEmptyBody This is a default value for places where we don't want a string set-->
<string name="empty_string" translatable="false"></string>
<!-- Title for Accessibility Force Enable Zoom Preference -->
<string name="preference_accessibility_force_enable_zoom" translatable="false">Zoom on all websites</string>
<!-- Summary for Accessibility Force Enable Zoom Preference -->
<string name="preference_accessibility_force_enable_zoom_summary" translatable="false">Enable to allow pinch and zoom, even on websites that prevent this gesture.</string>
</resources>

View File

@ -1014,6 +1014,10 @@
<string name="logins_warning_dialog_set_up_now">Set up now</string>
<!-- Title of PIN verification dialog to direct users to re-enter their device credentials to access their logins -->
<string name="logins_biometric_prompt_message_pin">Unlock your device</string>
<!-- Title for Accessibility Force Enable Zoom Preference -->
<string name="preference_accessibility_force_enable_zoom">Zoom on all websites</string>
<!-- Summary for Accessibility Force Enable Zoom Preference -->
<string name="preference_accessibility_force_enable_zoom_summary">Enable to allow pinch and zoom, even on websites that prevent this gesture.</string>
<!-- Title of the Add search engine screen -->
<string name="search_engine_add_custom_search_engine_title">Add search engine</string>

View File

@ -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" />
</PreferenceScreen>