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
This commit is contained in:
@@ -60,6 +60,8 @@ public class FaceEnrollAccessibilityToggle extends LinearLayout {
|
|||||||
}
|
}
|
||||||
mSwitch = findViewById(R.id.toggle);
|
mSwitch = findViewById(R.id.toggle);
|
||||||
mSwitch.setChecked(false);
|
mSwitch.setChecked(false);
|
||||||
|
mSwitch.setClickable(false);
|
||||||
|
mSwitch.setFocusable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isChecked() {
|
public boolean isChecked() {
|
||||||
|
@@ -159,13 +159,12 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
|
|
||||||
mSwitchDiversity = findViewById(R.id.toggle_diversity);
|
mSwitchDiversity = findViewById(R.id.toggle_diversity);
|
||||||
mSwitchDiversity.setListener(mSwitchDiversityListener);
|
mSwitchDiversity.setListener(mSwitchDiversityListener);
|
||||||
|
mSwitchDiversity.setOnClickListener(v -> {
|
||||||
|
mSwitchDiversity.getSwitch().toggle();
|
||||||
|
});
|
||||||
|
|
||||||
if (accessibilityEnabled) {
|
if (accessibilityEnabled) {
|
||||||
accessibilityButton.callOnClick();
|
accessibilityButton.callOnClick();
|
||||||
mSwitchDiversity.setClickable(true);
|
|
||||||
mSwitchDiversity.setOnClickListener(v -> {
|
|
||||||
mSwitchDiversity.getSwitch().toggle();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user