Allow remote views to be used in Tiles
If a suggeested action Tile has a remote view defined, inflate a card layout to contain the remote view, instead of showing the default title-summary layout. Additionally, if the remote view has a view with ID @android:id/primary, that will be used as the click target rather than the entire card. Test: cd tests/robotests && mma Bug: 35668836 Change-Id: I0fd1b9c637b6d7a3d7d2f6268669917408a882eb
This commit is contained in:
@@ -65,7 +65,9 @@ public class SuggestionDismissController extends ItemTouchHelper.SimpleCallback
|
||||
|
||||
@Override
|
||||
public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
|
||||
if (viewHolder.getItemViewType() == R.layout.suggestion_tile) {
|
||||
final int layoutId = viewHolder.getItemViewType();
|
||||
if (layoutId == R.layout.suggestion_tile
|
||||
|| layoutId == R.layout.suggestion_tile_card) {
|
||||
// Only return swipe direction for suggestion tiles. All other types are not swipeable.
|
||||
return super.getSwipeDirs(recyclerView, viewHolder);
|
||||
}
|
||||
|
Reference in New Issue
Block a user