emojireactions: implement coloring buttons
This commit is contained in:
parent
483aae6c74
commit
05b0779902
|
@ -16,7 +16,7 @@ import android.widget.Toast;
|
|||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.emoji.widget.EmojiButton;
|
||||
import androidx.emoji.widget.EmojiAppCompatButton;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.google.android.flexbox.FlexboxLayoutManager;
|
||||
|
||||
|
@ -130,7 +130,7 @@ class StatusDetailedViewHolder extends StatusBaseViewHolder {
|
|||
}
|
||||
|
||||
private class EmojiReactionViewHolder extends RecyclerView.ViewHolder {
|
||||
public EmojiButton emojiReaction;
|
||||
public EmojiAppCompatButton emojiReaction;
|
||||
EmojiReactionViewHolder(View view) {
|
||||
super(view);
|
||||
emojiReaction = view.findViewById(R.id.status_emoji_reaction);
|
||||
|
@ -155,11 +155,12 @@ class StatusDetailedViewHolder extends StatusBaseViewHolder {
|
|||
@Override
|
||||
public void onBindViewHolder(EmojiReactionViewHolder holder, int position) {
|
||||
EmojiReaction reaction = reactions.get(position);
|
||||
String str = reaction.getEmoji() + " " + reaction.getCount();
|
||||
String str = reaction.getName() + " " + reaction.getCount();
|
||||
|
||||
// no custom emoji yet!
|
||||
|
||||
holder.emojiReaction.setText(str);
|
||||
holder.emojiReaction.setActivated(reaction.getMe());
|
||||
holder.emojiReaction.setOnClickListener(v -> {});
|
||||
}
|
||||
|
||||
// total number of rows
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_activated="false" android:color="@color/tusky_grey_50"/>
|
||||
<item android:state_activated="true" android:color="@color/tusky_blue"/>
|
||||
</selector>
|
|
@ -6,7 +6,7 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- not a best way but I'm lazy to do proper button -->
|
||||
<androidx.emoji.widget.EmojiButton
|
||||
<androidx.emoji.widget.EmojiAppCompatButton
|
||||
android:id="@+id/status_emoji_reaction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -17,6 +17,7 @@
|
|||
android:textAlignment="viewStart"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="?attr/status_text_medium"
|
||||
app:backgroundTint="@color/emoji_reaction_button"
|
||||
tools:text="A 0" />
|
||||
|
||||
</FrameLayout>
|
||||
|
|
Loading…
Reference in New Issue