Skip to content

Commit 9a04640

Browse files
author
tatanka987
authored
Merge pull request #320 from QuickBlox/development
- prepare for release;
2 parents 7b4c12c + f909ce7 commit 9a04640

File tree

4 files changed

+17
-44
lines changed

4 files changed

+17
-44
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ext {
3232
lintAbortOnError = false
3333

3434
// QuickBlox SDK version
35-
qbSdkVersion = '3.0'
35+
qbSdkVersion = '3.1.0'
3636

3737
versionName = "3.0"
3838

sample-chat/src/main/java/com/quickblox/sample/chat/managers/DialogsManager.java

+12-27
Original file line numberDiff line numberDiff line change
@@ -105,37 +105,22 @@ public void onSystemMessageReceived(QBChatMessage systemMessage){
105105
}
106106
}
107107

108-
private void notifyListenersDialogCreated(final QBChatDialog chatDialog){
109-
new Handler(Looper.getMainLooper()).post(new Runnable() {
110-
@Override
111-
public void run() {
112-
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()){
113-
listener.onDialogCreated(chatDialog);
114-
}
115-
}
116-
});
108+
private void notifyListenersDialogCreated(final QBChatDialog chatDialog) {
109+
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()) {
110+
listener.onDialogCreated(chatDialog);
111+
}
117112
}
118113

119-
private void notifyListenersDialogUpdated(final String dialogId){
120-
new Handler(Looper.getMainLooper()).post(new Runnable() {
121-
@Override
122-
public void run() {
123-
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()){
124-
listener.onDialogUpdated(dialogId);
125-
}
126-
}
127-
});
114+
private void notifyListenersDialogUpdated(final String dialogId) {
115+
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()) {
116+
listener.onDialogUpdated(dialogId);
117+
}
128118
}
129119

130-
private void notifyListenersNewDialogLoaded(final QBChatDialog chatDialog){
131-
new Handler(Looper.getMainLooper()).post(new Runnable() {
132-
@Override
133-
public void run() {
134-
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()){
135-
listener.onNewDialogLoaded(chatDialog);
136-
}
137-
}
138-
});
120+
private void notifyListenersNewDialogLoaded(final QBChatDialog chatDialog) {
121+
for (ManagingDialogsCallbacks listener : getManagingDialogsCallbackListeners()) {
122+
listener.onNewDialogLoaded(chatDialog);
123+
}
139124
}
140125

141126
public void addManagingDialogsCallbackListener(ManagingDialogsCallbacks listener){

sample-chat/src/main/java/com/quickblox/sample/chat/ui/adapter/DialogsAdapter.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,15 @@ public View getView(int position, View convertView, ViewGroup parent) {
7373
private boolean isLastMessageAttachment(QBChatDialog dialog) {
7474
String lastMessage = dialog.getLastMessage();
7575
Integer lastMessageSenderId = dialog.getLastMessageUserId();
76-
return (StringUtils.textIsNull(lastMessage) || TextUtils.isEmpty(lastMessage)) && lastMessageSenderId != null;
76+
return TextUtils.isEmpty(lastMessage) && lastMessageSenderId != null;
7777
}
7878

7979
private String prepareTextLastMessage(QBChatDialog chatDialog){
8080
if (isLastMessageAttachment(chatDialog)){
8181
return context.getString(R.string.chat_attachment);
82-
} else if (!TextUtils.isEmpty(chatDialog.getLastMessage())){
83-
return StringUtils.textIsNull(chatDialog.getLastMessage()) ? EMPTY_STRING : chatDialog.getLastMessage();
82+
} else {
83+
return chatDialog.getLastMessage();
8484
}
85-
86-
return EMPTY_STRING;
8785
}
8886

8987
private static class ViewHolder {

sample-chat/src/main/java/com/quickblox/sample/chat/utils/chat/ChatHelper.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,7 @@ public void join(QBChatDialog chatDialog, final QBEntityCallback<Void> callback)
130130
DiscussionHistory history = new DiscussionHistory();
131131
history.setMaxStanzas(0);
132132

133-
chatDialog.join(history, new QbEntityCallbackWrapper<Void>(callback) {
134-
@Override
135-
public void onSuccess(final Void result, final Bundle b) {
136-
onSuccessInMainThread(result, b);
137-
}
138-
139-
@Override
140-
public void onError(final QBResponseException e) {
141-
onErrorInMainThread(e);
142-
}
143-
});
133+
chatDialog.join(history, callback);
144134
}
145135

146136
public void leaveChatDialog(QBChatDialog chatDialog) throws XMPPException, SmackException.NotConnectedException {

0 commit comments

Comments
 (0)