@ -8,6 +8,7 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import androidx.preference.SwitchPreference
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.ext.getPreferenceKey
@ -25,6 +26,23 @@ class AccessibilityFragment : PreferenceFragmentCompat() {
( activity as AppCompatActivity ) . title = getString ( R . string . preferences _accessibility )
( activity as AppCompatActivity ) . title = getString ( R . string . preferences _accessibility )
( activity as AppCompatActivity ) . supportActionBar ?. show ( )
( activity as AppCompatActivity ) . supportActionBar ?. show ( )
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
settings . forceEnableZoom = shouldForce
components . core . engine . settings . forceUserScalableContent = shouldForce
true
}
}
val textSizePreference = findPreference < TextPercentageSeekBarPreference > (
val textSizePreference = findPreference < TextPercentageSeekBarPreference > (
getPreferenceKey ( R . string . pref _key _accessibility _font _scale )
getPreferenceKey ( R . string . pref _key _accessibility _font _scale )
)
)