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