When the switch controller was disabled by admin, we will show the
restricted info icon on it and when user click this icon, it should pop
a dialog to notify user current action not allowed.
This issue was caused by the solution of fixing the a11y view focus
issue b/124334500, it has been disabled the focusable and clickable
attributes of icon then to block the dialog showing.
Recover the focusable and clickable of restricted info icon to fix it.
Fixes: 136439565
Test: visual, robotests
Change-Id: I227add696870e07feca288073e90afa8e76954ee
This reverts commit 7eddb0e4dc.
Reason for revert: There's some side effects with string.
Create a new CL in master branch to fix it.
Bug: 132840332
Change-Id: I17526a06474d25bdb32beda96f5bb6371f0e5ade
Change the focusable and clickable of SwitchBar and ToggleSwitch
to avoid multiple focus with TalkBack
Bug: 124334500
Bug: 128475156
Test: Visual
Change-Id: I13003f4e17d4c76644f87095c140f005b38889af
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
After ag/3818911, touch event of Switchbar is delegated to the switch.
When the SwithBar is disabled by admin, switch is GONE and restricted icon
is VISIBLE instead. We should let touch event be delegaed to restricted
icon and show policy transparency dialog when it's clicked in this case.
Cherry-picked from ag/3924516.
Bug: 77898233
Bug: 70206452
Test: Manually via setting disallow_share_location in TestDPC.
Change-Id: Ifa4fa6ebbe7986277f5cd0951a399ea2377a39f9
The entire switch bar is supposed to behave as a switch,
so it had logic for clicking the layout that duplicated
the logic for the switch itself.
I'm removing all of this duplicate logic and using a
TouchDelegate instead.
This preserves the same behavior with much simpler code.
The previous approach led to accessibility being confused
about exactly what was clickable and what would happen
when different items were clicked. Workarounds to deal with
that confusion created other problems. Sweeping all of it
aside and using a TouchDelegate seems way cleaner.
Bug: 75962891
Test: make SettingsRoboTests
Change-Id: I4fe17d581b5294d2482392f75bf1607126cf235d
- 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
- 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
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
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
Bug: 30110675
onClick is only called when the switchbar is clicked. We also need to
log when switch itself is clicked.
Change-Id: I892b72daeefe0f36608a73fe509199e200376eb7
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
- 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
- prevent onSaveInstanceState() on the ToggleSwitch
- fix missing setOnCheckedChangeListener() when restoring the SwitchBar state
Change-Id: I818577004f142be46fa378389f264c7f37cfd7b8
- change the way the SwitchBar is shown and hidden
- save its state
- remove the delay transition code
Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
- 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
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
- 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