Use DiffCallback in ContextualCardsAdapter to only update items that
are changed instead of touching those unchanged ones.
Also fix a bug where ConditionContexualCardCard#onStart is incorrectly
skipped.
Fixes: 112245748
Bug: 118165942
Test: robotests
Change-Id: I7989d621764fe40a3fceb8c9f40baced840818ba
When the last custom card for a specific type is removed,
onContextualCardUpdated should receive the cardtype info so we can
remove it from main data set.
- Reverted onContextualCardUpdated method signature back to before
- Force ConditionContextualCardController to send an empty list if
everything is removed.
* Note: the update logic is pretty complicated to handle
add/update/remove all together. In the future we should consider
spliting the removal logic to simplify this area.
Change-Id: Ied688deb693ec33e0017be02cf5c743a754a6e61
Fixes: 115572494
Test: visual
There are currently 2 ways a list of contextual cards can be updated:
1. through loader onFinishLoading
2. onContextualCardUpdated
We need to make the data handling logic consistent between the 2 paths.
Also changed some loops to stream for simplicity.
Change-Id: I242732e180a14092f5745271e5f63c18a6e482e0
Fixes: 115572494
Test: robotests
Custom cards might need to monitor lifecycle events, waiting for
onFinishLoading is too late.
Also make sure custom cards cannot change card type.
Test: manual
Change-Id: Ib8f8e6e48926a63c9d241ed9e9843c025e3f634a
- Rename a few more things from Homepage* to ContextualCard*
- Fixed a wrong parameter that GridLayoutManager was using
Test: rebuild
Change-Id: I7986b1caf63158e876295de6d31dbbe05581664d