Refactor slice renderer to handle different card width

- Refactor SliceContextualCardRenderer to support for displaying slice
in half/full width card.
- Add two helper classes to separately deal with different card width.

Only the skeleton of the half card helper is put in this CL, the
implementation hasn't been filled in yet. Will implement the detail in
next CL.

Bug: 119655434
Test: visual, robotests
Change-Id: Iacdc90c23bf41cfa7ccae3c0c70a3b663e89307d
This commit is contained in:
Mill Chen
2018-12-19 00:07:17 +08:00
parent 06c514db6f
commit 497b3529dc
6 changed files with 350 additions and 85 deletions

View File

@@ -84,7 +84,11 @@ public class ContextualCardLookupTable {
LegacySuggestionContextualCardController.class,
LegacySuggestionContextualCardRenderer.class));
add(new ControllerRendererMapping(CardType.SLICE,
SliceContextualCardRenderer.VIEW_TYPE,
SliceContextualCardRenderer.VIEW_TYPE_FULL_WIDTH,
SliceContextualCardController.class,
SliceContextualCardRenderer.class));
add(new ControllerRendererMapping(CardType.SLICE,
SliceContextualCardRenderer.VIEW_TYPE_HALF_WIDTH,
SliceContextualCardController.class,
SliceContextualCardRenderer.class));
add(new ControllerRendererMapping(CardType.CONDITIONAL_FOOTER,