Bubbles up the long-press event from media rec item to the parent card.

Fixes: 194539523
Test: Local builds
Change-Id: I10fc0a80e8cada93fb3a8eb94d7103f48499b818
This commit is contained in:
cecilia
2021-09-13 22:04:39 -04:00
committed by Cecilia Hong
parent 9abebd2175
commit 4423e58148

View File

@@ -254,7 +254,8 @@ public class MediaControlPanel {
openGuts();
return true;
} else {
return false;
closeGuts();
return true;
}
});
mRecommendationViewHolder.getCancel().setOnClickListener(v -> {
@@ -587,6 +588,14 @@ public class MediaControlPanel {
ViewGroup mediaCoverContainer = mediaCoverContainers.get(uiComponentIndex);
setSmartspaceRecItemOnClickListener(mediaCoverContainer, recommendation,
uiComponentIndex);
// Bubble up the long-click event to the card.
mediaCoverContainer.setOnLongClickListener(v -> {
View parent = (View) v.getParent();
if (parent != null) {
parent.performLongClick();
}
return true;
});
// Set up the accessibility label for the media item.
String artistName = recommendation.getExtras()