fixing some visibility and clickability things

This commit is contained in:
Tibor Kaputa 2021-10-19 13:28:17 +02:00 committed by GitHub
parent c2c76a2fd0
commit 2385dcd14b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,6 +92,7 @@ class MainActivity : SimpleActivity() {
(conversations_list.adapter as? ConversationsAdapter)?.updateFontSize() (conversations_list.adapter as? ConversationsAdapter)?.updateFontSize()
} }
(conversations_list.adapter as? ConversationsAdapter)?.updateDrafts()
updateTextColors(main_coordinator) updateTextColors(main_coordinator)
no_conversations_placeholder_2.setTextColor(getAdjustedPrimaryColor()) no_conversations_placeholder_2.setTextColor(getAdjustedPrimaryColor())
no_conversations_placeholder_2.underlineText() no_conversations_placeholder_2.underlineText()
@ -250,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,7 +280,9 @@ class MainActivity : SimpleActivity() {
try { try {
(currAdapter as ConversationsAdapter).updateConversations(sortedConversations) (currAdapter as ConversationsAdapter).updateConversations(sortedConversations)
if (currAdapter.conversations.isEmpty()) { if (currAdapter.conversations.isEmpty()) {
conversations_list.beGone()
no_conversations_placeholder.text = getString(R.string.no_conversations_found) no_conversations_placeholder.text = getString(R.string.no_conversations_found)
no_conversations_placeholder.beVisible()
no_conversations_placeholder_2.beVisible() no_conversations_placeholder_2.beVisible()
} }
} catch (ignored: Exception) { } catch (ignored: Exception) {