-
-
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
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e875d21
Fix #328
mario 47ba2ab
Significantly improve layout re-calculations
mario 1fdac7e
Fix issues with horizontal emoji keyboard
mario 6f2f644
Fix layout issues in landscape
mario f836716
Fix focus issues & layout issues for most things
mario e710f74
Clean up
mario 4a3b063
Finally show emoji keyboard properly
mario f1fbe4e
Update emoji/src/main/java/com/vanniktech/emoji/EmojiPopup.java
vanniktech 004945e
Fix receiver leak
mario d5724ff
Code style update
mario e43fd1e
Update keyboard handling logic & fallback
mario 6069158
Clean up
mario daeda40
Further clean ups
mario c39381c
Safeguards
mario dee8776
Final cleanup
mario 896555e
Fix code style issues
rubengees 0afa88a
Fix memory leaks
mario 1db9ac8
Update for codestyle issues
mario dc7c46f
Change ERR from public to package private
mario 746caa4
Change min height to 50dp
mario d7bd99a
Update emoji/src/main/java/com/vanniktech/emoji/EmojiResultReceiver.java
vanniktech 28aca9a
Update emoji/src/main/java/com/vanniktech/emoji/EmojiResultReceiver.java
vanniktech 68846ef
Import nullable
mario File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
emoji/src/main/java/com/vanniktech/emoji/EmojiResultReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.vanniktech.emoji; | ||
|
||
import android.os.Bundle; | ||
import android.os.Handler; | ||
import android.os.ResultReceiver; | ||
|
||
public class EmojiResultReceiver extends ResultReceiver { | ||
mario marked this conversation as resolved.
Show resolved
Hide resolved
|
||
public interface Receiver { | ||
public void onReceiveResult(int resultCode, Bundle data); | ||
} | ||
|
||
private Receiver receiver; | ||
mario marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* Create a new EmojiResultReceiver to receive results. Your | ||
* {@link #onReceiveResult} method will be called from the thread running | ||
* <var>handler</var> if given, or from an arbitrary thread if null. | ||
*/ | ||
public EmojiResultReceiver(Handler handler) { | ||
super(handler); | ||
} | ||
|
||
public void setReceiver(Receiver receiver) { | ||
this.receiver = receiver; | ||
} | ||
|
||
@Override | ||
protected void onReceiveResult(int resultCode, Bundle resultData) { | ||
if (receiver != null) { | ||
receiver.onReceiveResult(resultCode, resultData); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!