Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-08-07 23:43:59 +02:00
parent f50f3a8db7
commit 0f6b7cf580
3 changed files with 38 additions and 5 deletions

View file

@ -157,7 +157,7 @@ dependencies {
implementation 'com.github.wooplr:Spotlight:1.2.3' implementation 'com.github.wooplr:Spotlight:1.2.3'
implementation 'com.github.mario:ChatKit:ed2e3cf370' implementation 'com.github.mario:ChatKit:40a8e9cf69'
implementation 'com.otaliastudios:autocomplete:1.1.0' implementation 'com.otaliastudios:autocomplete:1.1.0'

View file

@ -744,16 +744,44 @@ public class ChatController extends BaseController implements MessagesListAdapte
if (emptyLayout != null) { if (emptyLayout != null) {
emptyLayout.setVisibility(View.VISIBLE); emptyLayout.setVisibility(View.VISIBLE);
} }
if (messagesListView != null) {
messagesListView.setVisibility(View.GONE);
}
} else { } else {
boolean foundRealMessage = false;
for (int i = 0; i < chatMessageList.size(); i++) {
if (TextUtils.isEmpty(chatMessageList.get(i).getSystemMessage())) {
foundRealMessage = true;
break;
}
}
if (foundRealMessage) {
if (emptyLayout != null) {
emptyLayout.setVisibility(View.GONE);
}
if (messagesListView != null) { if (messagesListView != null) {
messagesListView.setVisibility(View.VISIBLE); messagesListView.setVisibility(View.VISIBLE);
} }
} else {
if (emptyLayout != null && emptyLayout.getVisibility() != View.VISIBLE) {
emptyLayout.setVisibility(View.VISIBLE);
}
if (messagesListView != null && messagesListView.getVisibility() != View.GONE) {
messagesListView.setVisibility(View.GONE);
}
}
} }
} else { } else {
if (emptyLayout.getVisibility() != View.GONE) { if (emptyLayout != null) {
emptyLayout.setVisibility(View.GONE); emptyLayout.setVisibility(View.GONE);
} }
if (messagesListView.getVisibility() != View.VISIBLE) {
if (messagesListView != null) {
messagesListView.setVisibility(View.VISIBLE); messagesListView.setVisibility(View.VISIBLE);
} }
} }

View file

@ -130,4 +130,9 @@ public class ChatMessage implements IMessage, MessageContentType {
public Date getCreatedAt() { public Date getCreatedAt() {
return new Date(timestamp * 1000L); return new Date(timestamp * 1000L);
} }
@Override
public String getSystemMessage() {
return new EnumSystemMessageTypeConverter().convertToString(getSystemMessageType());
}
} }