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:
@@ -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
|
||||
|
Reference in New Issue
Block a user