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

Commit 92d2aae3 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Do not allow toggle to be clickable/focusable

The entire preference is already clickable/focusable. Also, changed it so that
the entire preferenceview is clickable/focusable in non-accessibility mode as well
to better match Settings UX.

Also, no need to setClickable, since it is already by default

Fixes: 130398575

Test: With and without accessibility turned on, toggle works
Test: With accessibility turned on, toggle no longer takes a separate
      focus in addition to the preference

Change-Id: Iaff05cdf350f8d4f4c0f53b539770a7ad1f7d8ad
parent 8573d27d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -60,6 +60,8 @@ public class FaceEnrollAccessibilityToggle extends LinearLayout {
        }
        mSwitch = findViewById(R.id.toggle);
        mSwitch.setChecked(false);
        mSwitch.setClickable(false);
        mSwitch.setFocusable(false);
    }

    public boolean isChecked() {
+3 −4
Original line number Diff line number Diff line
@@ -159,13 +159,12 @@ public class FaceEnrollEducation extends BiometricEnrollBase {

        mSwitchDiversity = findViewById(R.id.toggle_diversity);
        mSwitchDiversity.setListener(mSwitchDiversityListener);

        if (accessibilityEnabled) {
            accessibilityButton.callOnClick();
            mSwitchDiversity.setClickable(true);
        mSwitchDiversity.setOnClickListener(v -> {
            mSwitchDiversity.getSwitch().toggle();
        });

        if (accessibilityEnabled) {
            accessibilityButton.callOnClick();
        }
    }