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
This commit is contained in:
menghanli
2020-02-18 23:05:38 +08:00
parent 4d59bce21b
commit 919e555a51
9 changed files with 182 additions and 170 deletions

View File

@@ -43,7 +43,7 @@ public class LegacyAccessibilityServicePreferenceFragment extends
final CharSequence hardwareTitle = getPrefContext().getText(
R.string.accessibility_shortcut_edit_dialog_title_hardware);
mShortcutPreference.setSummary(hardwareTitle);
mShortcutPreference.setSettingsVisibility(View.GONE);
mShortcutPreference.setSettingsEditable(false);
setAllowedPreferredShortcutType(UserShortcutType.HARDWARE);
}