-
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mario Danic <[email protected]>
- Loading branch information
Showing
4 changed files
with
59 additions
and
16 deletions.
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 { | ||
public interface Receiver { | ||
public void onReceiveResult(int resultCode, Bundle data); | ||
} | ||
|
||
private Receiver receiver; | ||
|
||
/** | ||
* Create a new ResultReceive 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