MasterSwitchPreference provides a toggle switch and it only
acts for clicking events. This fix consumes move events to
ignore drag actions.
Bug: 148770615
Test: make RunSettingsRoboTests ROBOTEST_FILTER=MasterSwitchPreferenceTest
Manually drag the switch button of MasterSwitchPreference and
observe the switch state is not changed.
Change-Id: I0d8b947b32d35b85403fc65605c18c09a4053135
Let MasterSwitchPreference be restrictable by extending RestrictedPreference.
This is a prerequisite CL for "Hotspot & Tethering" in "Network & Internet" settings screen to be a MasterSwtichPreference.
Also changed MasterSwitchPreferenceTest perse.
Bug: 145922022
Test: SettingsRoboTests except StorageItemPreferenceControllerTest which
fails before this CL.
Change-Id: I54fa59d7adfce5f564c178c0db334974dbabf059
Allow developers to inject MasterSwitchPreference, a switch
preference with two tap targets, to Settings page.
Developers should declare keyhint and switch_uri for the activity
in AndroidManifest,and then implement a SwitchesProvider.
Bug: 132808482
Test: robotest
Change-Id: I64cdf18268be0cfcd38aab2c059144536dd79b32
TalkBack service dispatches onClick event to the Switch component
instead of the LinearLayout wrapping it. Do all the onClick tasks
for the Switch component instead of the LinearLayout wrapping it.
Bug: 142570671
Test: MasterSwitchPreferenceTest
Manual click the toggle button for both TalkBack enabled case and disabled case.
Change-Id: I4b2f9df309d03a477863445cd187384cdb61314b
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
And create PreferenceControllers for each setting
The page is still pretty janky and controllers are invoked manually.
Next CL will clean these up.
Bug: 32953042
Test: TODO
Change-Id: I1d7478324f5de4fdb464d79f89086f7e79c0ee67
IMHO we don't need to expose switch in SwitchWidgetController.
This controller already has enough API to control the switch.
Also rename mSwitchWidget to mSwitchController because it is not a
widget.
Bug: 69973752
Test: test still pass
Change-Id: I0ac247e34468a44109ab26019f1303c814e381f2
Set the preference title as the toggle button's content description, so
that when user focus on the button, it will read the lable as well on
top of just "switch on" or "switch off".
Change-Id: Id1954fd54b7d38cb4e75d8b3e49d05ee694e0e41
Fix: 37618855
Test: make RunSettingsRoboTests
- Update master switch preference to store enabled state in case
it's set before the view holder is bound
- Update master switch preference to prevent disabled switches
from being toggled
- Show an importance summary for max importance
- properly handle null notification sounds
Change-Id: I395b95b76d2a3c1c94b41d1c2720bb0cf1cae917
Fixes: 36920159
Fixes: 37421928
Fixes: 36939825
Test: RunSettingsRoboTests & manual
- add singleLineTitle=false to SettingsPreference style, so that it will
not confined the title to a single line.
- remove the custom multi line title from DividerPreference and
MasterSwitchPreference.
Change-Id: I5a78d2cd6ac00c4482e252b0789fd2d265bd9adf
Fix: 34886787
Test: manual
And move the layout to settingslib.
The new TwoTargetPreference is a preference object that has a vertical
divider between main panel and widget (if it exists).
Converted master switch, restricted preference, gear preference to use
the new style
Change-Id: Ia3848cebb06b8edc4e60abf9b0caf13cdb29c22c
Fix: 36511169
Test: make RunSettingsRoboTests
- set view click listener on the entire widget view instead of only
listening to the switch button event.
- move the preference layout end padding into the widget frame, so that
clicking on the empty space at the end will send the click event to the
widget frame instead of the preference view.
Change-Id: I98025f723465f3941cebbbd03b812209c0240590
Fix: 35872094
Test: make RunSettingsRoboTests
- Move wifi calling into wifi preference screen
- Update tethering setting title
- Ripple for master swtich preference only apply on the left half.
- Move network reset to action bar overflow menu
Fix: 34974598
Fix: 34976385
Test: RunSettingsRoboTests
Change-Id: I0e11843efc52a0042784a4da46b7ac81fcf16138
- Add a preference controller for Network & internet->Wi-Fi to control
the preference toggling and summary update.
- Refactor WifiSettings and WifiEnabler to share code between the new
wifi preference controller and the wifi setting.
- Refactor BluetoothSummaryHelper to have a common base class with the
WifiSummaryHelper.
- Rename the summary helper to summary updater.
Bug: 34280769
Test: make RunSettingsRoboTests
Change-Id: I00ebfc161bcef89331bb41ba405ed8cb8232d248
- Add a new preference type that has Title and optional summary on the
left, and a toggle switch on the right. Clicking the left part of the
preference will open a settings screen.
- Update Connected devices->Bluetooth to use this new preference.
- Refactor BluetoothSettings and BluetoothEnabler to share code between
the new bluetooth preference controller and the bluetooth setting.
Bug: 34280769
Test: make RunSettingsRoboTests
Change-Id: I109ecdba640ecdd4748a6e5b2b4f4c47cbf653fd