Merge pull request #226 from Aga-C/fix-loading-messages

Fixed constant loading messages text (#225)
This commit is contained in:
Tibor Kaputa 2021-10-19 13:28:46 +02:00 committed by GitHub
commit eca3d9bf53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,8 +251,8 @@ class MainActivity : SimpleActivity() {
.thenByDescending { it.date }
).toMutableList() as ArrayList<Conversation>
conversations_list.beVisibleIf(hasConversations)
no_conversations_placeholder.beVisibleIf(!hasConversations)
no_conversations_placeholder_2.beVisibleIf(!hasConversations)
no_conversations_placeholder.beGoneIf(hasConversations)
no_conversations_placeholder_2.beGoneIf(hasConversations)
if (!hasConversations && config.appRunCount == 1) {
no_conversations_placeholder.text = getString(R.string.loading_messages)
@ -279,6 +279,12 @@ class MainActivity : SimpleActivity() {
} else {
try {
(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) {
}
}