-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Fix Emoji keyboard in certain cases #329
Conversation
54eb9e0
to
fad8606
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll investigate the sizing when NOT using adjustResize. |
Can you let me know the combination you use for activity + edittext (imeOptions) so I can try to debug as I can't really reproduce? (the emoji panel is the same size as keyboard for me) |
@rubengees when you get the time to answer, I'll take a look. Got another PR in the mean time :) |
On my <com.vanniktech.emoji.EmojiEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine|textCapSentences|textAutoCorrect"
android:maxLines="5"
android:scrollbars="vertical" /> |
I now came up with a significantly better solution and have rebased the PR against master. Please test and reply accordingly - thanks! |
After this is merged, I'd appreciate a release as well so I can remove the commit from my build.gradle ;) This, after all, should solve a lot of layout issues people faced in the past. |
After further testing, I can confirm (and be happy about it!) that the bug @rubengees reported is gone, so I have you folks will have the same results. |
I'll test it out on Monday. Are there any further changes you want to see for 0.6.0? |
Ideally we'd at least have the ignored emojis fixed for 0.6, but yea...not something I can do much about :) Do you folks have a slack channel/telegram group/signal group/whatever where we can talk more real-time btw? |
Nah. Just GitHub. Maybe Ruben can help with the Emojis. Also what should we do about EmojiOne? |
I'd drop it if that's what the folks prefer. |
Can we then also update the Emoji ordering @rubengees? I feel like when cutting a new release we should have all of the emojis in place. |
Regarding this PR - still does not work in landscape for me. The popup is not shown at all...
I'll try to look into that 🙂
You mean the order in which the emojis are shown in the picker? If yes, I can't think of a way. The generator simply uses the ordering of our datasource. |
@rubengees can you talk the Sample app shipped in the repo (and this PR, in particular) to exhibit the behaviour you mentioned so I can properly debug? I've tried a few combinations and they all work as expected for me :( |
@mario Hmm it seems to have been an issue with my app, at least partially. I hide and show the input based on data that is loaded and also instantiated the popup only when it was first used (using Kotlin's It works mostly now. But I have noticed this: The first screenshot shows the landscape view without the picker opened. The second with it opened. As you can see, the "done" button is not accessible for the user anymore. I think the popup should only have the height of the keyboard in landscape also. |
So the suggestion is to instantiate the popup as soon as possible due to global layout listener in general. Let me investigate your issue now :) |
Nop, can't reproduce - can you send me a sample layout file? I just remove all the adjustResize and set the flagNoExtractUI and it works as expected :( |
I am currently on mobile only, but will try to put something together and investigate more thoroughly asap. My observations above were only quick findings. |
Thanks!
…On Sun, 27 Jan 2019, 16:19 Ruben Gees ***@***.*** wrote:
I am currently on mobile only, but will try to put something together and
investigate more thoroughly asap. My observations above were only quick
findings.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#329 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAWsq5l8o6EujVrzoL6pdbgsci7K5mKks5vHcNrgaJpZM4aP-x1>
.
|
Sorry to bother, but any progress on getting me a way to reproduce or a fix @rubengees? |
Sorry, not yet. I'm currently busy with work, but have not forgotten about it! |
I have investigated further and the problems with the popup not showing were all linked to problems with my app, sorry for the confusion... Maybe we should add a disclaimer to the README, that the popup needs to be instantiated as early as possible, to avoid others to make the same mistake? Apart from that, only the problem with the popup being above the "done" button is left for me. I can reproduce that without any modifications to the sample or the library. It happens on my real phone (OnePlus 5T, Android 9.0 stock) and also on an default Android Studio emulator (Pixel 2, Android 9.0). |
Feel free to create a PR with that. |
fb61127
to
ac1d9ed
Compare
There were two separate leaks that I've hopefully fixed correctly - and hopefully the build turns green this time. |
Signed-off-by: Mario Danic <[email protected]>
Signed-off-by: Mario Danic <[email protected]>
Tadadadadada .... it's green! :D |
Signed-off-by: Mario Danic <[email protected]>
Signed-off-by: Mario Danic <[email protected]>
Flow (Assuming we just started)
We do this because the global layout doesn't get into effect with fullscreen EditText since the keyboard is in another process and in a different layout. We set the receiver to know what happens when we try to show the keyboard, and toggle the keyboard. If a keyboard is already shown, it'll show the Emoji popup.
Let me know if I failed to explain something properly and I'll happily do it. |
if (SDK_INT >= O) { | ||
AutofillManager autofillManager = context.getSystemService(AutofillManager.class); | ||
if (autofillManager != null) { | ||
autofillManager.cancel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I sometimes saw this leak in my app, but always thought that was an Android SDK one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) It's almost like magic! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this is the only available open source lib these days that handles keyboard absolutely correctly btw, which is a great accomplishment - thanks to both @rubengees and @vanniktech for pushing when things didn't work as they were supposed to!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to merge once @rubengees approves. The changes can also be done in a follow up.
emoji/src/main/java/com/vanniktech/emoji/EmojiResultReceiver.java
Outdated
Show resolved
Hide resolved
emoji/src/main/java/com/vanniktech/emoji/EmojiResultReceiver.java
Outdated
Show resolved
Hide resolved
final Method visibleHeightMethod = inputMethodManagerClass.getDeclaredMethod("getInputMethodWindowVisibleHeight"); | ||
visibleHeightMethod.setAccessible(true); | ||
return (int) visibleHeightMethod.invoke(imm); | ||
} catch (NoSuchMethodException exception) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can be grouped together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No they can't, tried that and the IDE complained, because this gets compiled to catch an exception only available on Java 8 if I recall correctly. Catching generic Exception
should also not be done since it hides RuntimeException
s on which we want to crash.
} | ||
} catch (NoSuchFieldException noSuchFieldException) { | ||
Log.w(TAG, noSuchFieldException.getLocalizedMessage()); | ||
} catch (IllegalAccessException illegalAccessException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Co-Authored-By: mario <[email protected]>
Co-Authored-By: mario <[email protected]>
@rubengees can we merge? After that, @vanniktech can make a release. |
Signed-off-by: Mario Danic <[email protected]>
I'll make a last test soon, then I'll approve, thanks for the explanation! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! No leaks and can't find any issues anymore, great job @mario!
Thanks @mario really appreciate the effort you put into this! Feel free to merge! |
Please make a release now, thanks! :) |
Will do first thing in the morning tomorrow |
This fixes an issue brought to my attention in #328 and a few other issues I've noticed with the Popup view.