Aghajari/AXEmojiView

How to display stickers?

fiftyonemoon opened this issue ยท 8 comments

Hey Amir,
Your library is really good. can you please tell me how to display stickers? as in your demo app when we clicked on sticker it's show toast. onClickMethod have 3 params but how to use them?

Hi @fiftyonemoon ,
i think i didn't understand what you mean,
actually it won't show a toast when you click on sticker tab, it will open the Stickers tab by default...

I need more details about what you wanna do..

WhatsApp Image 2020-10-16 at 3 38 49 PM
see in this image. how to display it in chat?

Aha!
you must add an ImageView to your layout (RecyclerView) and load your sticker resource on it!

the toast is showing the resource id of the clicked sticker.

Yaa but see this!

stickerView.setOnStickerActionsListener(new OnStickerActions() {

            @Override
            public void onClick(View view, Sticker sticker, boolean fromRecent) {
                Toast.makeText(view.getContext(),sticker.toString()+" clicked!", Toast.LENGTH_SHORT).show(); 
                imageView.setImageResource( " WHAT I DO HERE? " );
            }

            @Override
            public boolean onLongClick(View view, Sticker sticker, boolean fromRecent) {
                return false;
            }
        });

Here onClickMehtod have 3 parmas but how to load in imageview? I tried but nothing happened.
By the way response time is great.

Ok Amir.
I solved it by just adding imageView.setImageResource((int) Sticker.tostirng());
Thank you.

Well done!
Note: it's better to use getData instead of toString, imageView.setImageResource((int) sticker.getData());

Ok Amir.
Can i text you on Telegram in future? if i need some help?
TelegramID : @KingAmir272 is it yours?
Remember me if i text you ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚

Yes sure,
Just mention this conversation :D