Remove options menu on ArchivedConversationsActivity when there are no conversations

This commit is contained in:
Ensar Sarajčić 2023-07-19 10:07:33 +02:00
parent 1b8cfee9ea
commit b9b85ea6a7
1 changed files with 7 additions and 0 deletions

View File

@ -58,6 +58,12 @@ class ArchivedConversationsActivity : SimpleActivity() {
}
}
private fun updateOptionsMenu(conversations: ArrayList<Conversation>) {
archive_toolbar.menu.apply {
findItem(R.id.empty_archive).isVisible = conversations.isNotEmpty()
}
}
private fun updateMenuColors() {
updateStatusbarColor(getProperBackgroundColor())
}
@ -116,6 +122,7 @@ class ArchivedConversationsActivity : SimpleActivity() {
).toMutableList() as ArrayList<Conversation>
showOrHidePlaceholder(conversations.isEmpty())
updateOptionsMenu(conversations)
try {
getOrCreateConversationsAdapter().apply {