mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-17 20:20:53 +01:00
Remove empty recycle bin menu item if there are no recycle bin conversations
This commit is contained in:
parent
372dbaeaa4
commit
31be5d3d95
@ -58,6 +58,12 @@ class RecycleBinConversationsActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateOptionsMenu(conversations: ArrayList<Conversation>) {
|
||||||
|
recycle_bin_toolbar.menu.apply {
|
||||||
|
findItem(R.id.empty_recycle_bin).isVisible = conversations.isNotEmpty()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateMenuColors() {
|
private fun updateMenuColors() {
|
||||||
updateStatusbarColor(getProperBackgroundColor())
|
updateStatusbarColor(getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
@ -117,6 +123,7 @@ class RecycleBinConversationsActivity : SimpleActivity() {
|
|||||||
).toMutableList() as ArrayList<Conversation>
|
).toMutableList() as ArrayList<Conversation>
|
||||||
|
|
||||||
showOrHidePlaceholder(conversations.isEmpty())
|
showOrHidePlaceholder(conversations.isEmpty())
|
||||||
|
updateOptionsMenu(conversations)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getOrCreateConversationsAdapter().apply {
|
getOrCreateConversationsAdapter().apply {
|
||||||
|
@ -118,7 +118,7 @@ abstract class MessagesDatabase : RoomDatabase() {
|
|||||||
override fun migrate(database: SupportSQLiteDatabase) {
|
override fun migrate(database: SupportSQLiteDatabase) {
|
||||||
database.apply {
|
database.apply {
|
||||||
execSQL("ALTER TABLE conversations ADD COLUMN archived INTEGER NOT NULL DEFAULT 0")
|
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`)")
|
execSQL("CREATE UNIQUE INDEX IF NOT EXISTS `index_recycle_bin_messages_id` ON `recycle_bin_messages` (`id`)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user