Commit Graph

13 Commits

Author SHA1 Message Date
Tim Peng
2f47d771fb Add 12dp padding above the first slice item
-Add an extra padding in adapter for dedicated panels
-Add test cases

Bug: 154181365
Test: manual test
make -j50 RunSettingsRoboTests
"adb shell am start -a android.settings.panel.action.INTERNET_CONNECTIVITY"

Change-Id: I65bc26c23ca5a7f1b433c36ac7ddf1a658793719
2020-05-06 09:04:25 +08:00
Tim Peng
db7d61d0a2 Adjust layout for Slice InputRange
-Make title to slider aligned
-Add test cases

Bug: 147462114
Test: make -j50 RunSettingsRoboTests
Change-Id: Ib1d076f77eae75e4f861a80873117b6254729fe5
2020-03-09 21:50:58 +08:00
timhypeng
e60684c175 Extend panel max slice number to six
Bug: 147332809
Test: make -j50 RunSettingsRoboTests
Change-Id: I523af9ba1b2bd172cb544bf7d6ddb15f5f9d5aef
2020-01-08 05:41:22 +00:00
Raff Tsai
d9cfbaf3b5 Fix volume panel hang
SliceLiveData changed its behavior, if slice is null, it will not
notify LiveData observer but callback to onErrorListener. We only
reduce PanelSlicesLoaderCountdownLatch in LiveData observer.
Therefore the error slice caused PanelSlicesLoaderCountdownLatch
never count to 0, the UI was not displayed. It is solved by reducing
PanelSlicesLoaderCountdownLatch in onErrorListener and also not return
null in MediaOutputIndicatorSlice.

Test: manual
Fixes: 141084035
Change-Id: Iddb2dbdc0e0d2ac3e26071960bb667937f181121
2019-09-18 11:40:46 +08:00
Raff Tsai
ad004e9beb Fix media switch slice doesn't display in panel
Fixes: 140396725
Test: manual
Change-Id: Idf0b766ce5f4316ff90a23faf3083cdee9854562
2019-09-04 11:34:23 +08:00
Jason Chiu
e856e2b738 Change deprecated slice APIs to new ones
Bug: 138979954
Test: robotest
Change-Id: Ibc430f9975d4e40be00ae4ba61833e94cd090a0c
2019-08-14 11:34:27 +08:00
Lei Yu
3aacfca16f Fix issue in panel logging
Update log key to slice uri since previous key has no meaning.

Previously it is something like:
androidx.slice.widget.SliceLiveData$SliceLiveDataImpl@1a30b5

Bug: 131094876
Test: Manual
Change-Id: I52d605eb826821ef622aa075c04f829c60692976
2019-04-24 12:50:46 -07:00
lindatseng
634d8b3ee4 Set max num of slices allowed in panel view
Setup a max allowed num for PanelSlicesAdapter to prevent too
many slices showing in single panel.

Test: Manual verify
Test: atest PanelSlicesAdapterTest
Fixes: 129358092
Change-Id: I7b72a29489e597b8309d74841eaeab0fe42aace6
2019-04-16 17:28:14 -07:00
Matthew Fritze
b6fdd25c23 Add entry animation to Settings Panels.
Settings Panels as a dialog have a default animation for entering the
screen, but Slices complicate the animation. While the dialog enters the
screen, Slices begin to bind, thus changing the height of the dialog as
it enters, causing perceived bounce / jank in the animation.

This CL is cherry-picked/based on ag/6671083 but do the following modification:
(See the original commit message for the whole concept)

When trying to load all the Slices, there are few possible situations:
1. Slice starts loading slowly, starting at state LOADED_NONE
2. Slice is loading in progress, having state LOADED_PARTIAL
3. Slice is loaded, but there's error return from the Slice data (We don't
need to show the Slice in this case)
4. Slice is loaded, progress to state LOADED_ALL
5. Slice starts from state LOADED_NONE, but never progress to the next state
because it crashes at setting backend.

Notice that there are two cases that the state will stay at LOADED_NONE and
we can't distinguish them.

Hence, we decide to do the following:

If Slice is with error (case 3) we remove the slice from the list and mark it
loaded.

If Slice is loaded with LOADED_ALL (case 4, which is the ideal case), we mark
it as loaded.

In the other cases, we fire a handler to mark the slice loaded anyway after
250ms timeout.

When all the slices are marked loaded (which should happen after 250ms timeout,
we will animate the panel out.  Although there might be slices which are still
partial loaded, we can still have the slice in the panel once it is ready.
The panel might bounce/jank in this case, but at least it will still showing
correctly, and should show up smoothly in most cases.

The solution to this problem is twofold:
1. Load all Slices first
2. Create a custom animation to draw the panel once the recyclerview has
been laid out.

Test: Manual/Visual inspection
Test: make -j40 RunSettingsRobotests
Bug: 123942159

Change-Id: I639a707aa4ba3f906bd6f9752c92727aaba28142
2019-04-16 16:29:04 +00:00
lindatseng
cf93c8bc92 Remove divider above device switcher in panel
Remove the divider above the media device switcher Slice per the request.

Do a little refactor in Panel View, to use DividerItemDecoration instead of adding
divider views in layout file as the recycler view items divider.

Since dividers should be shown in most cases, we are setting DividerCondition to
DIVIDER_CONDITION_BOTH and default true to allow divider.  For the slice we don't
need divider (media device switch in this case) we are setting the the target
direction of isDividerAllowed (above in this case) to false.  Since we have
DIVIDER_CONDITION_BOTH, if one of the item view set the divider not allow, the
divider won't be shown.

Test: Visual/Manual inspection
Fixes: 126205139
Change-Id: Ic857705c90819ef9375f877a44bb32987b5d4438
2019-04-05 14:15:16 -07:00
jackqdyulei
369ad5a9cf Make Panel accept TitleItem for first row
Fixes: 128611750
Test: Manual
Change-Id: If1604f293d9fa7d538750a07cdbb729f5cc099dc
2019-03-14 10:58:35 -07:00
Matthew Fritze
b197110f71 Add logging for SettingsPanels
The 3 main categories are:
- Panel Opened
- Panel Closed
- Panel Slice interaction

There are 3 close events:
- See more button
- Done button
- Clicking outside the panel

Slice interactions will log the Uri of the Slice and the ActionType,
such as Toggle, Slider, Content (intent).

Change-Id: Iecad948f39f50dd12ae1bcb23a5d523e0df8bb98
Fixes: 117804231
Test: robotests
2019-02-13 16:06:24 -08:00
Matthew Fritze
c14316c4a9 Update SettingsPanel UI
UI changes include:
- RecyclerView to host slices
- Font family to headline font
- Title is now centered
- Added SeeMore & Done buttons
- Horizontal Dividers between slices
- Indented Slices
- Landscape layout is fullscreen

Change-Id: I3549c847fc88edd81f670ddfa2907dd3741441e0
Screenshot: https://screenshot.googleplex.com/RzWktzOZJkc
Test: Robolectric
Test: Manual app
Bug: 118622007
2018-11-30 13:26:50 -08:00