Merge pull request #226 from Aga-C/fix-loading-messages
Fixed constant loading messages text (#225)
This commit is contained in:
commit
eca3d9bf53
1 changed files with 8 additions and 2 deletions
|
|
@ -251,8 +251,8 @@ class MainActivity : SimpleActivity() {
|
||||||
.thenByDescending { it.date }
|
.thenByDescending { it.date }
|
||||||
).toMutableList() as ArrayList<Conversation>
|
).toMutableList() as ArrayList<Conversation>
|
||||||
conversations_list.beVisibleIf(hasConversations)
|
conversations_list.beVisibleIf(hasConversations)
|
||||||
no_conversations_placeholder.beVisibleIf(!hasConversations)
|
no_conversations_placeholder.beGoneIf(hasConversations)
|
||||||
no_conversations_placeholder_2.beVisibleIf(!hasConversations)
|
no_conversations_placeholder_2.beGoneIf(hasConversations)
|
||||||
|
|
||||||
if (!hasConversations && config.appRunCount == 1) {
|
if (!hasConversations && config.appRunCount == 1) {
|
||||||
no_conversations_placeholder.text = getString(R.string.loading_messages)
|
no_conversations_placeholder.text = getString(R.string.loading_messages)
|
||||||
|
|
@ -279,6 +279,12 @@ class MainActivity : SimpleActivity() {
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
(currAdapter as ConversationsAdapter).updateConversations(sortedConversations)
|
(currAdapter as ConversationsAdapter).updateConversations(sortedConversations)
|
||||||
|
if (currAdapter.conversations.isEmpty()) {
|
||||||
|
conversations_list.beGone()
|
||||||
|
no_conversations_placeholder.text = getString(R.string.no_conversations_found)
|
||||||
|
no_conversations_placeholder.beVisible()
|
||||||
|
no_conversations_placeholder_2.beVisible()
|
||||||
|
}
|
||||||
} catch (ignored: Exception) {
|
} catch (ignored: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue