Commit Graph

10 Commits

Author SHA1 Message Date
Yi-Ling Chuang
682a30f4c9 Clean up unused DB columns.
Remove some columns from Contextual Card DB as they are never used.

Fixes: 143058171
Test: robotests
Change-Id: Ic618ccba16c3ed9f0a85b905535916e5d062d79e
2020-02-14 19:59:35 +08:00
Yi-Ling Chuang
acb50f2c6a Force the adapter to rebind cards with a toggle.
A card dismissal and scheduled card collection trigger a reload. During
card reloading, we perform slices pre check. The pre check goes through
the whole slice binding process, which means slices will be pinned and unpinned.
Hence, the on screen slices will gets unpinned resulting to the
unresponsive toggling.

As we have DiffCallbck implmented, if the card list are the same, then
bindView in the renderer will be ignored, which means the unpinned slice
will have no chance to re-register slice callback. So here we force it
to rebind the views.

Fixes: 123174237
Test: robotests
Change-Id: Id98bc16632bf024cbb611b40890e4d2629f08d7b
2019-04-23 17:19:56 +08:00
Yi-Ling Chuang
eeea6676d4 Add implementation of homepage swipe to dismiss.
- 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
2019-03-28 11:59:45 +08:00
Mill Chen
1c3ed19a09 Remove mIsHalfWidth field from ContextualCard
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
2019-01-16 04:01:45 +00:00
Jason Chiu
c0c5511862 Add vertical and horizontal dividers for large cards of homepage
- 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
2018-12-13 03:40:05 +00:00
Mill Chen
7fb3461a59 Implement the renderers for conditional header and footer
Bug: 119593268
Bug: 113451905
Test: visual
Change-Id: I43d6ca8508f0ba49796004d679d6cbe37ddf4455
2018-11-27 10:45:39 +08:00
Raff Tsai
3dbd1651d8 Change function modifier
- We need to use getName() function in different package

Test: rebuild
Bug: 79698338
Change-Id: I2e7eb71863fee14f58e84efd8064891f7e34fd3c
2018-11-14 17:42:25 +08:00
Fan Zhang
2a98c843e8 Loading suggestions via legacy SuggestionService sometimes
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
2018-11-07 11:55:09 -08:00
Mill Chen
0ca7130403 Update new UI of conditional cards
- Add half-width and full-width layouts for conditional cards
- Keep origin strings of conditional cards, that could make conditional
cards truncate its title and summary in half-width card.
- Add default value of isHalfWidth to each condition controller.

Bug: 113451905
Test: robotests, visual
Change-Id: Ib0055f32c4ab9e73c0e0a57c6b0ef586d52942e0
2018-11-07 16:06:31 +08:00
Fan Zhang
5e6e6a14f2 Move all contextual card related classes.
... from homepage to contextualcards.

Test: rebuild
Change-Id: Id7889566ce1e7257eb699d963ae996906fdb58ff
2018-10-26 10:02:04 -07:00