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
This commit is contained in:
Mill Chen
2018-11-02 16:27:23 +08:00
committed by Fan Zhang
parent 92792ee806
commit d20641059f
10 changed files with 339 additions and 38 deletions

View File

@@ -45,6 +45,7 @@ import java.util.Map;
*/
public class SliceContextualCardRenderer implements ContextualCardRenderer,
SliceView.OnSliceActionListener {
public static final int VIEW_TYPE = R.layout.homepage_slice_tile;
private static final String TAG = "SliceCardRenderer";
@@ -61,8 +62,8 @@ public class SliceContextualCardRenderer implements ContextualCardRenderer,
}
@Override
public int getViewType() {
return R.layout.homepage_slice_tile;
public int getViewType(boolean isHalfWidth) {
return VIEW_TYPE;
}
@Override