Commit Graph

9 Commits

Author SHA1 Message Date
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Anita Hemrajani
a865c3af6f Fix too many receivers Exception
Each time window focus changes on rotation,
a separate controller is created which further registers a new
receiver each time.

Bug: 173166718
Change-Id: I500a6ae5cf7058364e43baa44b7161c5dcfbc232
2020-11-13 04:08:13 +00: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
Mill Chen
da1ffe8807 Implement the collapsible feature of conditional card
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
2018-11-27 22:55:04 +08:00
Emily Chuang
1e24cb02dc Add contextual card dismissal implementation
When users clcik on the remove button in dismissal view, the card should
be marked as dismissed in the database, and the UI should be refreshed.

Bug: 113783548, 119594116
Test: robotests
Change-Id: I980600c4c0753ad5abc52ae63bac7196a4b818f1
2018-11-20 12:53:19 +08:00
Emily Chuang
6cf3591645 Add dismissal mechanism for contextual cards.
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
2018-11-13 14:46:44 +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
d20641059f Adjust lookup table mechanism to support new UI of conditional card
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
2018-11-06 16:09:17 -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