Commit Graph

140 Commits

Author SHA1 Message Date
menghanli
7979d9337a [Material Next] Support "Learn more" for help link
Allow CaptionManager, Magnification, Color correction, Color inversion,
Time to take action, and Autoclick.

Bug: 187671696
Test: make RunSettingsRoboTests -j52 ROBOTEST_FILTER=AccessibilityFooterPreferenceTest
Change-Id: I9d753243d4f61b6b3d58b50425b7a75a812a481d
2021-05-12 13:53:44 +08:00
ryanlwlin
6269a92e16 Move Magnification Mode Settings to the main page
We move the mode settings because currently there is
only one item in the settings page. To fully test all logic,
we don't use fragament anymore in the controllerTest, and
test the interaction between the controller and the fragment
in the test of these two fragments.

Bug: 182992338
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
      atest MagnificationModePreferenceControllerTest
      atest MagnificationSettingsFragmentTest
      manually test
Change-Id: Ia6b0ea4f116f3215407637d7aeaddb8d8196d8fb
2021-04-29 20:12:35 +08:00
jasonwshsu
31db2fafc2 Update the dialog content for accessibility floating menu
Accessibility gesture is replaced by accessibility floating menu, related content in edit shortcut dialog and tutorial dialog are updated in this changelist.

cherry picked from commit 5fe2cdcf87

Bug: 173990914
Test: manual test
Change-Id: Ie529fa8a1f8ee87ca1ec5611b35675cdfd762165
Merged-In: Ie529fa8a1f8ee87ca1ec5611b35675cdfd762165
2021-03-17 23:02:53 +08:00
mincheli
3d41fe560b Hides the settings entry in Magnification Settings if device is not supported
If the device doesn't support magnification area, we should hide the
settings entry in mangification settings

Bug: 177371954
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I41fc3177f86c6a19e3ef0d2fbe5e052d77c1cb47
2021-03-02 06:56:59 +00:00
Stanley Wang
86cc0579f3 Replace the SwitchBar with MainSwitch.
- Update wi-fi calling switch.
- Update the switches in Accessibility

Fix: 178673860
Fix: 177968565
Test: Run robotest and apply the widget in Settings and see the ui
Change-Id: Id10e6a110f418ea500a2eaf3c54752bef4f36507
2021-02-23 16:21:52 +08:00
jasonwshsu
ba7b4bb727 Apply the new design of mUserShortcutTypesCache & mUserShortcutTypes in Magnification
Bug: 158540780
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I941a6e571a5a70f27032b82fcdc00f43b672168f
2020-11-05 14:24:15 +08:00
jasonwshsu
48b546eccf Extract UserShortcutType functions from ToggleFeaturePreferenceFragment
* Simplify StringJoiner to '+' since it only have one case
* Simplify Collections usage to use removeIf() and findFirst() directly
* Change class name SharedPreferenceUtils to PreferredShortcuts

Bug: 158540780
Test: atest ToggleFeaturePreferenceFragmentTest
Test: atest PreferredShortcutsTest
Change-Id: I02f03ccba09b6d7edaa5c0c8223ab3561a5e976b
2020-10-09 00:34:04 +00:00
jasonwshsu
26f1b5f65c Add data class PreferredShortcut to replace inner class UserShortcutType
* Add basic function equals(), hashcode() into data class
* Change flatternToString() to toString()
* Change constructor to fromString(flatternToString)

Bug: 158540780
Test: atest PreferredShortcutTest
Change-Id: I0ee46dd940d22ff9f168b95fe75d9cff2f0fddfb
2020-10-08 10:53:48 +00:00
jasonwshsu
1a1ae82460 Modify flow in ToggleFeaturePreferenceFragment
* Show edit shortcut dialog should belong to the basic feature, so move
them back to ToggleFeaturePreferenceFragment
* Add test cases for UserShortcutType to prepare to further refactor

Bug: 158540780
Test: atest ToggleFeaturePreferenceFragmentTest
Change-Id: Ia84bea5581f85d199f395b2065652ce69738abbf
2020-09-26 04:30:04 +00:00
jasonwshsu
7b11b33518 Fix 'Settings' entry is disappear from 'Magnification'
Bug: 165787919
Test: manual
Change-Id: I11a0c2ad7898d40caa5ad76a43f430ead82c3b80
2020-08-20 17:43:36 +00:00
Peter_Liang
6a893a54b6 Refine and migrate the functions that related to update preference into the specific lifecycle.
Goal:
Avoid the screen to be scrolled or moved by itself after changing theme.

Bug: 148785841
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragment
&& make RunSettingsRoboTests ROBOTEST_FILTER=ToggleScreenMagnificationPreferenceFragmentTest

Change-Id: I35a41a920194d6de01b635ce4c8461df2635ce1a
2020-08-13 15:04:12 +08:00
mincheli
f670261028 Supports triple-tap shortcut for window magnification
Window magnification mode shows triple-tap shortcut.

Bug: 157861708
Test: make RunSettingsRoboTests
Change-Id: I88c7a26e476d3cc5f85fa1b3f267ef3f1453ae38
2020-06-18 16:41:02 +08:00
jasonwshsu
b137e7a6e5 Change to use CaseMap.toTitle in shortcut type summary to handle different locale.
Bug: 153850193
Test: manual test
Change-Id: I6b4583d0b42a0019dfae9442536f6ed752ccc409
2020-05-18 13:27:46 +08:00
Peter_Liang
2add394b47 Refine the banner view for accessibility features.
1. Replace the video with the gif for Magnification.
2. Replace the static image with the gif for Color Inversion.

Bug: 153293657
Bug: 155946967
Test: manual test & robo test
Change-Id: Ic51c0ec45c10a7fd2b9f1ffb63865ebc764846ba
2020-05-14 21:00:05 +08:00
PETER LIANG
c178bae7af Merge "Add the settings content observer for shortcut preference." into rvc-dev am: 31e6002ee8 am: 380e0dc235 am: 58779cd226 am: 15d94daf38
Change-Id: I1f69480ee004d48fba57344959c39445be7717d8
2020-05-13 09:33:42 +00:00
Peter_Liang
b3d5df4989 Add the settings content observer for shortcut preference.
Root cause:
Didn't update the UI when settings value chagned.

Next:
Add the settings content observer.

Bug: 155837154
Test: manual test & Robo test & atest
Change-Id: I7be952a3a8824d00d3903d4a69beb8f992d638a1
2020-05-13 14:43:20 +08:00
TreeHugger Robot
3068fefc41 Merge "Revert "Add the settings content observer for shortcut preference."" into rvc-dev am: 9ae5b47aee am: 546c130e8d am: f37eaffefc am: aaf5e96718
Change-Id: I24e5a98e21353250b54e56ef3fe4dd62928b3b5e
2020-05-13 06:12:47 +00:00
Edgar Wang
7e70ef64d4 Revert "Add the settings content observer for shortcut preference."
This reverts commit 785af0c15a.

Bug: 155837154

Reason for revert: robolectric test fail at com.android.settings.accessibility.ToggleFeaturePreferenceFragmentTest

Change-Id: If8e5681b044171ad6941307489526cc3834f66b2
2020-05-13 03:45:39 +00:00
PETER LIANG
5cca393b3b Merge "Add the settings content observer for shortcut preference." into rvc-dev am: a85f5dc80b am: 99f1a37582 am: a0953560f8 am: 7fcf167362
Change-Id: I7df7b79bc75d61130bf45bdf3763c10d8933115f
2020-05-12 12:34:47 +00:00
Peter_Liang
785af0c15a Add the settings content observer for shortcut preference.
Root cause:
Didn't update the UI when settings value chagned.

Next:
Add the settings content observer.

Bug: 155837154
Test: manual test
Change-Id: Icee0bb50f88987ea6c8a0be59bd936628a32ca1e
2020-05-12 14:15:54 +08:00
Menghan Li
149f35605f Merge "Fix InvisibleToggle type service does not turn on or turn off correctly when edit shortcut dialog." into rvc-dev am: 981d10db0b am: 5d7fd4abc3 am: aa0c512ff5 am: 6267537581
Change-Id: I356ddb582b6fd154766c932e774ccbbe3d653f5e
2020-04-29 09:07:47 +00:00
menghanli
de1258f9cf Fix InvisibleToggle type service does not turn on or turn off correctly when edit shortcut dialog.
Root cause: service status is not updated after the shortcut status
changed.

Next: Add callback to update the service status

Bug: 155157599
Test: Manual test
Change-Id: I286a04d43066c787304c54eb7b0dfdac5728b6ac
2020-04-29 13:44:54 +08:00
PETER LIANG
516516f1e9 Merge changes from topic "tutorial_improvement" into rvc-dev am: b6bf10ebbc am: 15d20efe43 am: 636d68059e am: fbe9b33c73
Change-Id: I8711cc5c75a05d7865b22e411648debe3adda41e
2020-04-23 13:28:37 +00:00
Peter_Liang
72aa60ae95 Tutorial improvement for Accessibility shortcut (2/n).
Update UI widgets to meet the new design.

Bug: 148989018
Test: manual test
Change-Id: Ife42995af193db6746135d29f6fa1ad452d265a6
2020-04-23 12:18:26 +08:00
Peter_Liang
cfe3e454ac Tutorial improvement for Accessibility shortcut (1/n).
Because can't save the value into setting keys for the service before version R, and in order to let tutorial dialog can get the consistent value, using alternative that each fragment with shortcut to must implement the new abstract method.

Bug: 148989018
Test: manual test
Change-Id: Iba2a7daa70eb00f0bba37317c9355531fbb77628
2020-04-23 12:18:23 +08:00
PETER LIANG
1bf15b52fb Merge "Revising the function name related to user shortcut type." into rvc-dev am: eb04ef4f75 am: 4c7a690479 am: be6265865c am: 53bf408b10 am: 4ef910ce6c
Change-Id: I87157d34786e5ff5fe5d1442ddfb9ac284ffa931
2020-04-15 23:55:30 +00:00
Peter_Liang
58cc3ea7f9 Revising the function name related to user shortcut type.
Should add 's' into the name.

Bug: 148989018
Test: manual test
Change-Id: I46aadb80f4f28dc1794fc3313563c79be149e847
2020-04-15 17:43:05 +08:00
mincheli
5c108a0b27 Add back the entrance of magnification settings in master branch
Bug: 146473544
Test: make RunSettingsRoboTests
Change-Id: I2e040c0b722944077dd026c32f195e5a45a52c88
2020-04-08 14:24:59 +08:00
jasonwshsu
bfc3201e84 Show empty options in shortcut chooser dialog if shortPreference is unchecked.
* Fix the magnification can not auto restore shortcut options.
* The shortcut chooser dialog behavior will be:
1. If user's toggle switch is turned off, and they open the shortcut chooser dialog, none of the options are selected. In this state, if user chooses some of the shortcuts and saves, these choices will be honored.
2. If user's toggle switch is turned off, and they turn on the switch without opening the shortcut chooser dialog, their previously-saved shortcut option is brought back (e.g. if I previously used a11y button, I turn toggle switch off and then on again, I still have a11y button).
3. If user's toggle switch is turned on, and they open the shortcut chooser dialog, their previously-saved shortcut options will be shown.

Bug: 152539702
Bug: 153042341
Test: manual test
Change-Id: Ic109b3363eaf00ba77ce0ed05f4ec11517b1367e
2020-04-02 15:38:11 +08:00
menghanli
bd09e28a84 Enlarge the touch area of edit shortcut dialog
Bug: 148837311
Test: Manual test
Change-Id: I54ca93ccaa87514bf4d201b95ed855003d1c164c
2020-03-25 11:20:32 +08:00
menghanli
19cf6ddff8 Update R acessibility assets and strings (2/n)
- Temporary-use template summary by shortcut state

Bug: 148837311
Test: Manual test
Change-Id: Ia720b8f3f317bb1874d6758ebc4fbf4145d0c217
2020-03-11 17:21:27 +08:00
menghanli
5d7083a103 ShortcutPreference Toggle design (2/n)
- Removes edit shortcut disable condition.
- Shows "off" if user removes all items in edit dialog.
- Restores last time what user chosen options when show edit dialog.

Bug: 148989269
Test: Manually test
Change-Id: I105abda782999d38c92e3de9811e2fd378869e73
2020-03-06 18:02:53 +08:00
menghanli
919e555a51 ShortcutPreference Toggle design.
- For target SDK < 30 app show as preference item to trigger shortcut on/off.
- For target SDK >= 30 app show two item: the left one can edit shortcut and the right one be a on/off trigger button.

The design is reference from WIFI setting which has similar comportment.

Bug: 148989269
Test: Test result in Buganizer.

Change-Id: I815206d9e885c01bf3e6445820176aed4a743323
2020-03-03 17:31:27 +08:00
menghanli
5638acbc82 Use HTML text preference for rich content
Implements for Color Correction, Color Inversion, and Magnify

Bug: 148837311
Test: Manual test
Change-Id: I5e5b311b6ae8e42cca3ef9048c8b8b0de52d13bc
2020-02-12 19:12:26 +08:00
menghanli
6eb3912f31 Accessibility Service & Shortcut Redesign - Primary action - toggle button design
Implements DividerSwitchPreference to replace ToggleSwitch

Bug: 142528112
Test: Manual test

Change-Id: I0d80d16bfa941f7ee333a2c5680a25a26c42809d
2020-02-07 20:49:13 +08:00
menghanli
4705d87c4a Update the shortcut design strings.
Bug: 148837311
Test: Manual test

Change-Id: Iac96b3f36e4298aea36bbde5632f701ad1e9572d
2020-02-07 14:23:22 +08:00
mincheli
02ee1e1715 Remove the entrance of magnification settings
The feature will not be landed in R. So remove the settings UI.

Bug: 146473544
Test: make RunSettingsRoboTests
Change-Id: I602d175d616c4ba1bb9f003a1dc349f58268898f
2020-02-05 08:03:30 +00:00
menghanli
8e881181a8 Fix "Cannot get activity context when service off".
1. Unify getPrefContext() usage in Accessibility Settings
2. Correct the dialog emuns order

Test: local test
Change-Id: Idc51f7b15b5813bbae7b32e1ae3c7f00c71cea50
2020-02-03 07:13:31 +00:00
menghanli
b82931520f Support accessibility shortcut secondary action (11/n)
Refactor current shortcut design to base fragment and provide
protected function to customize the legacy design,
magnification or no need shortcut app.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests2

Change-Id: I51c951ef8f819a1940ddfe33b009b40ed5ec0530
2020-02-02 10:51:44 +08:00
menghanli
bf46032074 Support accessibility shortcut secondary action (10/n)
Integrate with Talkback enabled and change the behavior as below:
1. Show 3-finger swipe up from bottom summary
2. Show 3-finger icons for edit shortcut dialog
3. Dismiss the running the edit shortcut dialog

Bug: 142530063
Bug: 142531156
Bug: 147989432
Test: make RunSettingsRoboTests2
Change-Id: I2f34b8eebfdc5a385d72402e95a8b1d0bde4a428
2020-01-21 15:58:43 +08:00
menghanli
87147f55f0 Support accessibility shortcut secondary action (9/n)
Reorder layout and add title for each category block.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests2
Change-Id: I0f4067aaf9c42c3ce065eebd0e75ad4153f7e9dc
2020-01-18 00:24:20 +08:00
menghanli
5d0f336fec Support accessibility shortcut secondary action (8/n)
Integrate with the multiple shortcut selections and change the behavior as below:
- Get the shortcut type from system provider or shared_prefs if this is first time to use.
- Update the shared_prefs for what user seen.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests2
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityUtilTest
Change-Id: I58aeb960e2c4aa0bc2432be34c1372c0de89117a
2020-01-16 22:57:11 +08:00
jasonwshsu
620aec5f8c Accessibility shortcut secondary action - fix magnification triple tap logic
- triple tap in settings is boolean status, not string.

Bug: 142530063
Test: make RunSettingsRoboTests -j52 ROBOTEST_FILTER=ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Ieec9879f7ef55b694245c6f9143575ba933855e5
2020-01-16 18:21:48 +08:00
Minche Li
8b1bf8a477 Merge "Create settings for window magnification (3/n)" 2020-01-15 11:00:04 +00:00
mincheli
5b59e62ecb Create settings for window magnification (3/n)
This change is for internal test.
Add a switch preference for magnification enable mode.

Bug: 146019459
Bug: 146473544
Test: make RunSettingsRoboTests ROBOTEST_FILTER=MagnificationEnablePreferenceControllerTest -j64
Change-Id: I85fdbb5b0efc106d5301d95802b8d6b7dbe8145d
2020-01-15 16:11:38 +08:00
jasonwshsu
64426cc868 Accessibility shortcut secondary action - correct magnification shortcut logic
- correct magnification shortcut logic
- add magnification tests

Bug: 142530063
Test: make RunSettingsRoboTests -j52 ROBOTEST_FILTER=ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I15f8bccde63570e93e28399bc1730fb1afdb1242
2020-01-15 15:15:38 +08:00
jasonwshsu
fb576356aa Accessibility shortcut secondary action - handle all preferred shortcut type key
- save and restore all preferredShortcutType: SOFTWARE, HARDWARE, TRIPLETAP

Bug: 142530063
Test: manual
Change-Id: I7dd714d1516f49e89c42822241f9cb2b41ae2d2e
2020-01-14 12:15:14 +08:00
menghanli
334dc4f20b Support accessibility shortcut secondary action (7/n)
Implements sharedPreference to keep the user preferred shortcut for each
service.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Test: make RunSettingsRoboTests2
Change-Id: I2a7c54ddc32764f6d88f2efed87982d469acc183
2020-01-13 12:34:04 +08:00
menghanli
f3eb2de691 Maginfy Improvement
Implements the magnify new accessbility settings UI,
including the setupwizard and a11y settings

Bug: 146019459
Test: make RunSettingsRoboTests2
Change-Id: If11849a539c7841e2db495b63132e6d02b7285c0
2020-01-07 20:28:22 +08:00
jasonwshsu
8ef01d25fb Accessibility shortcut secondary action - save and restore shortcut key
- Implement onCheckboxClicked() to save shortcut key
- restore shortcut key when onViewCreated()
- Use preferredShortcutType to handle settings key

Bug: 142530063
Test: make -j52 RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityUtilTest
Change-Id: Iabe636641968d346e52becea19b6e201ea5bc1fb
2020-01-06 13:56:48 +08:00