Commit Graph

116 Commits

Author SHA1 Message Date
Kweku Adams
5949fccc7a Remove duplicate strings.
"Yes" and "no" were redefined many times with no clear benefit, so this
consolidates them into one definition.

Bug: 243843096
Test: Build, install, and open the Settings app
Test: atest SettingsRoboTests
Change-Id: I5f84d09f223efd478461ded93aeac82bf7b128d8
2022-08-26 00:07:08 +00:00
jasonwshsu
8145631ab8 Migrate to DashboardFragment in ToggleFeaturePreferenceFragment
Root Cause: ToggleFeaturePrefreferenceFragment becomes heavy when more and more features come in.

Solution: Mirgrate to DashboardFragment, a plugin-style preference controllers, can help us separate the preference and its logic into its own controller.

* This is the first step for the whole migration. Change to extend DashboardFragment and fill up the missing override functions.
* Reorder fields and functions to the recommended general approach.

Bug: 171272809
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.accessibility

Change-Id: I852091700a4b3b3c7bbdbc82f0b5dc47c087d61c
2022-07-13 00:40:55 +08:00
Edgar Wang
68d12953e7 Update learn more string of FooterPrefernce
Replace FooterPreference#SetLearnMoreContentDescription() with
FooterPreference#SetLearnMoreText().

This is a requirement: All links, controls, and buttons should
also have comprehensible text or tooltip text, so users can identify its
purpose, independent of context, such as when using the URL list from
TalkBack’s local context menu.

Bug: 215045903
Test: manual & robotest
Change-Id: Ib657ba336c5688c1434a58611dea3891001afe14
2022-05-13 08:13:36 +00:00
jasonwshsu
87e0b3c7e5 Correct Magnification shortcut title in edit shortcut dialog
Root Cause: Magnification has its own edit shortcut dialog, but we did not
update correct title with getShortcutTitle()

Solution: set dialog title to getShortcutTitle()

Bug: 231531313
Test: manual test
Change-Id: I0679be2807a4b1f8b8a733604e16a35b0a1258c3
2022-05-12 17:33:07 +08:00
jasonwshsu
e48ebb9755 Correct Magnification shortcut title
Root Cause: Magnification has its own ShortcutPreference, but we did not
update correct title with getShortcutTitle()

Solution: Call setTitle(getShortcutTitle()) in initShortcutPreference()

Bug: 228752572
Test: manual test
Change-Id: I85b09a22032bad0a0c840590a98be88538a0499b
2022-04-25 02:53:15 +08:00
menghanli
50520c2d3f Fix inconsistent shortcut strings on accessibility setting and edit dialog
Root cause: Base class provides an override function for accessibility settings shortcut preference. But, it cannot update to the edit dialog.
Solution: Refine the resilience function and base class apply into accessibility settings shortcut preference and edit dailog.

Bug: 228830417
Test: Manual testing on all accessibility page and edit dialog
Change-Id: I84bc63a39cd9cfa7e12944dff20ee6b92879008d
2022-04-15 00:31:03 +00:00
PETER LIANG
d4cd689c8f Merge "Fix that holding volume buttons to activate Extra dim feature doesn't do anything." into tm-dev 2022-03-25 14:06:00 +00:00
mincheli
57b35f9f35 Hides the settings entry in Magnification Settings if window magnification feature is not supported
If the device doesn't support window magnification featue, we
should hide the settings entry in mangification settings

Bug: 213414385
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I73f087da54cd2930c049dabb6b843c3b373e3c20
2022-03-21 22:48:34 +08:00
Peter_Liang
f94762176f Fix that holding volume buttons to activate Extra dim feature doesn't do anything.
Root cause:
Original framework design which has 3 seconds restriction to prevent users from easily triggering the accessibility volume shortcut when first time using it.

Solution:
The system would bypass the 3 seconds restriction if users manually set any feature as the volume key shortcut.

Bug: 202602908
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Change-Id: I324321577263904b6ff8b66e411766d16a6430dc
2022-03-17 15:49:45 +08:00
menghanli
99a9171108 Customized accessibility framework features quick setting tooltips content
- Lowercase for one-handed mode, color correction, color inversion, extra dim in quick settings tooltips if these words are not first words.

Bug: 220655084
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityShortcutPreferenceFragmentTest ToggleFeaturePreferenceFragmentTest LaunchAccessibilityActivityPreferenceFragmentTest ToggleAccessibilityServicePreferenceFragmentTest
Change-Id: I309ca48cecb80942112c9d5adde5857c062706c8
2022-03-10 06:40:54 +08:00
menghanli
ba9f097b03 Integrate Accessibility quick setting tooltips widget into ToggleFeaturePreferenceFragment
- Show tooltips when main switch is on
- Reshow tooltips when rotate device
- Add abstract functions for child components to show tooltips

Bug: 210356011
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Change-Id: I543d8af7d24a9fc82659625961850f975a7a0787
2022-01-26 07:54:57 +08:00
Daniel Hsieh
6542b6efb8 Hide following typing preference setting in SuW.
Hide following typing switch preference setting in SuW.

Bug: 214876729
Test: Start set-up wizard > Assistive options > Vision settings >
           Magnification > Following typing preference is invisible
      make RunSettingsRoboTests ROBOTEST_FILTER=
           ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I4ab64deeef321390c5b89c8ea58ea469fb5c09bf
2022-01-20 08:53:24 +00:00
Daniel Hsieh
55bc49860b Refactor SettingsContentObserver and add it to follow typing feature.
Refactor SettingsContentObserver and rename it to
AccessibilitySettingsContentObserver. Besides, we register it to observe
follow typing feature preference value.

The reasons behind refactor:
1. We change callback signature due to the consistency for register it
by preference key, not by Uri.
2. We refactor the default preference key to a seperate method. Since
the default value is related to accessibility, we rename it with
accessibility prefix.
3. We can register different callback for difference collections of
preference keys.

Default preference keys: They existed in the previous constructor.
1. Settings.Secure.ACCESSIBILITY_ENABLED
2. Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES

Bug: 194668976
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
           AccessibilitySettingsTest
           AccessibilitySettingsContentObserverTest
           AccessibilityShortcutPreferenceFragmentTest
           MagnificationFollowTypingPreferenceControllerTest
           ToggleFeaturePreferenceFragmentTest
           ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Iafd27e044ebe2536ae7ae55c1c80af54f7f0f822
2022-01-20 08:38:27 +00:00
Daniel Hsieh
6f4fb88538 Support following typing focus in window mode [3/n].
There are 3 milestones in this feature.
1. Refactor the callbacks for Accessibility in WindowManagerInternal.
2. Implement this feature in such new architecture.
3. Implement the setting choice in preference page.

This CL is for the 3rd milestone.

We add a preference key "magnification_follow_typing" to access and
update the ACCESSIBILITY_MAGNIFICATION_FOLLOW_TYPING_ENABLED value
which controls its corresponding preference page UI.

Bug: 194668976
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
	MagnificationFollowTypingPreferenceControllerTest
	ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Ib2602c997a535c1acca6a7ddd7bb2c25921f9280
2022-01-14 07:11:05 +00:00
ryanlwlin
a992b611bf Fix incorrect UI after triple-tap is disabled
The preference summary is not changed after
users disable the triple tap shortcut by the confirm
dialog. It is due to the fact that the fragment doesn't
observe the settings value change.

To fix it, we add the settings key to observe the change.

Bug: 208755360
Test: manual test
Change-Id: Ie5b7fc5e67c5491b53485af0d3d68d1789aeace4
2021-12-03 01:58:25 +00:00
jasonwshsu
eba8e8da19 Fix software shortcut in dialog did not update when content change.
Root Cause: Dialog only get updated when clicked the trigger button to show dialog.

Solution: Update the software shortcut content in dialog if needed in onResume() stage.

Bug: 183342594
Test: atest AccessibilityDialogUtilsTest
Change-Id: Ibcd66d6c57f1790f96f234e49f456cbc2c990f64
2021-10-20 16:25:26 +08:00
menghanli
5af9c64110 [Material Next] Accessibility gesture tutorial dialog
Problem: The dialog does not follow the Material Next guideline
Proposal:
1. Apply the dynamic color by removing SettingsTutorialDialogWrapperActivity which set extra theme
2. Hanlde the recreate case if shows the dialog directly
3. Update new Illustration in Pixel Lottie asset

Bug: 195980595
Test: Manual test
Change-Id: Ib6267128bbe5522ac8720c15fc2720c9a78f8671
2021-08-18 11:22:08 +08:00
TreeHugger Robot
b1bdec314a Merge "Add back the shortcut dialog content for accessibility gesture" into sc-v2-dev 2021-07-22 18:54:00 +00:00
menghanli
bae720ffc3 Provides TC ID for accessibility framework feature for "about" and "learn more" part
Goal: Improve readability which is a bit difficult because of string concatenation for accurate translation.
Root cause: In some locales, framework features name would be a word rather than a product name. Hence it need to be in the different position in a sentence.
Solution: Use whole sentence to translate instead of concatenating the string could solve this issue.

Bug: 185478543
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityFooterPreferenceControllerTest
Change-Id: Id198805329be9c773df87f38a074ae956e4d0cdb
2021-07-14 15:15:48 +08:00
menghanli
a606c43adf Provides TC ID for accessibility framework feature for "shortcut" part
Goal: Improve readability which is a bit difficult because of string concatenation for accurate translation.
Root cause: In some locales, framework features name would be a word rather than a product name. Hence it need to be in the different position in a sentence.
Solution: Use whole sentence to translate instead of concatenating the string could solve this issue.

Bug: 185478543
Test: Manually testing
Change-Id: I5a0f04e7ab0d7aa789e10ce6f611cde9bf3660c1
2021-07-06 15:53:28 +00:00
menghanli
f07aa0fa90 Add back the shortcut dialog content for accessibility gesture
Below components are updated.
1. The dialog title, content, and customized link when edit shortcut.
2. The shortcut preference summary in Setting page.
3. The tutorial title and content when shortcut on.

Partial rollback from commit 5fe2cdcf87

Bug: 190563948
Test: Manual test
Change-Id: I5e39b46c9387b4bf5a10f14453be9988d8b7fc9c
2021-07-06 01:05:11 +00:00
Peter_Liang
3e06c2e599 Update the Lottie images for Accessibility features.
Features:
1.Magnification
2.Color Inversion

Bug: 188625240
Test: manual test
Change-Id: I51c1c230d5f230eb3d933c98253f0d9d2bf30d37
2021-06-10 14:53:39 +08:00
menghanli
78c093b0b3 Move DialogEumn into AccessibilityDialogUtils
Bug: 190022774
Test: Manual testing
Change-Id: I391089b675b415c26bbacd028caf1d1ab617e707
2021-06-07 13:38:50 +08:00
ryanlwlin
964872ab96 Fix incorrect seperator while concatenating shortcuts
We concatenate the selected shortcut with a comma
that is not localized. To fix it we use listformatter
to concatenate them.

Bug: 186891004
Test: manually test with differnt languages.
Change-Id: I2c6692facd457b434c56a0633e784ce771905b29
2021-05-21 16:32:23 +08:00
Menghan Li
fd05966f4f Merge "Fix style in "Vision Settings" is inconsistent" into sc-dev 2021-05-12 08:49:55 +00:00
menghanli
11a0700847 Fix style in "Vision Settings" is inconsistent
Root cause: "Accessibility button" page apply BC style but other pages in SUW didn't. It causes page style inconsistency.
Solution: Don't show annotation link to make user open "Accessibility
button" page during SuW.

Bug: 187658718
Test: Manual testing
Change-Id: I6cc3da9a72b68829efd5537ae93fc329ef716fb4
2021-05-12 07:16:05 +00:00
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