mirror of
https://codeberg.org/monocles/monocles_chat.git
synced 2025-01-15 22:22:22 +01:00
Reactions popup
This commit is contained in:
parent
6cd257d205
commit
02143b730f
8 changed files with 30 additions and 4 deletions
|
@ -131,6 +131,7 @@ dependencies {
|
|||
implementation 'com.github.Priyansh-Kedia:OpenGraphParser:2.5.6'
|
||||
implementation 'com.github.p32929:AndroidAppLockscreen:1.2'
|
||||
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||
implementation "com.github.pgreze:android-reactions:1.6"
|
||||
}
|
||||
|
||||
ext {
|
||||
|
|
|
@ -71,6 +71,9 @@ import androidx.core.graphics.drawable.DrawableCompat;
|
|||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.daimajia.swipe.SwipeLayout;
|
||||
import com.github.pgreze.reactions.ReactionPopup;
|
||||
import com.github.pgreze.reactions.ReactionsConfig;
|
||||
import com.github.pgreze.reactions.ReactionsConfigBuilder;
|
||||
import com.google.common.base.Strings;
|
||||
import com.lelloman.identicon.view.GithubIdenticonView;
|
||||
|
||||
|
@ -1679,6 +1682,30 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
ReactionsConfig config = new ReactionsConfigBuilder(activity)
|
||||
.withReactions(new int[]{
|
||||
R.drawable.ic_fb_like,
|
||||
R.drawable.ic_fb_love,
|
||||
R.drawable.ic_fb_laugh,
|
||||
R.drawable.ic_fb_wow,
|
||||
R.drawable.ic_fb_sad,
|
||||
R.drawable.ic_fb_angry
|
||||
})
|
||||
.build();
|
||||
|
||||
ReactionPopup popup = new ReactionPopup(activity, config, (positionReact) -> {
|
||||
return true; // true is closing popup, false is requesting a new selection
|
||||
});
|
||||
|
||||
viewHolder.messageBody.setOnClickListener(v -> {
|
||||
if (MessageAdapter.this.mOnMessageBoxClickedListener != null) {
|
||||
MessageAdapter.this.mOnMessageBoxClickedListener
|
||||
.onContactPictureClicked(message);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
viewHolder.contact_picture.setOnClickListener(v -> {
|
||||
if (MessageAdapter.this.mOnContactPictureClickedListener != null) {
|
||||
MessageAdapter.this.mOnContactPictureClickedListener.onContactPictureClicked(message);
|
||||
|
@ -1747,14 +1774,12 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||
viewHolder.messageBody.setOnTouchListener((v, event) -> {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
if (MessageAdapter.this.mOnMessageBoxClickedListener != null) {
|
||||
MessageAdapter.this.mOnMessageBoxClickedListener
|
||||
.onContactPictureClicked(message);
|
||||
popup.onTouch(v, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
viewHolder.contact_picture.setOnLongClickListener(v -> {
|
||||
if (MessageAdapter.this.mOnContactPictureLongClickedListener != null) {
|
||||
MessageAdapter.this.mOnContactPictureLongClickedListener.onContactPictureLongClicked(v, message);
|
||||
|
|
BIN
src/main/res/drawable/ic_fb_angry.png
Normal file
BIN
src/main/res/drawable/ic_fb_angry.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
src/main/res/drawable/ic_fb_laugh.png
Normal file
BIN
src/main/res/drawable/ic_fb_laugh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
src/main/res/drawable/ic_fb_like.png
Normal file
BIN
src/main/res/drawable/ic_fb_like.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
BIN
src/main/res/drawable/ic_fb_love.png
Normal file
BIN
src/main/res/drawable/ic_fb_love.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
src/main/res/drawable/ic_fb_sad.png
Normal file
BIN
src/main/res/drawable/ic_fb_sad.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
src/main/res/drawable/ic_fb_wow.png
Normal file
BIN
src/main/res/drawable/ic_fb_wow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Loading…
Reference in a new issue