summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect magnification window size when the dvice is foldedryanlwlin2022-01-201-1/+23
| | | | | | | | | | | | | | | | | | | When the foldable is folded /unfolded, we will refetch the display size to compute the appropriate the window size. The signal of display size changed is from onConfigurationChanged which is invoked by Application context. However, we get the display size from the WindowContxt. To fix it, we register the callback with the WindowContext based on the view visiblty, and update the configuration related values before showing the window. Test: manual test atest com.android.systemui.accessibility Bug: 213958569 Bug: 214318642 Change-Id: Ic98f782f98b9c29f58d08e064985da731e13aa93
* Support individual magnification mode for each displayryanlwlin2021-11-101-9/+17
| | | | | | | | | | | | | Currently we only have a globale magnification mode which is stored in settings. It ends up the mode is shared between multi-displays. To provide better experience, we store the mode for each none-default display until the device reboot, and the default mode is full-screen. Test: atest com.android.server.accessibility atest com.android.systemui.accessibility Bug: 194667380 Change-Id: I099e1ee945938aac07cc079f68bccbc745d40b08
* Correct magnification switch button position after screen size is changedmincheli2021-07-051-1/+2
| | | | | | | | | | | | | | | This is for the foldable devices. When the screen size is changed when the device is folded or unfolded, the magnification switch button position should be adjusted to keep the X postion stick to the closest screen edge and Y position in the same height ration. https://buganizer.corp.google.com/issues/190365799#comment2 Bug: 190365799 Test: atest MagnificationModeSwitchTest Mannual testing by using adb shell wm size 1080x2280 to change the screen size. Change-Id: Ic73309c9d79fb8476b2de823f8d4d75355c4d944
* Calculates the window height fraction on screen by the draggable bounds for ↵mincheli2021-06-161-7/+7
| | | | | | | | | | | | | | | magnification switch button In the previous change ag/14776093, the window height fraction used "windowHeightFraction = (float) mParams.y / mWindowHeight;". And it causes the Y-position deviated after the rotation is changed. To correct this, we used the draggable bounds to calculate the window height fraction. See b/189715285#comment3 Bug: 189715285 Test: atest MagnificationModeSwitchTest Change-Id: I1adcea12f0a96c64c9c6e386dc2feb8e3a9ffcf3
* Keeps the Y position with the same height ratio before the window height is ↵mincheli2021-06-021-0/+12
| | | | | | | | | | | changed It's UI polishment. When the device is rotated, the Y position of magnification switch button should have the same height ratio (Y position / Window height). Bug: 189715285 Test: atest MagnificationModeSwitchTest Change-Id: I3f4b0d14bc0f59487e43298d6425171f299a6a72
* Adds accessibility actions for magnification switch button to move layout ↵mincheli2021-06-021-2/+27
| | | | | | | | | | | position To fulfill the need of GAR, switch access users may need the support of accessibility actions to move the switch button position. Bug: 189096761 Test: atest MagnificationModeSwitchTest Change-Id: Ia2b63c439f1b0e18cddcd0444dc3fa5971795d8c
* Adjusts the draggable bounds with the display cutcoutmincheli2021-05-311-9/+11
| | | | | | | | | | | | | | | | Some models support different display cutout by default. To make the magnification switch button not to overlap the display cutout and systemBars, we have to adjust the draggable bounds with the display cutout window insets. Bug: 189054814 Test: atest MagnificationModeSwitchTest, Manual test, Enable magnification settings and show the switch button. Go to System settings > Developer options > Display cutout Chaneg the cutout settings to monitor if the UI is expected Change-Id: Iaa0ae0ad828e8460ff1e62b1b6e4616245b86b58
* Assigns the default value of the cache magnification modemincheli2021-05-241-1/+2
| | | | | | | | | | | | | | | The magnification switch button is not visible because the image source is not set when calling showButton(). Because the default value of cache magnification mode is the same as the current magnification mode. And the check in showButton() blocks setting the image source To fix this for fullscreen mode, the default value is replaced ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN with ACCESSIBILITY_MAGNIFICATION_MODE_NONE. Bug: 188857483 Test: atest MagnificationModeSwitchTest Change-Id: I36eb7b20f94adbab49f006627e60badeb0b0f02f
* Makes the movable region of magnification button sticking to the edgesmincheli2021-05-191-4/+19
| | | | | | | | | | | | | When dragging magnification button, the button should stick to the closer edge of the screen edges automatically after the dragging gesture is finished. And not to reset the position after the button is removed. So the but tton position can be recovered after calling showButton() again. Demo video: b/162706034#comment3 Bug: 162706034 Test: atest MagnificationModeSwitchTest Change-Id: I78127f3e3f479e797426e0f451424f6ed090cd78
* Makes magnification switch UI never overlap navigationBar and statusBarmincheli2021-05-191-27/+96
| | | | | | | | | | | | This change contrains the x,y postion of switch button to make the button never overlap navigation bar window and status bar window. When the orientation is changed or navigation mode is change, the position of switch button should be ajusted by the draggable bounds because the window insets are updated. Bug: 185288922 Test: atest MagnificationModeSwitchTest; atest ModeSwitchesControllerTest; Change-Id: Idc03275f39418c18a190cdff6ffb0e94280c6281
* Change context to WindowContext for non-activity windowryanlwlin2021-03-181-1/+2
| | | | | | | | | | | Currently the window bounds of an non-acitivty window depends on the display area bounds. We need to change to this windowContext to get the correct windowmetrics for the further display area feature support. Bug: 180054792 Test: atest com.android.systemui.accessibility Change-Id: I0f995f745e7f6cb4ac3616d04c1a65e2e69b8043
* modularize the gesture detection mechanism for magnificationryanlwlin2020-12-111-40/+35
| | | | | | | | | | | Currently more and more views have similar gesture. Modularize them to reduce duplicate logic. Bug: 173159759 Test: atest MagnificationModeSwitchTest atest MagnificationGestureDetectorTest manually test to see if function works well Change-Id: I2d33322f331ec26e1d91f0c174e73f33a18acb52
* Merge "Fix button is gone after dragging over 5 secs"Ryan Lin2020-12-111-4/+9
|\
| * Fix button is gone after dragging over 5 secsryanlwlin2020-12-101-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | The pending fading out animation is not canceled while dragging. It should be canceled when the users touchs the button. If it is fading out when the user touchs it, we should cancel the animation and set the alpha value to 1. Bug: 175194712 Test: atest MagnificationModeSwitchTest manually test Change-Id: I3dec8520e90db7aff1050924be4e3bab1e27f23d
* | Merge "Sets the default fade-out timeout of magnification switch to 5000ms"Minche Li2020-12-101-1/+1
|\ \
| * | Sets the default fade-out timeout of magnification switch to 5000msmincheli2020-12-091-1/+1
| |/ | | | | | | | | | | | | | | | | It is for the new UI changes, Nov 10. update. go/window-magnify-ux Bug: 172631612 Test: none Change-Id: Ia18243e0bddf9f48da2a25cbef0b08af8e3c8a3a
* / Excludes magnification switch button from system gesture areamincheli2020-12-091-3/+20
|/ | | | | | | | | | | | When magnification switch button locates near to the system gesture area, a user would feel hard to drag the button because the touch event is dispatch to system gesture in priority. To make the switch button easier to be dragged, we exclude the button from system gesture area and adjust the layout size and the padding. Bug: 172899084 Test: atest MagnificationModeSwitchTest Change-Id: Ida99289ec63e6dc95d93eab979d9f8e985c3b889
* Merge "set accessibility window title"Ryan Lin2020-11-031-11/+28
|\
| * set accessibility window titleryanlwlin2020-10-301-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | We apply same accessibility window title to all magnification-related windows including magnification window and magnification mode switch. Bug: 170790760 Bug: 170790395 Test: enable Talkback to test manually and also change the language. atest MagnificationModeSwitchTest atest WindowMagnificationControllerTest Change-Id: I3fedc5c1ac7597005421f61c7159ddfc9a278772
* | Stores magnification mode settings for multi-usermincheli2020-10-201-2/+6
|/ | | | | | | | | | | Stores the settings with the current user handle when toggling the magnification switch button. It can prevent the magnification mode settings missmatched when AccessibilityManagerService.switchUser is called. Bug: 171007010 Test: atest MagnificationModeSwitchTest Change-Id: I074b7e427fc3d6ac068be0380704beafd7f7aa0e
* Applies Accessibility UI timeout for showing duration of magnification buttonmincheli2020-10-141-4/+11
| | | | | | | | | | | | Users can change Time to take action (Accessibility timeout) settings to make the magnification button showing duration aligned with recommended a11y UI timeout. Settings Page: Settings > Accessibility settings > Time to take action. Demo video: b/167977099#comment2 Bug: 167977099 Test: atest MagnificationModeSwitchTest Change-Id: I428b9d8221854edc476fcd455f3b9114b6b97ae9
* Magnification button applies fade-in and fade-out animationmincheli2020-10-081-14/+32
| | | | | | | | | | | | | We use runnable task to handle the UI animation to prevent the case that "Disable animation" settings disables all the animation showing. The default showing duration of magnification button is 3 secs and the fade-in & fade-out animation durations are both 300ms. The showing step: 1.fade-in > 2.show magnification button > 3.fade-out And the demo video is attached in the bug Bug: 168867867 Test: atest MagnificationModeSwitchTest Change-Id: If2d9a93987555b947e36e09b5345aaf588c02927
* Make magnification mode switch accessibleryanlwlin2020-10-071-0/+35
| | | | | | | | | | | | To support accessibility of magnification mode switch, We provide content description, state description and click action. Bug: 168278448 Test: Enable Talkback to do manually test atest MagnificationModeSwitchTest Change-Id: I1b94f3849f85db4f6dc2b801d0dd6ff40d0c87ed
* Keeps magnification button StartDelay for 3 secs even remove animations ↵mincheli2020-09-011-7/+11
| | | | | | | | | | | | | | | | | settings is on When remove animations settings is on, all of the animation would be out of function and so as the start delay of magnification button animation. And this bug would make magnification mode unabled to be changed through magnification button when the settings is on because magnification button would be dismissed immediately when starting to show the button. To fix it, we use handler.postDelayed to handle the animation start delay. Bug: 167371292 Test: atest MagnificationModeSwitchTest Change-Id: Ib4e3afc8fb4dab28283afb7826b4656e113f4723
* Magnification button is movable by dragging the iconmincheli2020-08-311-6/+64
| | | | | | | | | 1.The magnification button is movable by dragging the icon. 2.Switching magnification mode by single-tapping the icon. Bug: 158104770 Test: atest WindowMagnificationManagerTest, atest MagnificationModeSwitchTest Change-Id: Id0725c2a6f3fce24f1063141f203e73de6db7592
* Update magnification button UI when the device configuration is changedmincheli2020-07-281-1/+10
| | | | | | | | | | When device screen density is changed, the layout size of magnification button should be updated. Bug: 161199952 Test: atest WindowMagnificationTest Test: atset ModeSwitchesControllerTest Change-Id: I3454e2b0dc1d1bb1073ba02fa2d52fa88e7d65a5
* [Refactor] extract multi-display moduleryanlwlin2020-07-241-0/+1
| | | | | | | | | | | DisplayIdIndexSupplier is a multi-display module extracted from ModeSwitchesController. It encapsulates a SparseArray and a Supplier to provide the convenience for multi-display feature support. Bug: 158277851 Test: ModeSwitchesControllerTest, DisplayIdIndexSupplierTest Change-Id: Ida7f6f812826b6c389ae93aa87281a5a38ad876e
* Fix magnification switch bugsryanlwlin2020-06-291-10/+24
| | | | | | | | | | Fix two bugs after refactoing 1. The button is invisible forever after the animation is ended. 2. The image is not changed with the mode. Bug: 158277851 Test: MagnificationModeSwitchTest Change-Id: I5ce7e9c79213b540c3c6de2d27cbc6f92b3c1c97
* Fix potential bugs in MagnificationSwitchsControllerryanlwlin2020-06-111-0/+124
Some of its fields are used in the inner class. It might lead to some UI issue in multi-display case. To fix it, we extract the inner class and rename it. Bug: 158277851 Test: manual test & ModeSwitchesControllerTest Change-Id: I74802749c04b99ce040aa82458888bb2da578317