vanniktech / Emoji

A library to add Emoji support to your Android / iOS / JVM Application
Apache License 2.0
1.53k stars 292 forks source link

Problems with the update for Java #952

Closed gelbertgel closed 1 year ago

gelbertgel commented 1 year ago

I am using Java code in my application. I updated your library. My version: implementation "com.vanniktech:emoji-ios:0.13.0" How do I save emojiPopup setOnEmojiPopupListener after update? Do I have to write one by one in the constructor? Especially in version 15, I could not access EmojiEditText, EmojiPopup etc. I didn't understand how to use them either. Do you have a use like emojiPopup.setOnEmojiPopupShownListener(this); ? Or do I have to give a mountain field directly in the constructor?

My previous usage:

emojiPopup = EmojiPopup.Builder.fromRootView(this)
                .setOnEmojiBackspaceClickListener(v -> {
                })
                .setOnEmojiClickListener((imageView, emoji) -> {
                })
                .setOnEmojiPopupShownListener(() -> emojiToggle.setImageResource(R.drawable.ic_baseline_keyboard_24))
                .setOnSoftKeyboardOpenListener(keyBoardHeight -> {
                })
                .setOnEmojiPopupDismissListener(() -> emojiToggle.setImageResource(R.drawable.ic_baseline_emoji_emotions_24))
                .setOnSoftKeyboardCloseListener(() -> {
                })
                .build(editText);

Current code:

emojiPopup = new EmojiPopup(this, editText, null, null, null, null, null, R.style.emoji_fade_animation_style, 
0, this, null, null, null, null, this);

Where did I go wrong I am very happy with your library. It's nice that you keep it up to date, but I couldn't adapt it to Java.

vanniktech commented 1 year ago

Yeah things have changed. Either read up on compatibility on your own or use Kotlin.

Pajet commented 1 year ago

implement Kotlin classpath and also the plugin in your build.gradle app module. You should be able to use the lib in your Java project. Cheers!