From 3726b8c98bb178ea25b1b136d75ef7d0e05eb782 Mon Sep 17 00:00:00 2001 From: ekager Date: Mon, 12 Oct 2020 15:58:32 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/15853 - Always set fontSizeFactor setting with new text scale --- .../org/mozilla/fenix/settings/AccessibilityFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 d607112a87..c1e55db14c 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/AccessibilityFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/AccessibilityFragment.kt @@ -45,7 +45,10 @@ class AccessibilityFragment : PreferenceFragmentCompat() { val components = preference.context.components // Value is mapped from 0->30 in steps of 1 so let's convert to float in range 0.5->2.0 - val newTextScale = ((newTextSize * STEP_SIZE) + MIN_SCALE_VALUE).toFloat() / PERCENT_TO_DECIMAL + val newTextScale = + ((newTextSize * STEP_SIZE) + MIN_SCALE_VALUE).toFloat() / PERCENT_TO_DECIMAL + + settings.fontSizeFactor = newTextScale // If scale is 100%, use the automatic font size adjustment val useAutoSize = newTextScale == 1F @@ -54,7 +57,6 @@ class AccessibilityFragment : PreferenceFragmentCompat() { // If using manual sizing, update the engine settings with the new scale if (!useAutoSize) { - settings.fontSizeFactor = newTextScale components.core.engine.settings.fontSizeFactor = newTextScale }