Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emojis icon sizes Not Working in CustomRecycleAdapter #5

Closed
pcshedeur opened this issue Aug 28, 2020 · 6 comments
Closed

Emojis icon sizes Not Working in CustomRecycleAdapter #5

pcshedeur opened this issue Aug 28, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@pcshedeur
Copy link

device-2020-08-28-011802

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?

@Aghajari Aghajari added the bug Something isn't working label Aug 28, 2020
@Aghajari
Copy link
Owner

Hi @pcshedeur ,
That's right,
I will fix this as soon as its possible

@Aghajari
Copy link
Owner

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.

@pcshedeur
Copy link
Author

pcshedeur commented Aug 29, 2020

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
device-2020-08-29-002116

AFTER SCROLLING
device-2020-08-29-002125

@Aghajari
Copy link
Owner

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..

@Aghajari
Copy link
Owner

Done!

Check out AXEmojiView v1.2.2

@pcshedeur
Copy link
Author

Thank you. Works perfectly. Your response time is impressive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants