Closed ShwetaChauhan18 closed 4 years ago
I'm not sure if it's solving your issue but library is only providing the dialog, and you're owning the callee onTouchListener.
Also sample app provided in this repository is showcasing the reaction pattern originally from Facebook app, but another way to interact the dialog should be possible (it may requires forking the library).
@pgreze : Actually, I solved this issue.
@pgreze : Actually, I solved this issue.
@ShwetaChauhan18 Can you share the working code?
@pgreze : Actually, I solved this issue.
@ShwetaChauhan18 Can you share the working code?
@pgreze : I have created PR for that before. And long press code is working on below like button. Please review code and merge that branch so everyone get that functionality.
Let me generate PR here
@ShwetaChauhan18 @pgreze have tried below code for Single click and Long click for a view But I need to release my hold so I can navigate through the popup window for reaction selection. AND If I use //((ImageViewHolder1) viewHolder).moment_reaction.setOnTouchListener(popup); the It will popup will stick to view only
((ImageViewHolder1) viewHolder).moment_reaction_lay.setOnTouchListener(new OnSwipeListener(context) {
public void onClick() {
Log.i("@@@@@@@@@@@@", "Short press!");
}
}
}
public void onLongClick(View view, MotionEvent motionEvent) {
Log.i("@@@@@@@@@@@@", "Long press!");
parent11.requestDisallowInterceptTouchEvent(true);
//((ImageViewHolder1) viewHolder).moment_reaction.setOnTouchListener(popup);
popup.onTouch(view, motionEvent);
}
});
@ShwetaChauhan18 @pgreze have tried below code for Single click and Long click for a view But I need to release my hold so I can navigate through the popup window for reaction selection. AND If I use //((ImageViewHolder1) viewHolder).moment_reaction.setOnTouchListener(popup); the It will popup will stick to view only
((ImageViewHolder1) viewHolder).moment_reaction_lay.setOnTouchListener(new OnSwipeListener(context) { public void onClick() { Log.i("@@@@@@@@@@@@", "Short press!"); } } } public void onLongClick(View view, MotionEvent motionEvent) { Log.i("@@@@@@@@@@@@", "Long press!"); parent11.requestDisallowInterceptTouchEvent(true); //((ImageViewHolder1) viewHolder).moment_reaction.setOnTouchListener(popup); popup.onTouch(view, motionEvent); } });
@peddiraju26 : Check I have created PR for that
@ShwetaChauhan18 Thanks for PR!
For a Long click, I need to release my hold so I can navigate through the reaction popup window for like, love, etc reactions. Can we solve this?
@ShwetaChauhan18 Thanks for PR!
For a Long click, I need to release my hold so I can navigate through the reaction popup window for like, love, etc reactions. Can we solve this?
yes.
Button react = findViewById(R.id.react);
ReactionsConfig config = new ReactionsConfigBuilder(context)
.withReactions(new int[]{
R.drawable.ic_thumb,
R.drawable.ic_love,
R.drawable.ic_laugh,
R.drawable.ic_wow,
R.drawable.ic_sad,
R.drawable.ic_angry
})
.withPopupAlpha(1)
.build();
ReactionPopup reactionPopup = new ReactionPopup(context, config, pos ->{
return true;
});
react.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
react.setOnLongClickListener(v1 -> {
reactionPopup.onTouch(v, event);
return false;
});
return false;
}
});
Can we do like onLongPress dialog will open and default like and dislike work?