parent
fa27531c00
commit
5e490376f4
1 changed files with 11 additions and 4 deletions
|
@ -41,6 +41,9 @@ public class StickerRolloverTouchListener implements RecyclerView.OnItemTouchLis
|
|||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(@NonNull RecyclerView recyclerView, @NonNull MotionEvent motionEvent) {
|
||||
if (hoverMode && motionEvent.getAction() == MotionEvent.ACTION_UP)
|
||||
exitHoverMode();
|
||||
|
||||
return hoverMode;
|
||||
}
|
||||
|
||||
|
@ -49,10 +52,7 @@ public class StickerRolloverTouchListener implements RecyclerView.OnItemTouchLis
|
|||
switch (motionEvent.getAction()) {
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
hoverMode = false;
|
||||
popup.dismiss();
|
||||
eventListener.onStickerPopupEnded();
|
||||
currentView.clear();
|
||||
exitHoverMode();
|
||||
break;
|
||||
default:
|
||||
for (int i = 0, len = recyclerView.getChildCount(); i < len; i++) {
|
||||
|
@ -84,6 +84,13 @@ public class StickerRolloverTouchListener implements RecyclerView.OnItemTouchLis
|
|||
showSticker(recyclerView, sticker.getUri(), sticker.getStickerRecord().getEmoji());
|
||||
}
|
||||
|
||||
private void exitHoverMode() {
|
||||
hoverMode = false;
|
||||
popup.dismiss();
|
||||
eventListener.onStickerPopupEnded();
|
||||
currentView.clear();
|
||||
}
|
||||
|
||||
private void showStickerForView(@NonNull RecyclerView recyclerView, @NonNull View view) {
|
||||
Pair<Object, String> stickerData = stickerRetriever.getStickerDataFromView(view);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue