diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/RecycleBinConversationsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/RecycleBinConversationsActivity.kt index cd13f825..91a61bf4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/RecycleBinConversationsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/RecycleBinConversationsActivity.kt @@ -58,6 +58,12 @@ class RecycleBinConversationsActivity : SimpleActivity() { } } + private fun updateOptionsMenu(conversations: ArrayList) { + recycle_bin_toolbar.menu.apply { + findItem(R.id.empty_recycle_bin).isVisible = conversations.isNotEmpty() + } + } + private fun updateMenuColors() { updateStatusbarColor(getProperBackgroundColor()) } @@ -117,6 +123,7 @@ class RecycleBinConversationsActivity : SimpleActivity() { ).toMutableList() as ArrayList showOrHidePlaceholder(conversations.isEmpty()) + updateOptionsMenu(conversations) try { getOrCreateConversationsAdapter().apply { diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/databases/MessagesDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/databases/MessagesDatabase.kt index 6ecddfc0..55b5c701 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/databases/MessagesDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/databases/MessagesDatabase.kt @@ -118,7 +118,7 @@ abstract class MessagesDatabase : RoomDatabase() { override fun migrate(database: SupportSQLiteDatabase) { database.apply { execSQL("ALTER TABLE conversations ADD COLUMN archived INTEGER NOT NULL DEFAULT 0") - execSQL("CREATE TABLE IF NOT EXISTS `recycle_bin_messages` (`id` INTEGER PRIMARY KEY, `deleted_ts` INTEGER NOT NULL)") + execSQL("CREATE TABLE IF NOT EXISTS `recycle_bin_messages` (`id` INTEGER NOT NULL PRIMARY KEY, `deleted_ts` INTEGER NOT NULL)") execSQL("CREATE UNIQUE INDEX IF NOT EXISTS `index_recycle_bin_messages_id` ON `recycle_bin_messages` (`id`)") } }