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

EmojiKeyboard wrong initial height in fragment #451

Closed
SourceEngine opened this issue Jun 19, 2020 · 4 comments
Closed

EmojiKeyboard wrong initial height in fragment #451

SourceEngine opened this issue Jun 19, 2020 · 4 comments

Comments

@SourceEngine
Copy link

  • Version of the library: 0.6.0
  • Affected devices: Tested on Samsung S8 - S10, Huawei, Xiaomi, Motorola (presumably more devices affected)
  • Affected versions: Android 7.1 - 9

Image showing the error is attatched bellow

Currently iam implementing the EmojiKeyboard in a BottomSheetDialog.
I have tried building the EmojiPopup as followed:

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup c, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.layout, c, false);
        return view;
    }
    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        emojiPopup = EmojiPopup.Builder.fromRootView(this.view).build(this.view.findViewById(R.id.etxt_emoji));
    }

When pressing the EditText i open the EmojiKeyboard:

etxt_emoji.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                if (!emojiPopup.isShowing()) {
                    emojiPopup.toggle();
                }
                etxt_emoji.requestFocus();
                return false;
            }
        });

Now the EmojiKeyboard opens as the image below shows.
After closing the keyboard and tapping the Edittext again the EmojiKeyboard opens normally.

Could you please have a look at this? Maybe iam doing something wrong?

Thanks in advance!

emoji_error


@vanniktech
Copy link
Owner

Yeah. Can you try with #448 ?

@SourceEngine
Copy link
Author

SourceEngine commented Jun 19, 2020

I have tried it as #448 describes:

if (builder.keyboardAnimationStyle != 0) {
      popupWindow.setAnimationStyle(builder.keyboardAnimationStyle);
    }

    // Root view might already be laid out in which case we need to manually call start()
    if (rootView.getParent() != null) {
      start();
    }

    rootView.addOnAttachStateChangeListener(onAttachStateChangeListener);

Sadly still the same result

Edit: In my case start() is not being called cause rootView.getParent() is null

@vanniktech
Copy link
Owner

The view should have a parent though, should not it?

@vanniktech
Copy link
Owner

Also, please test out the latest master, there were some bug fixes.

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

No branches or pull requests

2 participants