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

Unicode problem and height problem #45

Open
giorgiaditom opened this issue Feb 16, 2016 · 4 comments
Open

Unicode problem and height problem #45

giorgiaditom opened this issue Feb 16, 2016 · 4 comments

Comments

@giorgiaditom
Copy link

I have been using this library to implement emoji on Android SoftKeyboard with this code

if (primaryCode == 32) {
        LayoutInflater layoutInflater = (LayoutInflater)     getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
        View popupView = layoutInflater.inflate(R.layout.popup, null);
        popupWindow = new EmojiconsPopup(popupView, this);
        // final PopupWindow popupWindow = new PopupWindow();
        popupWindow.setSizeForSoftKeyboard();
        popupWindow.setSize(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        popupWindow.showAtLocation(mInputView.getRootView(), Gravity.BOTTOM, 0, 0);
        // Bring soft keyboard up : NOT WORKING
        final InputMethodManager mInputMethodManager = (InputMethodManager) getBaseContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);

        mInputMethodManager.showSoftInput(popupView, 0);
 // If the text keyboard closes, also dismiss the emoji popup
        popupWindow.setOnSoftKeyboardOpenCloseListener(new OnSoftKeyboardOpenCloseListener() {

            @Override
            public void onKeyboardOpen(int keyBoardHeight) {

            }

            @Override
            public void onKeyboardClose() {
                if (popupWindow.isShowing())
                    popupWindow.dismiss();
            }
        });

        popupWindow.setOnEmojiconClickedListener(new OnEmojiconClickedListener() {

            @Override
            public void onEmojiconClicked(Emojicon emojicon) {
                mComposing.append(emojicon.getEmoji());
                commitTyped(getCurrentInputConnection());

                customToast("" + emojicon.getEmoji());
            }
        });

        popupWindow.setOnEmojiconBackspaceClickedListener(new OnEmojiconBackspaceClickedListener() {

            @Override
            public void onEmojiconBackspaceClicked(View v) {
                KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0, 0, KeyEvent.KEYCODE_ENDCALL);
                customToast(" " + event);
                handleBackspace();
            }
        });

The library works fine, but when I use emoji in TextMessage Application, they appear like android style and not like they are in the library. How to solve it? This is the screenshot:
schermata 2016-02-13 alle 13 30 25

@giorgiaditom
Copy link
Author

In addition the Popup height is wrong, how you can see in the screenshot, but i don't know how fix it.

@giorgiaditom giorgiaditom changed the title Unicode problem Unicode problem and height problem Feb 16, 2016
@TemMax
Copy link

TemMax commented Feb 26, 2016

Hi! Do you use EmojiconEditText instead of standart EditText? If not, then change it and check your emojis.

@giorgiaditom
Copy link
Author

I want to do a custom softkeyboard not an application. I don't use editText...

@Mateeen
Copy link

Mateeen commented Mar 7, 2018

any solution to this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants