SliceLiveData is changed in the framework, where the way it handles null
slices is different. Thus, we handle the case of null slices by adding
onSliceError() to make slice refreshing back to normal and to prevent
from non responding action on slices.
Fixes: 141293788
Test: visual
Change-Id: I4751d57ae478eec66a1a951841d36521556cacd7
Converting to Soong will move some code from directly compiled
into the app to compiled into an Android library and then
shared between the app and the tests. This will cause resource
IDs in the library to become non-final, which means they can
no longer be used in case statements. Convert affect case
statements to if blocks.
Test: m RunSettingsRoboTests
Change-Id: I25742a374f06d3fa4decbfc0d223a350acc50881
Some contextual cards does not allow card dismissal, so they won't have
swipe background declared in the layout file. Add null check to prevent
from NPE.
Fixes: 132209310
Test: robotests & launch Settings
Change-Id: I31f897f445c4901d007c8187fe69aea416b915d1
Only make swipe background visible once slice has a successfual binding.
Bug: 131843256
Test: robotests
Change-Id: I7866873a217e8ca882634a48108939022713c87b
We filter error slice in EligibleCardChecker but not filter it in
SliceContextualCardRenderer, these two part should use the same
logic.
Fixes:128687331
Test: manual
Change-Id: I217bc6b578ceb36b0a67b44dc8a08ecd02771d82
Contextual cards are not bound to homepage. Remove prefix homepage from
layout and theme names.
Next step: update names for some resource values (dimen/color etc)
Bug: 130250419
Test: rebuild
Change-Id: I5e901268462aaa37e00493080ae09af001784823
- Use view's visibility to control which view we should show.
- Slice view can be built with normal height after removing viewFlipper.
Bug: 129438972
Bug: 128689305
Test: robotests
Change-Id: If7e9bd30d5cb5bcd3b9ff9f09cc2eae36543b9e9
- Only enable swipe for slice full/half card.
- Add isPendingDismiss in ContextualCard to determine if we should show
dismissal view.
- Take out long press feature.
Bug: 126214056
Test: robotests
Change-Id: Ib03e605347b2f50d3c62fcd4f95875a21cc9ef1c
Deferred setup is not skippable as user will need to review all SUW
screens at least one time.
Fixes: 126225957
Test: visual, robotests
Change-Id: I7b32c2382f459690d3b136cf9faa543d04aa8d3d
If the db change comes from dismiss card uri. We don't
need to log card display again.
Fixes: 121196921
Test: Robolectric
Change-Id: I4e222187fafa8325e803fa6ee17ebb0b51fb8cb2
mIsHalfWidth in ContextualCard is too generic to identify its
responsibility, it is used to hold the value of is_support_half from
database and used to decide the card width. Also, it limits the
relationship of CardType-to-Renderer not to be extended to one-to-many.
To deal with this, we replaced mIsHalfWidth with mViewType to implement
one-to-many relationship of CardType-to-Renderer, and removed all
related logic of mIsHalfWidth.
Bug: 121303357
Test: robotests, visual
Change-Id: I03e14392272194424f317d11bf9d0d794a6133f4
- Refactor SliceContextualCardRenderer to support for displaying slice
in half/full width card.
- Add two helper classes to separately deal with different card width.
Only the skeleton of the half card helper is put in this CL, the
implementation hasn't been filled in yet. Will implement the detail in
next CL.
Bug: 119655434
Test: visual, robotests
Change-Id: Iacdc90c23bf41cfa7ccae3c0c70a3b663e89307d
- Extract dismissal view as a layout xml and reuse it in half card
- fixed minor naming convention
This new layout is composed of custom views and the purpose is to
show slice in half width form in contextual homepage.
Bug: 119655434
Test: visual
Change-Id: I224d8bc1b7f95f969f6a134a316bd80b4cd013ee
- set Icon as a title item rather than an end item in slice builders
- call showTitleItems in renderer
Test: robotest
Bug: 119639527
Change-Id: I043173968ceb3d34e38c2e43ad824b923e647d47
- Add a new field in ContextualCard to store whether this card is a large one
- Set dividers for large cards in renderer
Fixes: 119528161
Fixes: 119641839
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.homepage
Change-Id: I5cb95214789f44ccfd8d9ce2177ca2b84835b7a4
We are not able to guarantee the binding results in the pre-check and
real binding would always be the same sinc slice may decide what it
would be based on some conditions. Hence, we should reload data and
refresh UI when it comes to null to prevent from blank suggestion.
Bug: 120221527
Test: visual
Change-Id: I79790edfe7fc3af7b9c3b3a7df6a7ffa7d405d50
In order to receive updates of slices, we make sliceLiveData observes
slice views. When a slice is dismissed, it should stop observing
the view so the view can be recycled and reused.
Fixes: 120465506
Test: robotests
Change-Id: Ie4f12e9a3e6e0e7d59d3346ab17282707047bf16
Flip the card back to slice view if users exit the page instead of
getting the dismissal UI preserved. We should also reset the UI to the baseline
if users dismiss a card, so when the view is reused, slice view can
then be displayed correctly.
Change-Id: If5448c57dec44ef5c1d3472358d4ddc9398538b8
Fixes: 119820168
Test: robotests
In the homepage, we should allow cards to be dismissed.
- Implement card flipping upon card long pressing.
Bug: 113783548
Test: robotests, visual
Change-Id: I2ddb498321ba5c5078d6944aa2ef32f1386bdb10
Use layout resource id as the return value of getItemViewType
in the ContextualCardsAdapter to make sure the RecyclerView could
work normally, and adjust the lookup table mechanism to meet the
current design as well.
Bug: 113451905, 112578070
Test: visual, robotest
Change-Id: I8fa299e44025a0b71b6990d020e7f0683c153337