From 6cf3591645e571c1bf4c2a673ae48e5a0870c3d5 Mon Sep 17 00:00:00 2001 From: Emily Chuang Date: Mon, 5 Nov 2018 20:18:56 +0800 Subject: [PATCH] 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 --- res/layout/homepage_slice_tile.xml | 58 ++++++++++++++++--- res/values/strings.xml | 8 ++- res/values/styles.xml | 51 +++++++++++----- .../ContextualCardController.java | 2 + .../ContextualCardManager.java | 8 +-- .../ControllerRendererPool.java | 3 +- .../ConditionContextualCardController.java | 5 ++ .../ConditionContextualCardRenderer.java | 4 +- ...acySuggestionContextualCardController.java | 5 ++ .../slices/SliceContextualCardController.java | 11 +++- .../slices/SliceContextualCardRenderer.java | 29 +++++++++- .../SliceContextualCardRendererTest.java | 49 ++++++++++++++-- 12 files changed, 196 insertions(+), 37 deletions(-) diff --git a/res/layout/homepage_slice_tile.xml b/res/layout/homepage_slice_tile.xml index 28cdfb1c098..dbdb91bec8c 100644 --- a/res/layout/homepage_slice_tile.xml +++ b/res/layout/homepage_slice_tile.xml @@ -21,13 +21,55 @@ android:layout_height="wrap_content" style="@style/ContextualCardStyle"> - + android:layout_height="wrap_content"> - + + + + + + + + + +