From 95268ff6763ad5245bb798c9d2a6f5f835800b37 Mon Sep 17 00:00:00 2001 From: Candice Lo Date: Wed, 1 Mar 2023 06:35:34 +0000 Subject: [PATCH] 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 --- .../WindowMagnificationSettings.java | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java index 15264e64a241f..5f153b139755e 100644 --- a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java +++ b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSettings.java @@ -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);