Closed pcshedeur closed 4 years ago
Hi @pcshedeur , That's right, I will fix this as soon as its possible
Hi @pcshedeur , check out the AXEmojiView v1.2.1! bugs have been fixed.
Warning:
if you wanna set an EditText text into a TextView,
try textView.setText(edt.getText().toString());
instead of textView.setText(edt.getText());
Main sample has been updated.
Thank you. The size is working now. Please do you have any example implementation for a custom RecyclerAdapter. Here is my implementation of the onBindView
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
ObjectChats messages = messageList.get(position);
String message = messages.getMessage();
final int res;
int emoji_counter = AXEmojiUtils.getEmojisCount(message);
if(emoji_counter == 1) {
res = R.dimen.emoji_size_single_emoji;
}
else if(emoji_counter < 1) {
res = R.dimen.emoji_size_default;
}
else {
res = R.dimen.emoji_size_multiple_emoji;
}
if (messages.getSender().equals("1")) {
holder.messageSelf.setBackgroundResource(R.drawable.chat_send);
holder.messageSelf.setEmojiSizeRes(res, false);
holder.messageSelf.setText(message);
}
else {
holder.messageOther.setBackgroundResource(R.drawable.chat_receive);
holder.messageOther.setEmojiSizeRes(res, false);
holder.messageOther.setText(message);
}
TimeAgo t = new TimeAgo(context);
String time = t.timeAgo(Long.parseLong(messages.getDate()));
holder.date.setText(time);
}
With this, when the view is first rendered, none of the emojis appear. But when I scroll up and down, the emojis appear as expect after.
BEFORE SCROLLING THROUGH
AFTER SCROLLING
Hi @pcshedeur , You need add a listener for this to your onBind, when emoji loaded invalidate textView,
I've handle this for EmojiImageView in lib. I'll fix this for other views as soon as its possible, wait for next version..
Done!
Check out AXEmojiView v1.2.2
Thank you. Works perfectly. Your response time is impressive.
I have gone through so many libraries and this is the first one I was able to implement successfully so thank you. Just a little challenge. I am unable to increase the icon size in for emojis inside a custom recycle adapter. I tried
holder.textView.setEmojiSize(40, true);
but the icons remain the same size. Please any suggestion?