Commit Graph

23 Commits

Author SHA1 Message Date
Chris Antol
7bfd10736c Enable hover states for SeekBarPreference
Bug: 201499839
Test: manual testing on pixel device with wired mouse

Note: change was originally set for TM-QPR branch, but now targeting UDC-DEV instead
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ec11542cbe14f874c9fe17ee4c2a4c4e29ea748c)
Merged-In: Ibbbd0e0ef627576acb5eb3f4acb6d40dcceb0371
Change-Id: Ibbbd0e0ef627576acb5eb3f4acb6d40dcceb0371
2023-03-30 22:24:26 +00:00
Wesley Wang
d3bead822c Export callback to receive seekbar change event from SeekBarPrefernce
- Export onSeekBarChangeListener callback to receive change event from parent
  - Update battery saver schedule trigger threshold after seekbar tounch
    ending instead of update it every time during dragging or touching

Bug: 236356020
Test: make RunSettingsRoboTests
Change-Id: Ifee7cd9e7cabfbec0817a4c28254228f885d6a8d
2022-07-11 17:49:00 +08:00
Edgar Wang
4c07e2b865 Merge "Fix talkback speak "double tap to activate" on LabeledSeekBarPreference" into tm-dev 2022-05-24 12:07:41 +00:00
Edgar Wang
2b0d9cfc5d Fix talkback speak "double tap to activate" on LabeledSeekBarPreference
- SeekBarPreference should be unselectable
- remove unnecessary handling of Summary
- set currect Title color when preference is enabled and unselectable

Bug: 230553896
Test: robotest
Change-Id: Ie5d819088dc3c435005ddd00e232b2f6992b234a
2022-05-24 05:08:16 +00:00
Chaohui Wang
f311566b85 Add the jank detection to Settings sliders
- Currently most the sliders are implemented by
   com.android.settings.widget.SeekBarPreference.
 - Volume ones are implemented by VolumeSeekBarPreference, which resets
   the OnSeekBarChangeListener, so need special handling.
 - PointerSpeedPreference is standalone, added separately.

Bug: 230285829
Test: Verify trace via jank developer guideline.
Change-Id: Ia2978df196676ad6675d2834f6af6cb2aa9094cf
2022-05-03 11:06:34 +00:00
ykhung
64112f65fd [GAR] fix spoke a percentage number is not the same as displayed content
in the Battery Saver and Battery Share, we have customized rule to map
the seekbar progresss to another displayed percentagge value, which
cause the a11y will speak the incorrect state, since the state is
referenced the original progress value. we add a method to override it
into our cusromized value.

Bug: 187780942
Bug: 190958777
Test: make SettingsGoogleRoboTests
Change-Id: Ie630ac03e66c2f8da1df00d6d2616b2e6979aa3e
2021-06-15 08:09:17 +00:00
Edgar Wang
cdff5c6ceb Revert "Apply SettingsLib SeekBarPreference to Settings"
Revert submission 13422386-seekbar-sc-dev

Reason for revert: build broken in SettingsGoogle
Reverted Changes:
I0c2d0d5fb:Apply SettingsLib SeekBarPreference to SettingsGoo...
I1844bb3b0:Apply SettingsLib SeekBarPreference to a11y vibrat...
Ia3e4adec8:Apply SettingsLib SeekBarPreference to a11y vibrat...
Iadee57e9d:Apply SettingsLib SeekBarPreference to a11y vibrat...
I219878716:Apply SettingsLib SeekBarPreference to Settings
I959f5672c:Create SettingsLibSeekBarPreference
I92545a69c:Apply SettingsLib SeekBarPreference to a11y vibrat...

Change-Id: Ie6c3b0dc072e044796abdb33fca305f9f9d47c4d
Bug: 176818438
2021-06-08 09:47:51 +00:00
Edgar Wang
d6b5bbb5cb Apply SettingsLib SeekBarPreference to Settings
Bug: 176818438
Test: robotest

Change-Id: I219878716457ce4bb7cad251bccf5d50d93030a5
2021-06-07 18:09:19 +00:00
John Li
8622d91973 Perform haptic feedback when the seekbar snaps.
- add haptic feedback mode to perform haptic feedback as the seekbar's progress value is updated.
- add haptic feedback mode to perform haptic feedback as the seekbar's progress value is equal to the min/max value

Bug: 172900709
Test: make -j42 RunSettingsRoboTests ROBOTEST_FILTER=SeekBarPreferenceTest
Change-Id: I9378313d366f09bb8e7069d9240fde24af318c53
2020-11-18 08:08:03 +00:00
Hugh Chen
2e5e04e79d Add a new method to set state description
- This CL add a new method setSeekBarStateDescription() to set
  the state of seek bar. Because in some case the description of
  seek bar is not align progress of seek bar.
- Add test case

Bug: 157629483
Test: make -j42 RunSettingsRoboTests
Change-Id: I432e6f9deef59756b0a41244d50aaada1ddac6a9
2020-06-05 15:00:45 +08:00
Raff Tsai
81b9f5083d Make SeekBarPreference to be selectable
Fixes: 132983200
Test: make RunSettingsRoboTests, manual
Change-Id: I3d4bc59d948236ff2482945a4fc976ee61c37c27
2019-05-21 11:39:02 +08:00
Edgar Wang
73454f2607 "Disallow adjust volume" restricted dialog didn't show
root casue: VolumeSeekBarPreference & SeekBarPreference will return
false when call isSelectable() then this preference won't perform Click

Fixes: 123745455
Test: Manual & robotest
Change-Id: Iba27b503e8a272260c80bd41aecdd5cdbc39f962
2019-04-16 09:41:07 +08:00
Raff Tsai
736eae02bd Fix talkback speaks "double tap to activate" on preference
Talkback will speak "double tap to activate" on clickable view.
But the SliderPreference is not clickable. Because it is default
clickable for Preference. We should set android:selectable in every
SliderPreference.

Change-Id: I7bf09c2a7e2d8688352e35c1882674b6e73e5db7
Fixes: 121111172
Test: Manual
2018-12-20 06:57:52 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Phil Weaver
16904e3019 Merge "Improve battery saver setting a11y semantics" into pi-dev am: 577f2af92b
am: d7d1f98fa7

Change-Id: Ic79fa7da89397c517acd3087e23d652056296e89
2018-04-26 17:57:23 -07:00
Phil Weaver
1979829294 Improve battery saver setting a11y semantics
Adding the ability to override a couple a11y traits
of the Settings version of SeekBarPreference.
Setting semantics for the battery level to report
itself as a percentage. Also tweaking the content
description to use a different title. The title isn't
exactly what I'd like, but it is better than just
saying "At 15% - 15%".

Bug: 74357845
Fixes: 78479637
Test: Used a custom accessibility service to inspect
the information coming from the battery saver seek bar.

Change-Id: I9db55cf0bb3cfee86a46d22c1208262407332d5f
2018-04-24 15:23:38 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Doris Ling
de08eaf437 Fix issue in ring volume sample not always being played.
- when we adjust the sound volme in Sound settings, we only re-post the
stop sample message when we receive the onSampleStarting callback.
However, if we change the volume while a sample is still playing,
onSampleStarting will not be called as it's already started. This
results in shortened sample duration, which in extreme case, the new
sample will not be played at all if the new volume change is made almost
towards the end of the previous sample period. So, everytime user change
the volume, we should re-post the stop sample message, so that the
sample playing duration would be extended properly.

- also removed the original calls to the onStreamValueChanged() during
init, as the original implementation is empty, and during init, we do
not need any handling to start/stop the sample.

Change-Id: I9f35ddfb6d809eeb83b1a732a09362286ff6ed77
Fixes: 77514234
Test: make RunSettingsRoboTests
2018-04-04 17:35:41 -07:00
jackqdyulei
b77fec0872 Add preference controller for battery seekbar
Also update SeekBarPreference so we can set min for it.

Bug: 72228477
Test: RunSettingsRoboTests
Change-Id: I5ab1bfd78b0bd461551012c121c7e76764843a30
2018-02-05 19:32:24 -08:00
Kevin Chyn
8b99c8cfa3 Add setShouldBlink method to get SeekBarPreference
Bug: 63642792

Test: make -j && make -j RunSettingsRoboTests
Change-Id: I92bb34282fe2b89644a3e004ec0da7d3c1f3db43
2017-07-14 22:45:01 -07:00
Philip Quinn
648ddd5c83 Add SeekBarPreference.getMax().
Bug: 63047816
Test: make -j
Change-Id: I416d044fa32f3aed32c1e6239baf9c57652bca2e
2017-07-07 03:39:40 +00:00
Fan Zhang
cbfe1eb881 Add title to SeekbarPreference content description.
Adding a title to contentDesciption of the seekbar.
The title is helpful to indicate which seekbar user is changing when
talkback is enabled.

Also move SeekBarPreference from root package to widget packge.

Change-Id: I793f41c4902e350b6bc6d62761362779cc3722a9
Fix: 35421942
Test: make RunSettingsRoboTests
2017-05-16 12:35:45 -07:00