This stops a jarring animation that occurs when returning to the
settings top level when legacy contextual cards are enabled and
shown at the top of the top level list,
Bug: 142936956
Test: Manual
Change-Id: I43605adf6f1bf63cc40157ac97c8e3295dd3cd99
Settings will not refresh conditionals status if there is no condition
card in homepage when Settings homepage gets in/out of window focus.
Whether or not there are conditional cards in the homepage, Settings
should always refresh conditional cards.
Fixes: 129725565
Test: robotests, visual
Change-Id: I1ed309d3fd4f7a2ba911097ea6b049c2aff48c8a
Some conditionals do not work properly when users toggle its state in
QS, the cause is that these conditionals don't have a way to monitor the
status changed. Make RecyclerView handle onWindowFocusChanged event and
make sure that conditionals can update the status when going back to
Settings from QS.
Bug: 118387886
Bug: 123171638
Bug: 123167705
Test: visual, robotests
Change-Id: Ib3bb9bf43afaa58726502eea1e98bcf602bc3677
- Introduce a static long in SliceFeatureProvider that updates once
every "session". A session is when user is in an UI (screen rotation,
going to subpage, etc does not break the continuation of session).
- Use session token in ContextualWifiSlice to determine when to refresh,
instead of relying on WeakHashMap from CustomSliceManager.
WeakHashMap can be cleaned up at any time by gc so it doesn't match
what we want on the UI.
- Also as a side fix, merged CustomSliceManager into
SliceFeatureProvider.
Fixes: 123937830
Test: robo
Change-Id: I199bceceb208b99a32f3f08e624787b5a03e73a9
Add a way to get the timeout limit of contextual card loading from
Settings.Global. If Settings.Global doesn't have the timeout limit, will
use the default timeout limit.
Bug: 124460999
Test: robotests
Change-Id: I2a25570f51013b566914e485d61405f14290d338
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
Slice cards in contextual homepage are shown as half card or full card.
We will use Category field of ContextualCard to decide card width.
In this CL, also fixed the problem of not showing full card after a
consecutive suggestion card dismissal.
Bug: 119655434
Bug: 121315057
Test: visual, robotest
Change-Id: I3243b9db21b8f288cab88238b20d7d50a2a20d46
Currently if users dismiss a card or navigate back to the homepage,
new suggestions will be auto filled in. We should only add new cards
upon next visit.
Also fix suggestion cards undismissable problem.
Fixes: 121175037
Bug: 120628661
Test: robotests
Change-Id: I01d74aaaa21c8408e5cecafef04a7d52c97bccc5
- Intially setting it to 1 second.
- Also changed card appear animation from drop in to fade in. It looks
less janky if we don't animate any size change.
- And some random code cleanup
Change-Id: I6e73bcf98fd9aa1d76ae002b94ab5b068dfecf1e
Fixes: 120916829
Test: robotests
This symptom only occurred in the case of more than 3 conditional cards
and no suggestion cards in homepage. It is caused by incompletely keeping
conditional cards. So adding missing card types makes conditional cards
be kept correctly.
Bug: 120115919
Test: robotest
Change-Id: Ic67c0a813de4f966c164bf92e4d4d64debcf95be
After having card dismissal mechanism implemented, it is possible that
the card list loaded from the card loader will be empty (users may
dismiss all cards). When there is only one card remaining on the screen
and user dismiss it, the card should go away.
Fixes: 119580732
Test: robotest
Change-Id: I7ae3b03f16a0b8b009d8aa77811b5a6d39c359e7
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
When legacy_suggestion flag is turned on, load Suggestions from
SuggestionService instead of contextual homepage, because contextual
homepage infrastructure might not be availble on all devices.
Bug: 118842099
Test: robo
Change-Id: I91710c005e11be5a9b3dd39ceff670106e7f80c3
For dismissal mechanism, we will have to get information about those
dismissed cards that are stored in Card DB with flag "dismiss" to filter
them out. Currently we only do the entire loading in fragment's
onCreate(), so only when the fragment is recreated users can get the new
data. Now we are changing it to onStart() and make the loader restart so
we are able to show the latest cards.
Change-Id: I4c0be297232f026b46feb8084084816e1acc8f11
Fixes: 119090460
Bug: 113783548
Test: visual