Merge "Add lock icon click handler when a11y is enabled" into tm-dev
This commit is contained in:
@@ -212,13 +212,13 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
|||||||
updateBurnInOffsets();
|
updateBurnInOffsets();
|
||||||
updateVisibility();
|
updateVisibility();
|
||||||
|
|
||||||
mAccessibilityManager.addTouchExplorationStateChangeListener(
|
mAccessibilityManager.addAccessibilityStateChangeListener(
|
||||||
mTouchExplorationStateChangeListener);
|
mAccessibilityStateChangeListener);
|
||||||
updateAccessibility();
|
updateAccessibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAccessibility() {
|
private void updateAccessibility() {
|
||||||
if (mAccessibilityManager.isTouchExplorationEnabled()) {
|
if (mAccessibilityManager.isEnabled()) {
|
||||||
mView.setOnClickListener(mA11yClickListener);
|
mView.setOnClickListener(mA11yClickListener);
|
||||||
} else {
|
} else {
|
||||||
mView.setOnClickListener(null);
|
mView.setOnClickListener(null);
|
||||||
@@ -238,8 +238,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
|||||||
mCancelDelayedUpdateVisibilityRunnable = null;
|
mCancelDelayedUpdateVisibilityRunnable = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
mAccessibilityManager.removeTouchExplorationStateChangeListener(
|
mAccessibilityManager.removeAccessibilityStateChangeListener(
|
||||||
mTouchExplorationStateChangeListener);
|
mAccessibilityStateChangeListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getTop() {
|
public float getTop() {
|
||||||
@@ -721,6 +721,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
|||||||
|
|
||||||
private final View.OnClickListener mA11yClickListener = v -> onLongPress();
|
private final View.OnClickListener mA11yClickListener = v -> onLongPress();
|
||||||
|
|
||||||
private final AccessibilityManager.TouchExplorationStateChangeListener
|
private final AccessibilityManager.AccessibilityStateChangeListener
|
||||||
mTouchExplorationStateChangeListener = enabled -> updateAccessibility();
|
mAccessibilityStateChangeListener = enabled -> updateAccessibility();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user