Do not close the settings panel on tap
1. Fix the experience of tapping on the empty space in magnification settings panel and keep the panel open when tapping on the space without any elements on the panel. 2. Remove the rules for buttons set other than in onClickListener. The behaviors of buttons will always remain the same. Bug: 265362818 Test: manually - attach videos to the bug Change-Id: I78267c0bd31b7e6af05c06b0ac24962115ea7f35
This commit is contained in:
@@ -215,9 +215,7 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest
|
||||
|
||||
private boolean performA11yAction(View view, int action) {
|
||||
final Rect windowBounds = mWindowManager.getCurrentWindowMetrics().getBounds();
|
||||
if (action == AccessibilityAction.ACTION_CLICK.getId()) {
|
||||
handleSingleTap(view);
|
||||
} else if (action == R.id.accessibility_action_move_up) {
|
||||
if (action == R.id.accessibility_action_move_up) {
|
||||
moveButton(0, -windowBounds.height());
|
||||
} else if (action == R.id.accessibility_action_move_down) {
|
||||
moveButton(0, windowBounds.height());
|
||||
@@ -264,8 +262,6 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest
|
||||
} else if (id == R.id.magnifier_full_button) {
|
||||
hideSettingPanel();
|
||||
toggleMagnificationMode();
|
||||
} else {
|
||||
hideSettingPanel();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -273,7 +269,6 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest
|
||||
@Override
|
||||
public boolean onSingleTap(View view) {
|
||||
mSingleTapDetected = true;
|
||||
handleSingleTap(view);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -499,22 +494,6 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest
|
||||
}
|
||||
}
|
||||
|
||||
private void handleSingleTap(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.magnifier_small_button) {
|
||||
setMagnifierSize(MagnificationSize.SMALL);
|
||||
} else if (id == R.id.magnifier_medium_button) {
|
||||
setMagnifierSize(MagnificationSize.MEDIUM);
|
||||
} else if (id == R.id.magnifier_large_button) {
|
||||
setMagnifierSize(MagnificationSize.LARGE);
|
||||
} else if (id == R.id.magnifier_full_button) {
|
||||
hideSettingPanel();
|
||||
toggleMagnificationMode();
|
||||
} else {
|
||||
hideSettingPanel();
|
||||
}
|
||||
}
|
||||
|
||||
public void editMagnifierSizeMode(boolean enable) {
|
||||
setEditMagnifierSizeMode(enable);
|
||||
updateSelectedButton(MagnificationSize.NONE);
|
||||
|
||||
Reference in New Issue
Block a user