Many users leave Settings app by pressing Home key, but Settings remains
in the same card status and doesn't update when users come back, which
may lead to a bad UX.
This change reloads cards and resets the UI session for some events,
including home key, recent app key, and screen off.
Fixes: 151789260
Test: robotest
Change-Id: Idb575cef4a58894984cb42238d7b3b43c49389a3
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
- 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
- Create an ItemTouchHelper.
- Attach the helper to the recycler view.
- Pass change to the adapter to handle the swipe.
Bug: 126214056
Test: rebuild
Change-Id: I312ee1357158db84f9ee328be4722fe067984604
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
Add two control views for conditional card to achieve collapsibility.
One of these control views is a footer that is appended to the last
position when expanding all conditional cards. The other is a header
that is used in the collapsed state of conditional cards.
Bug: 119593268
Bug: 113451905
Test: visual, robotests
Change-Id: I39e79b8925a9e3e4ce80c422bcd0ba889aba5f6a
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