Commit Graph

36 Commits

Author SHA1 Message Date
Jiaming Liu
1c0af48f8c Fix build for jetpack update
Fix build for jetpack update

Bug: 265818545
Test: build

Change-Id: If48e7338ee560d995cb8bff7b5348ab36c457836
Merged-In: If48e7338ee560d995cb8bff7b5348ab36c457836
(cherry picked from commit e65283de6a)
(cherry picked from commit 5a6444776a)
2023-02-14 02:04:33 +00:00
Diego Vela
d2dfc4285e Update ActivityEmbedding usage.
Bug: 259592300
Test: build.
Change-Id: I8e4aa8daf51cb9c669d06b152cc5a2fc69a06571
Merged-In: I8e4aa8daf51cb9c669d06b152cc5a2fc69a06571
(cherry picked from commit a9394d1796)
(cherry picked from commit 65bb5a09f4)
2023-02-14 00:36:20 +00:00
Stanley Wang
0a9a9d34a7 Send pre-index intent at Settings first started
Bug: 244521263
Test: manually test and review UI
Change-Id: I654a562b62256fd673f65949dd264f75574444c0
(cherry picked from commit 59446252d7)
2022-10-28 07:33:41 +00:00
Jason Chiu
5bc2dc4ae9 Simplify the duplicate click checker logic
Test: manual
Bug: 215267159
Change-Id: I7724883b351d360525c51d31714b7e31855a6c82
2022-05-23 12:57:19 +08:00
Jason Chiu
e04dfaa29e Filter out the duplicate click event on menu page
Whenever the highlighted item is clicked, Settings shouldn't start the
second-layer page again even if the user goes to its child page.
Ex. When the user goes to the Tethering page, clicking on the menu
entry "Network & Internet" should not switch to the page.

Exception: in the deep link case, allow the first click event on the
highlighted item to launch the second-layer page when the page is not
the same as the one on the right pane.

Fix: 215267159
Test: manual, robotest
Change-Id: I2315e0069facc4867cb157752b1a3144716b7d17
2022-05-20 15:01:31 +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
1c8e07438a Merge "Prevent scrolling after the homepage recreating" into tm-dev 2022-03-16 04:29:15 +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
Tsung-Mao Fang
00cbd72c60 Rename back button to navigate up button
A minor wording review.

Test: build pass
Bug: 219000314
Change-Id: I23bc580b193cc891b659514d13705db2c55b756a
Merged-In: I23bc580b193cc891b659514d13705db2c55b756a
2022-03-07 08:47:30 +00:00
Tsung-Mao Fang
2df79641cb Show/hide back button for 2nd page
By design, we want to show/hide back button for 2nd
layer page when it's in two pane mode.

Test: Manual test
Bug: 219000314
Change-Id: I14d8d7ee08280d5ce80c0b59e1e91d077f0b6d09
2022-02-16 18:01:42 +08: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
11d3b19c51 Fix the highlight error after unfolding the device
Unfolding a device generates mutiple lifecycle events and resets the
highlight key.

Check if there's only one activity in the task and then perform the
reset.

Fix: 209016927
Test: manual
Change-Id: I49988fa913270d35a04436777433b7669afb72df
2021-12-10 22:37:22 +08:00
Jason Chiu
8c559c2788 Fix the highlight error and remove the empty card
Fix: 209918251
Test: manual
Change-Id: I2a5afceea18cd4e1009114091433a2da22ac105e
2021-12-09 15:09:09 +08: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
Jason Chiu
90eef24080 UI refinement of highlighted menu entry for large screen
- Add a new highlight background drawable
- Add two homepage specific preferences for the new layout design

Fix: 207079684
Test: visual
Change-Id: I20c80da090a03129bffa845d443ee5d1ad13b97b
2021-11-22 12:36:05 +08:00
Jason Chiu
3af73364ba Support highlighting the menu entry for Search results
1. Add a receiver to monitor the search state
2. Shoe/hide the menu highlight in the listener
3. Highlight the menu entry in SearchResultTrampoline
4. Enable/disable the receiver in SettingsInitialize

Bug: 205781792
Test: manual, robotest
Change-Id: Ia04901f504172f4f0c7b4b2ea7eda5f3713f676d
2021-11-11 14:33:26 +08:00
Jason Chiu
ae5327d4bb Fine tune the homepage scrolling behavior
Scroll to the highlight position before showing homepage.

Bug: 199017944
Bug: 204946469
Test: visual
Change-Id: I11708f42180a3af22855ac7b5f53460f737ed208
2021-11-05 18:21:59 +08:00
Tsung-Mao Fang
b3db40a02b Register rule for wallpaper entry
We should keep consistent split rule for wallpaper and other home menu
item. So, we create this cl to register the split rule for wallpaper.

Also, I do some minor refactoring in this cl for reusing existing
method and better code quality.

Test: Go to wallpaper, and click back key. App can close.
Fix: 204406425
Fix: 204364572

Change-Id: Ia7de9483b351d1121cc26c4af1cb8a89ad0a16bc
2021-11-04 18:48:59 +08:00
Jason Chiu
e427cc6752 Search experience improvement for large screen
- Support fragment and direct link in SearchResultTrampoline
- Start activity for SI case and start deep link trampoline for others
- Disable menu highlight whenever the search bar is clicked
- Don't overwrite SettingsApplication's homepage activity in
  SliceDeepLinkHomepageActivity
- Scroll to highlighted menu entry after homepage is loaded to prevent
  UI overlapping

Bug: 201724410
Test: manual, robotest build pass
Change-Id: I5115d17d829e85036000da2e80f0e5b0598c733f
2021-11-03 18:44:01 +08:00
Arc Wang
54998b7bfe [Large screen] Fix searched Subsettings back navigation bug
Settings app registers SubSettings SplitPairRule with clearTop
true, it will finish Settings app if users click back button on
a SubSettings page.

This change registers SubSettings SplitPairRule with clearTop
true when users click a SubSettings item in Settings home menu.

And this change registers SubSettings SplitPairRule with clearTop
false when users click a SubSettings item in search result.

Bug: 204501750
Test: manual
      1. Settings -> Search settings -> search a SubSettings item
         (e.g., Battery)
      2. Click the searched item.
      3. Click back button.
Change-Id: I6e1862de528e971137ae7087de608bbdd79096b2
2021-10-29 17:45:40 +08:00
Tsung-Mao Fang
fce8565e5e Update logic to check two pane resolution
Prior to this cl, we checked the app bounds for deciding
app in two pane or not. However, this might be broken in some certain
sceanrios.
Currently, api will check the entire task bounds.
If the width of task bounds is larger than two pane criteria,
then we treat it as in two pane mode.

Test: Highlighted behavior works correct.
Fix: 203763572
Change-Id: Ib14851b1e3e097328874c7956bb653f50820f877
2021-10-21 21:34:17 +08:00
Jason Chiu
29a09e55ba Revert "Revert "Support highlightable Settings homepage menu for 2-pane""
This reverts commit 096c090b80.

Reason for revert: crash is fixed in this change

Bug: 202510128
Test: manual, build
Change-Id: Ifff8d58cfdcf43e123b11dee308665b2617cb4b3
2021-10-12 09:32:07 +00:00
Greg Kaiser
096c090b80 Revert "Support highlightable Settings homepage menu for 2-pane"
This reverts commit 9037ceabd3.

Reason for revert: Presumed cause of b/202510128

Change-Id: I0daaab95d9bc57229c0c8c916cbe3ada7aafb6fa
2021-10-08 14:29:06 +00:00
Jason Chiu
9037ceabd3 Support highlightable Settings homepage menu for 2-pane
1. Add a preference group adapter to perform highlighting
2. Add a class for mapping highlighable menu keys and preference keys
3. Add an API to determine if the screen is in split mode

Bug: 199017944
Test: manual, build
Change-Id: I8e3fe5fb96480a31ee0f3b3afb6ad78999d3d2bc
2021-10-08 12:52:52 +08:00
Yanting Yang
be4c5f078f Remove silky flag from homepage for official release
Remove the silky condition and clean up redundant files.

Bug: 183670633
Test: robotests & visual with turning on/off silky home
Change-Id: I9259108534935ed8551748b922098dd52043afc1
2021-05-14 17:52:53 +08:00
Jason Chiu
7d9dceadb7 Redesign homepage IA icon
- remove the outer circle of the icons
- tint the icons including injected ones

Test: robotest, visual
Bug: 182870640
Change-Id: If72c37152f4f0d68e25149b11d497eef1c7ece91
2021-05-12 08:37:37 +00:00
Yanting Yang
4dd4567bfc Preliminary classification for homepage IA grouping
Bug: 168166015
Test: robotest & visual
Change-Id: If02639d8a5b8886e036b30c5c654c27db5837b62
2020-10-06 20:40:53 +08:00
Edgar Wang
77de405a5d Make TopLevelSettings un-searchable and direct result to relevant page.
Fixes: 149372187
Test: manual & robotest
Change-Id: I9daca03d1c11a262f8e3b55bb46aabbc035ece96
2020-02-14 17:58:38 +08:00
Edgar Wang
0934babbfc Make the fragment title can’t searchable
we shouldn't take users so deep into the settings IA because it's easy
to feel lost in settings after clicking on a result without additional
context.

Bug: 143055215
Test: robotest & manual
Change-Id: I337cb5ead31e1e4e7bf9be78132e90630f83ee43
2020-02-06 19:07:11 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Raff Tsai
1f30b1cd67 Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
2019-09-12 11:09:09 +08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
dd5828c054 Add PreferenceController for support tile in homepage.
Change-Id: I8fe93456a761382513c07ff85c858ded30f599fc
Fixes: 116875332
Test: robotests
2018-10-03 13:35:12 -07:00
Fan Zhang
7d5a9eebb8 Add a config to force rounded icon for DashboardFragment.
And each page has ability to turn on/off rounded icons. This CL only
adds the flag, it doesn't actually change icon shape yet.

- Boolean config in xml
- New protected method for each DashboardFragment to load config
- Plumb the boolean into DashboardFeatureProvider for future use.
- Remove some unused APIs from DashboardFeatureProvider

Bug: 110405144
Fixes: 79748104
Test: robotests
Change-Id: Id34782e75aa7289967e4dd1f4fe2978688092702
2018-08-10 10:57:18 -07:00
Fan Zhang
25d9f3812b [Dynamic Home] Make a new page for all top level settings
Since we are moving conditionals/suggestions to a different place, there
is no need to use DashboardSummary to display top level settings any
more. We can simplify a lot of code for top level settings and reduce it
to a standard DashboardFragment.

- Create a new DashboardFragment + xml for all top level internal items
- Add a PreferenceController to provide summary for Network & internet
  item.
- Mark a bunch of things deprecated for future work.

Bug: 110405144
Test: robotests
Change-Id: I9f778777131c28eb836b722e089e026a59f5ddc6
2018-08-08 17:20:15 -07:00