Aghajari / AXEmojiView

an advanced library which adds emoji,sticker,... support to your Android application.
Apache License 2.0
179 stars 45 forks source link

How to display stickers? #7

Closed fiftyonemoon closed 4 years ago

fiftyonemoon commented 4 years ago

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?

Aghajari commented 4 years ago

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

fiftyonemoon commented 4 years ago

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

Aghajari commented 4 years ago

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.

fiftyonemoon commented 4 years ago

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.

fiftyonemoon commented 4 years ago

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

Aghajari commented 4 years ago

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

fiftyonemoon commented 4 years ago

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

Aghajari commented 4 years ago

Yes sure, Just mention this conversation :D