This file contains hidden or 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
| public String encodeThumbnail(Bitmap bitmap) { | |
| ByteArrayOutputStream stream = new ByteArrayOutputStream(); | |
| bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream); | |
| return Base64.encodeToString(stream.toByteArray(), Base64.DEFAULT); | |
| } | |
| private Bitmap decodeThumbnail(String thumbData) { | |
| byte[] bytes = Base64.decode(thumbData, Base64.DEFAULT); | |
| return BitmapFactory.decodeByteArray(bytes, 0, bytes.length); | |
| } |
This file contains hidden or 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
| public interface OnChatHistoryLoadedListener { | |
| void onSuccess(ArrayList<QBChatMessage> messages); | |
| void onError(List<String> list); | |
| } | |
| public interface OnUnreadMessageListener { | |
| void onUnreadMessage(int unreadDialogCount); | |
| } |
This file contains hidden or 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
| public void sendMessageToUser(int opponentId, String message) { | |
| QBPrivateChat privateChat = createPrivateChatIfNotExist(opponentId); | |
| if (null == getDialogOfOpponent(opponentId)) { | |
| retrieveDialogs(); | |
| } | |
| sendMessageToChat(privateChat, message); | |
| } | |
| private QBPrivateChat createPrivateChatIfNotExist(int opponentId) { | |
| QBPrivateChat privateChat = privateChatManager.getChat(opponentId); |
This file contains hidden or 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
| QBPrivateChatManagerListener privateChatManagerListener; | |
| QBMessageListener<QBPrivateChat> privateChatMessageListener; | |
| public void initFramework() { | |
| //.. | |
| privateChatMessageListener = new QBMessageListener<QBPrivateChat>() { | |
| @Override | |
| public void processMessage(QBPrivateChat qbPrivateChat, QBChatMessage qbChatMessage) { | |
| if (qbChatMessage.isMarkable()) { | |
| int opponentId = qbPrivateChat.getParticipant(); |
This file contains hidden or 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
| /** | |
| * Used to determine whether the user making this call is subject to | |
| * teleportations. | |
| * | |
| * <p>As of {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this method can | |
| * now automatically identify goats using advanced goat recognition technology.</p> | |
| * | |
| * @return Returns true if the user making this call is a goat. | |
| */ | |
| public boolean isUserAGoat() { |
NewerOlder