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

LinearLayout with EmojEditText sometimes disappearing when popup is shown (in fragment) #28

Closed
kehleyr opened this issue May 25, 2016 · 12 comments

Comments

@kehleyr
Copy link

kehleyr commented May 25, 2016

I have a fragment containing several linear layouts with on linear layout at the bottom containing the EmojEditText and some buttons. I use the button to toggle the EmojPopup visibility.

Sometimes (let's say one in 10 times or 15 times) the emoj popup opens but the linear layout above it just disappears when I click the button. If I choose an emoj the popup disappears and the linear layout is visible again.

I cannot trigger this on purpose, seems like a race condition of some kind? Could it be related to wrong root view? I'm using view.getRootView() (view is the inflated view for the fragment).

@vanniktech
Copy link
Owner

What's your windowSoftInputMode? It should be adjustResize so that this won't happen.

I don't know if view.getRootView() works. Usually I literally pass the first one that is declared in the layout XML.

@kehleyr
Copy link
Author

kehleyr commented May 25, 2016

screenshot_2016-05-25-16-29-19

adjustResize for the activity containing the fragment doesn't make any difference, just tried it. It doesn't happen the first time usually, I have to toggle many times in a row to trigger this.

@vanniktech
Copy link
Owner

vanniktech commented May 25, 2016

Can you try adjustResize and also pass in your root xml view instead of view.getRootView()?

@kehleyr
Copy link
Author

kehleyr commented May 25, 2016

Using getView() method now, which gives me the root view for the fragment.

At least know now how to reproduce the bug:
-Open activity containing fragment
-Click on toggle button -> this opens emoj keyboard, linear layout with edittext is still visible
-Click again on toggle button -> emoj keyboard disappears, normal soft keyboard stays
-Click on back button (onBackPressed()) -> soft keyboard disappears
-Click again on toggle button -> emojpopup appears, linear layout containing edittext is gone, listview cannot be scrolled down (just like in the screenshot); I guess the linear layout is hidden then?

@kehleyr
Copy link
Author

kehleyr commented May 25, 2016

Just did a little debugging with your code, seems the problem is that isKeyboardOpen is true AFTER soft keyboard has been closed. This is why showAtBottom() is called when it shouldn't.

@vanniktech
Copy link
Owner

Which version are you using?

@kehleyr
Copy link
Author

kehleyr commented May 25, 2016

compile 'com.vanniktech:emoji:0.3.0'

@vanniktech
Copy link
Owner

Can you quickly check version 0.1.0 I did some changes (f16db29) between them regarding the keyboard. Could be that I broke something though I never encountered issues in the application where I am using this library. :/

@kehleyr
Copy link
Author

kehleyr commented May 25, 2016

Just tried version 0.1.0 and it seems to work there. All keyboard close events are detected properly here.

@vanniktech
Copy link
Owner

Then I guess this commit is causing the issue. The reason I changed it back there was because some of the listeners were not called at the right moment.

@vanniktech
Copy link
Owner

@anti-gone any other information / clues on how to fix it?

@vanniktech
Copy link
Owner

I'm closing this issue due to inactivity. If you have any further input on the issue, don't hesitate to reopen this issue or post a new one.

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

2 participants