Commit Graph

667 Commits

Author SHA1 Message Date
mxyyiyi
5cbf3b0f74 Fixed battery tips card UI.
- Add highlight effect after navigate to new page.
- Update text format inside button.

Screenshot: https://screenshot.googleplex.com/8ib66dWzn6PZmhy

Fix: 296001546
Fix: 296339767
Bug: 291689623
Test: manual
Change-Id: Ic789e5feb684a109582477c553963a9a3f9936b8
2023-08-24 10:19:48 +08:00
Edgar Wang
cd74f76a43 Remove restricted icon in SettingsMainSwitchBar
- display disable status directly
- click disabled MainSwitchBar will show devicepolicy dialog
- make sure BT and location use MainSwitchBar correctly

Bug: 260406688
Test: manual
Change-Id: I8bb57213eec6dd5e991af580e1a06ebf8a867c28
2023-04-26 14:06:22 +08:00
ykhung
ab07b53ea1 Fix banner tip buttons visibility and update incompatible tip
Fix the battery settings banner tip buttons visibility not reset issue
and update the incompatible charging tip into the colored primary button

Bug: 246960554
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.widget.CardPreferenceTest
Change-Id: I9b72fccc7838d974d3b60d0f9684780841623cbb
2023-04-19 06:24:51 +00:00
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
tom hsu
23359bc0e9 Unify Tick Preference from Physic keyboard and Regional preference
- Also change icon color from colorAccentPrimaryVarient to colorAccentPrimary

Bug: b/272398108
Bug: b/264476709
Test: Manual test.
Change-Id: Ide602c6fb9501b832df646692ec618be8a76e7b9
2023-03-30 18:52:23 +08:00
Candice Lo
b132ada169 Create tooltip for notifying auto-adding the font scaling tile
1. Add string for the content of tooltip.
2. Show the tooltip if needed: the tooltip will only be shown once when users change the font size from the Settings page for the first time.
3. Since the layout shown on the screen will be recreated after font size changes, we need to save the state of the tooltip popup window to check if we need to reshow it in displayPreference.

Bug: 269679768
Test: Manually - attach videos to the bug
Test: make RunSettingsRoboTests ROBOTEST_FILTER=PreviewSizeSeekBarControllerTest
Change-Id: I1b6c5fdbd74c7a868cf42bd21d2cdb1052c0bbe6
2023-03-28 06:24:25 +00:00
Lifu Tang
caa1b51ef2 Revert "Remove duplicate strings."
Revert submission 19748582-settings_yesno

Reason for revert: Common strings in English could be translated into different strings in other languages.

Reverted changes: /q/submissionid:19748582-settings_yesno

Bug: 272603842
Test: build and open Settings app
Test: atest SettingsRoboTests
Change-Id: Iaad301c5513478fb95e40987ea3ccb4f923d71fa
2023-03-15 22:39:24 +00:00
Jiaming Liu
e65283de6a Fix build for jetpack update
Fix build for jetpack update

Bug: 265818545
Test: build

Change-Id: If48e7338ee560d995cb8bff7b5348ab36c457836
2023-02-03 02:37:42 +00:00
Diego Vela
a9394d1796 Update ActivityEmbedding usage.
Update ActivityEmbedding usage.

Bug: 259592300
Test: build.
Change-Id: I8e4aa8daf51cb9c669d06b152cc5a2fc69a06571
2023-02-03 02:34:20 +00:00
Bonian Chen
4ef920e9ef Merge "[Settings] Limit height of TextView when text too long" 2023-01-11 10:17:51 +00:00
Bonian Chen
61c45064cd [Settings] Limit height of TextView when text too long
Adjust the layout through having ConstraintLayout for limiting the
height of TextView.

Bug: 205460459
Test: local

Change-Id: Ic15af4c9be393a6855d78a5d9af086b099c9b689
2023-01-10 07:36:21 +00:00
Chaohui Wang
87e3064b33 Redirect to AppInfoSettings when SPA is on
From recently opened apps or when click app icon from some app info
pages.

Bug: 236346018
Test: Manually with Settings
Change-Id: Ia4e1789196875eb0d10fdb6363f0d65cb88cb563
2023-01-06 14:46:27 +08:00
Edgar Wang
81aaba00e7 Change preference value changed metrics log format
- Pass metric category into SharedPreferenceLogger
- Update MainSwitchBar metric log format

Bug: 246483846
Test: Robotest

Change-Id: I91c7b89ee35ae4922aea0d8c998f7d0e33365da2
2022-11-14 18:05:42 +08:00
Treehugger Robot
4b705596cf Merge "Ensure search highlight position when scheduled runnable starts" am: fcd941b4eb am: c54246e0c8 am: c2a1326104
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2263782

Change-Id: Iab157dbabcc85ce9f3b777729f450b5fa4a104eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-25 09:10:20 +00:00
Treehugger Robot
c54246e0c8 Merge "Ensure search highlight position when scheduled runnable starts" am: fcd941b4eb
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2263782

Change-Id: I3d0a338bb220705a255a7abc123d490ee19f44af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-25 08:01:42 +00:00
Shen Lin
bb2fb2ffd6 Ensure search highlight position when scheduled runnable starts
Search highlight function includes two steps: Scroll list to target position first, then notifyItemChanged to it.

We use a Handler.postDelay to implement this. However, when scheduled runnable starts, the original target position could have changed due to preference list update, calling recyclerview's methods after that will be easy to cause an exception.

This CL ensures highlight position every time before calling recyclerView update, which also contribute to origin fix of RecyclerView IllegalArgumentException to a certain extent.

Test: atest, also test some search results, and see the correct behavior
Fixes: 246411107

Change-Id: Ifa758ce3718b047138079246cdfce99fdf66d5b2
2022-10-21 14:01:47 +08:00
Chaohui Wang
507e5f8c90 Fix some errors for Settings project
Attrs could not have same name, so create a common parent for the
messageText. And BiometricEnrollCheckbox is not in use.

Replace some com.android.settingslib.R with com.android.settings.R,
because these are files in settings instead of settingslib.

Bug: 253772249
Test: TAP
Change-Id: Ifa796e923bf26facf4935be4968637affdb4b48b
2022-10-16 14:14:02 +08:00
Treehugger Robot
0681e8eb23 Merge "Fix the IllegalArgumentException from RecyclerView" am: 8f793f5e4f am: 227b8f0272 am: 4aea873647 am: 68a63e0280 am: 78b58e08f5
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2216421

Change-Id: I2067aa0f5e9cab8827b3171f4d511efaf526ac2b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 01:39:18 +00:00
Treehugger Robot
78b58e08f5 Merge "Fix the IllegalArgumentException from RecyclerView" am: 8f793f5e4f am: 227b8f0272 am: 4aea873647 am: 68a63e0280
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2216421

Change-Id: I0580d5dc5853ca5ed43a023aa5875750ed104f61
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-14 05:56:10 +00:00
Shen Lin
c463aee2b8 Fix the IllegalArgumentException from RecyclerView
Attempt to remove the animator as early as possible to avoid a RecyclerView crash.

Bug: 246411107
Related bug: 184214085

Test: manual.
Change-Id: I8fcb06836217f4de200a53bb88a1a0b5e42bbe21
2022-09-13 08:46:30 +00:00
YK Hung
b637d56d09 Merge "Update defend tips card" into tm-qpr-dev am: 8bf872331b am: 06e92f5e45
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19764101

Change-Id: I6bf829b5f72796eb136bc2e6745008e56032cfc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 16:22:41 +00:00
Wesley
243b450428 Update defend tips card
- Update defend tips card to unclickable
 - Update secondary button's action and content description
 screenshot: https://screenshot.googleplex.com/BYU8Mh5abJ9Tirh.png

Bug: 243769797
Bug: 243641857
Bug: 244219076
Test: make SettingsRoboTests
Change-Id: I7fdf5f7404d33f0374a992c83a7653a01b9f11bc
2022-09-01 04:09:31 +00:00
Kweku Adams
5949fccc7a Remove duplicate strings.
"Yes" and "no" were redefined many times with no clear benefit, so this
consolidates them into one definition.

Bug: 243843096
Test: Build, install, and open the Settings app
Test: atest SettingsRoboTests
Change-Id: I5f84d09f223efd478461ded93aeac82bf7b128d8
2022-08-26 00:07:08 +00:00
YK Hung
f2bbdf5035 Merge "Implements the buttons layout for the extra defend" into tm-qpr-dev am: aa3262857c am: 939f2a9eed
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19633714

Change-Id: I582c5cc6df9b9454013b4435d261c336fc4e7a4e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 03:23:26 +00:00
Pajace Chen
f3496399dd Implements the buttons layout for the extra defend
Bug: 235246949
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.widget.CardPreferenceTest
Test: manual test
Change-Id: I1dc4ab31adf85c684a4c09bd6c9bcfb54b52dc3c
2022-08-18 10:16:05 +00:00
PETER LIANG
e000f54431 Merge "Fix the inconsistent alignment of the main switch preference." into tm-qpr-dev am: aea8f1aeb2 am: 26c3c3a95c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19358210

Change-Id: Iaa9faf78d8fd4813e9725f246745744e98d0c325
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-25 12:44:12 +00:00
Peter_Liang
e1c4901ce8 Fix the inconsistent alignment of the main switch preference.
Remove the redundant function.

Bug: 232494666
Test: manual test
Change-Id: I1827d39b194048452b71c680e2bbf94e43bfcac5
2022-07-21 00:56:07 +08: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
692068d535 Add the jank detection to Settings toggles
Add jank detection when click the following preferences,
 - SwitchPreference
   Single target, detect click in InstrumentedPreferenceFragment
 - PrimarySwitchPreference
   Two target, only detect click switch in switch's onClick()
 - MainSwitchPreference
   Single target, detect click in TogglePreferenceController
 - SettingsMainSwitchPreference
   Single target, detect click in its onSwitchChanged()

Bug: 230285829
Test: manual & robo tests
Change-Id: I97a13e05a601237b16cd2d903ba2fb6ec4a69a74
2022-05-19 12:28:16 +08:00
Peter_Liang
f659095c07 Fix that once the phone is rotated to portrait orientation, the "Use TalkBack" toggle is truncated.
Goals:
1. Extends the api of apply partner's customization padding style in the Settings widget "SettingsMainSwitchPreference" to dynamically adjust the padding depending on the SetupWizard library.
2. Use the function to avoid the button being truncated.

Bug: 231512916
Test: manual test
Change-Id: I951776185eb1616136d9caf3a60f9daea4da191a
2022-05-13 08:44:18 +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
TreeHugger Robot
611db9e8be Merge "Remove loading spinner from Premium SMS access" into tm-dev 2022-04-29 02:30:14 +00:00
Stanley Wang
10c9cf6cd5 Fixe the problem of invalid switch preference.
The source of this problem is that onBindViewHolder is called
after the user add the OnMainSwitchChangeListener. Then
preference gets a new MainSwitchBar in onBindViewHolder and
causes the listener to fail.

Bug: 223325900
Test: Manually test and observe the UI
Change-Id: I6e58c4cf035811bb8805e76bebb5fbb86c7a79da
2022-04-27 17:17:21 +08:00
Stanley Wang
031cda05c3 Fixe the problem of invalid switch preference
- SettingsMainSwithBar will be recreated after the page is resumed.
  We should keep the OnMainSwitchChangeListener for
  SettingsMainSwitchPreference and re-register the listeners after
  the page is resumed.

Fix: 228930107
Fix: 222384287
Test: Manually test and see the UI
Change-Id: I9b57053989e611288cf4814b2a0ecbf9e3c55145
2022-04-27 03:41:06 +00:00
Jason Chiu
880471a1b0 Renew the highlight state color
Fix: 230283855
Test: visual
Change-Id: I725422518d07a0b0676731bd9da8384ab149ab1b
2022-04-25 15:34:42 +08:00
Mill Chen
5d33ca9120 Remove loading spinner from Premium SMS access
The loading spinner in the page is displayed by default, regardless of
whether or not how many apps are in the page. This change is trying to
remove the loading spinner from the page since this page doesn't have
many apps in it.

Bug: 222441974
Test: visual verify
Change-Id: I9b2b031122e6b6d521466ccf53e39185cfcab687
2022-04-22 13:41:45 +08:00
tom hsu
5281736004 [Panlingual] Add a description for per app language.
- This is to notify some app may not support to user.

Bug: 228415129
Test: local
Change-Id: I6205e0b5fdb3ee42a22ae4995c99e9d8dc5e0a2d
2022-04-14 06:47:13 +00:00
Jason Chiu
680fce3acd Refine layouts for large screen
- Support dynamic paddings depending on app's screen width
- Add round corners to homepage ripple effect to improve the transition
  of being highlighted
- Add an interface to support dynamic split layout for suggestion cards

Bug: 223300824
Test: robotest, manual
Change-Id: Iaca6b4fd3f7369179416ef084a800d7eb2ee4640
2022-03-30 04:54:30 +00:00
Jason Chiu
764e7fbc44 Prevent scrolling after the homepage recreating
- Only apply the layout transition when contextual home is enabled
- Do not scroll for highlighting when the homepage is recreated and
  never scrolled

Fix: 222238012
Bug: 222473415
Test: robotest, manual
Change-Id: I490c3f8dbca63a5250bae01555592b7795c90af2
2022-03-14 15:13:08 +08:00
Edgar Wang
b1a48df4f7 Remove restricted icon
Bug: 195401182
Test: robotest
Change-Id: I6b22b3b9b62812eb08f10492bd2d7908cce89d39
2022-02-08 03:09:50 +00:00
Jonathan Scott
c3dbc3ffbd Merge "Allow Device Management Role Holder to update Settings strings." 2022-01-31 19:10:30 +00:00
Peter_Liang
88d63ea3af New feature “Text and reading options” for SetupWizard, Wallpaper, and Settings (9/n).
- Fine-tune the legacy interface of the LabeledSeekBarPreference
1) If not set any label, the layout should be gone instead of visible. If not gone, the preference will have redundant space.

Bug: 211503117
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER=LabeledSeekBarPreferenceTest
Change-Id: Ideea8589e35083eb89495c0eceba38c62b4807a7
2022-01-27 20:33:04 +08:00
Peter_Liang
cc5808cbd7 New feature “Text and reading options” for SetupWizard, Wallpaper, and Settings (8/n).
- Extending the LabeledSeekBarPreference
1) Add new attributes, "iconStart", "iconEnd",
"iconStartContentDescription", "iconEndContentDescription"
2) Add new interface setOnSeekBarChangeListener
- It will be integrated with display/font size items in next patches.

Bug: 211503117
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER=LabeledSeekBarPreferenceTest
Change-Id: Id8fe4fb68062c0e92ca4c291d2f7c47303e8691e
2022-01-27 20:32:52 +08:00
Jonathan Scott
e0d439472f Allow Device Management Role Holder to update Settings strings.
Test: manual
Bug: 188414370
Change-Id: I6e1a06619799a9e99382d791e72e2e4518f93cac
2022-01-25 19:03:24 +00:00
Tsung-Mao Fang
13a76eb84e Update new API for checking the embedding status
Test: Make sure behavior is correct as it was in
search flow, higlight flow, regular settings flow, split screen flow.
Bug: 204399167

Change-Id: I7fc29c8cdbfc6682963591f4ff805070bea4ca22
2022-01-12 15:00:07 +08:00
Jason Chiu
d2e506fd20 Merge "Revise homepage highlight mechanism" into sc-v2-dev am: 7bfe3e869a am: 3b9ad4de7f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16366004

Change-Id: Ib86f125d24836fb955d5dd31ec26f250460d3161
2021-12-03 09:46:31 +00:00
Jason Chiu
a305c23f5e Revise homepage highlight mechanism
- Create TopLevelHighlightMixin to handle highlight actions and simplify
  TopLevelSettings
- Fix the error highlight and the flicker after screen rotation
- Postpone creating the fragment until it's needed to accelerate the
  initialization and to fix the search highlight function breakage after
  toggling light/dark mode
- Register activity embedding rules only once for injection and
  wallpaper
- Do not highlight Tips & support since it's full screen
- Refactor ActivityEmbeddingRulesController

Bug: 207316936
Test: manual, robotest build pass
Change-Id: If322ec180b03ee123987c70779a25c6a570d9faf
2021-12-03 12:04:48 +08:00
TreeHugger Robot
9eaf11e0c9 Merge "UI refinement of highlighted menu entry for large screen" into sc-v2-dev am: aee951dcb0 am: 517c9ead5e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16304401

Change-Id: I21d8dab4ebc3292bf49a50e518531f3c07098a5b
2021-11-24 18:44:52 +00:00