Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4fb6b93 authored by Roy Chou's avatar Roy Chou
Browse files

fix(magnification suw): followTyping preference should be hidden in magnification suw page

In ag/26349366 we wrapped the follow typing prefernce creation into new
method, but in the new method we didn't assign the created preference to
mFollowingTypingSwitchPreference. So
ToggleScreenMagnificationPreferenceFragmentForSetupWizard can not access
the preference object to hide it. Therefore, as a short-term solution we
assign the created preference to mFollowingTypingSwitchPreference. For a
long-term plan we should not create a preference and hide it in suw,
instead we don't need to create that preference. (tracked in b/335788167)

Bug: 335788769
Flag: NONE
Test: manually
Change-Id: Ideef93127343b7d1105a63006d343cd5ef66de08
parent 18f72bb4
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ public class ToggleScreenMagnificationPreferenceFragment extends
    private CheckBox mTripleTapTypeCheckBox;
    @Nullable private CheckBox mTwoFingerTripleTapTypeCheckBox;
    private DialogCreatable mDialogDelegate;
    private MagnificationFollowTypingPreferenceController mFollowTypingPreferenceController;

    @Override
    public void onCreate(Bundle savedInstanceState) {
@@ -241,14 +240,14 @@ public class ToggleScreenMagnificationPreferenceFragment extends
    }

    private void addFollowTypingSetting(PreferenceCategory generalCategory) {
        var followTypingSwitchPreference = new SwitchPreferenceCompat(getPrefContext());
        followTypingSwitchPreference.setTitle(
        mFollowingTypingSwitchPreference = new SwitchPreferenceCompat(getPrefContext());
        mFollowingTypingSwitchPreference.setTitle(
                R.string.accessibility_screen_magnification_follow_typing_title);
        followTypingSwitchPreference.setSummary(
        mFollowingTypingSwitchPreference.setSummary(
                R.string.accessibility_screen_magnification_follow_typing_summary);
        followTypingSwitchPreference.setKey(
        mFollowingTypingSwitchPreference.setKey(
                MagnificationFollowTypingPreferenceController.PREF_KEY);
        generalCategory.addPreference(followTypingSwitchPreference);
        generalCategory.addPreference(mFollowingTypingSwitchPreference);

        var followTypingPreferenceController = new MagnificationFollowTypingPreferenceController(
                getContext(), MagnificationFollowTypingPreferenceController.PREF_KEY);