Commit Graph

28 Commits

Author SHA1 Message Date
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08:00
Fan Zhang
46b5474be4 Update master switch style
- When off, background grey
- When on, background accent
- Switch toggle always white, only change the slider color during on/off

Change-Id: I0ca49439f4e20e75517d503f28cc3068930591e8
Bug: 69462439
Test: robotests
2018-01-10 15:52:20 -08:00
Julia Reynolds
9c3d329de6 Allow switchbars to have alternate text
For when On and Off aren't descriptive enough.

Bug: 63927402
Test: make -j20 RunSettingsRoboTests
Change-Id: I1e12d8d92dbe2f0a4c5202667cf1a76f0428e048
2018-01-02 15:34:58 -05:00
Fan Zhang
84dd783c36 Fix a monkey crash in Developer settings.
- DevSetting shouldn't add switchbar listener if it's a Monkey test run
- DevSetting shouldn't remove switchbar listener if it's not registered
- Refactor some switchbar logic in order to create test

Change-Id: Ie65ff9b04778075789010169039393bd0551acfb
Fix: 64021498
Test: robotests
2017-07-25 13:06:32 -07:00
Jiaquan He
2a77408663 Show the highlight for the wifi toggle switch.
To make wifi settings more keyboard friendly, we need to show the
highlight for the toggle switch when it has the focus.

Bug: 32087448

Change-Id: I4a71ad295f7b2c37a4eb141a6281de6934b072fd
2016-11-09 13:22:24 -08:00
Fan Zhang
aa71afe597 Use MetricsFeatureProvider for logging in Settings.
Bug: 31664539
Test: make RunSettingsRoboTests for regression
Test: adb logcat -b events | egrep "(sysui_|notification_)" for
      verifying log

Change-Id: Id944be7c4ff9911aebee481c2df485542f1318f0
2016-09-23 08:37:37 -07:00
Phil Weaver
664f6dacca Make sure setting switch bar state is announced.
When the switch is clicked, a TYPE_VIEW_CLICKED a11y
event is produced. It works fine if the switch bar is
clicked, but if the switch itself is clicked the event
comes from the switch, which is marked as not important
for accessibility. Re-dispatching events from the switch
as coming from the switch bar makes sure that the event
comes from a view that accessibility services can see.

Bug: 30484493
Change-Id: Ie48cc78594c64b1cc5735475e1cb5959fadaaf4a
2016-08-30 16:40:40 -07:00
Fan Zhang
6d2a0c80df Log switch toggle action whenever its status changes.
Bug: 30110675

onClick is only called when the switchbar is clicked. We also need to
log when switch itself is clicked.

Change-Id: I892b72daeefe0f36608a73fe509199e200376eb7
2016-08-01 10:41:23 -07:00
Chris Wren
1753dfd5cd log as counters instead of histograms
this will interoperate better with UMA

Bug: 26687914
Change-Id: Ie63b2be2d457054c96b070ada3bb92141ab1fb5a
2016-06-15 12:36:38 -04:00
Sudheer Shanka
115d15763d Adjust restricted lock positions as per new design.
Bug: 27263531
Change-Id: I7e38a9e3356ca43ed936de1e6f8190eba4d4773e
2016-03-10 07:54:36 -08:00
Jason Monk
e4ebcd12be Add generic logging to Settings switch bar
Same usage/format as the shared preference logging.

Bug: 27043208
Change-Id: I7a7a5c0a9c92ec6cef50df58313016218cf2f2f7
2016-02-21 09:37:41 -05:00
Anna Galusza
e88a05601c Don't read state twice ("on on"/"off off") in Settings Toggle preferences.
Bug: 26967006

Change-Id: I329aabc577ed8b3dc56fe86d9f7bc8f64461c2a0
2016-02-18 13:29:35 -08:00
Anna Galusza
0285c80664 UI fixes (back arrow, blue switch bar, append whether Talkback is on to
summary), Talkback no longer disabled when preference is tapped, fixes
SettingsPreferenceFragment to not check parent class to determine whether to
show options menu.

Change-Id: I3345e1a878f51b4387ca1bfe89855339617a94d6
2016-02-02 14:48:28 -08:00
Sudheer Shanka
9c32468cd5 Add padlocks to more preferences that can be disabled by policy.
Change-Id: I7cc999dd1d46c20c888e0ba67053564e4d50946b
2016-01-19 16:56:58 +00:00
Maxim Bogatov
c99d0a8a79 Make whole switchable header act as single Switch for
AccessibilityService

second part of b/21305287

Change-Id: I80da2ecbc367e10d027a851193f4d03ab8e09c69
2015-05-28 13:20:54 -07:00
John Spurlock
b47b2c3f6a Zen: Move zen mode preference to switch bar.
- Add summary line support to SwitchBar.
 - Remove obsolete strings.
 - Wire up switchbar to zen mode w/ dialog prompt.
 - Remove obsolete callback pref helper.

Bug: 20064962
Change-Id: Ifede00b5d43d441ccd94db96bd2796bc57d1a990
2015-04-04 15:47:43 -04:00
John Spurlock
9a23adf69d Settings: Remove all unused imports.
Change-Id: Iebfa52cb849d69974c94902b0b020893cf5618a3
2015-03-18 15:51:15 -04:00
Lifu Tang
b18e242366 Set switch to the correct enabling state
- Fix b/16951708

Change-Id: I4f9a2a374a771fd353fca436a0d34644f9bc8320
2014-08-18 16:46:48 -07:00
Alan Viverette
09be4b3c87 Stop using framework-private switch asset
BUG: 16467249
Change-Id: I0829c3dea522cf59e0f92046ea7c6092d416ad4c
2014-07-22 16:11:01 -07:00
Fabrice Di Meglio
1b18665dbc Fix bug #16319697 ACTION_DEVICE_INFO_SETTINGS intent causes Settings app to crash
- fix the way we are passing switchBarMarginStart / switchBarMarginEnd

Change-Id: Ic6e67643be10877a74ae68075460fa5fd4cc5da1
2014-07-15 18:52:37 -07:00
Fabrice Di Meglio
006b2cca13 Fix bug #15897505 Talk back state shows "off" while the talk back is still enabled.
- we were missing the update of the TextView from the SwitchBar so provide a new
setCheckedInternal() method that is doing the TextView and Switch update at the
same time

Change-Id: I6dd9c472a386bb534a58fbf5cf82d9d01fa74f6c
2014-06-27 19:13:19 -07:00
Fabrice Di Meglio
d2b1e441b7 Fix bug #15939648 "Use TalkBack ?" is shown after orientation change even if it was OFF before
- prevent onSaveInstanceState() on the ToggleSwitch
- fix missing setOnCheckedChangeListener() when restoring the SwitchBar state

Change-Id: I818577004f142be46fa378389f264c7f37cfd7b8
2014-06-27 19:01:38 -07:00
Fabrice Di Meglio
138ff8c045 Make the SwitchBar appear immediately
- change the way the SwitchBar is shown and hidden
- save its state
- remove the delay transition code

Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
2014-06-12 11:13:23 -07:00
Fabrice Di Meglio
e9cb75c636 Entire Switch bar should be a touch state
- add click listener for toggling the Switch and its text
- add Ripple background to the SwitchBar to make a nice Ripple
when there is a click/touch

See bug #15385724 Entire Switch bar should be a touch state

Change-Id: I26ef77ace596029e9c3e1e17b153b54df4a9110e
2014-06-02 16:29:18 -07:00
Fabrice Di Meglio
6220275d6d Use SwitchBar for Accessibility Settings
Deals with Talkback / Captions / Magnification Gestures

- follow up CL to 4193776698

Related to bug #14898161 On/Off switches must move down from Action Bar

Change-Id: Ibda0ed05b399f1b2b4464c5b22a3e9fd3d378867
2014-05-15 17:44:26 -07:00
Fabrice Di Meglio
4193776698 Introduce SwitchBar widget
- SwitchBar is a LinearLayout that containts a TextView and a Switch and
is intended to replace all Switches that are put in the ActionBar as a
custom view
- use the new SwitchBar for WifiSetting only for now (a later CL will
take care of all the other Setting that are using a Switch in the
ActionBar)

Related to bug #14898161 On/Off switches must move down from Action Bar

Change-Id: I5e98dbe995bba8f440d08459e09ca3ac09d3464b
2014-05-14 16:42:06 -07:00