#1433 - Add swipe action for unread

This commit is contained in:
moezbhatti
2019-06-09 01:54:49 -04:00
parent 97f447dfd3
commit aa3791bc50
5 changed files with 5 additions and 0 deletions
@@ -58,6 +58,7 @@ class Preferences @Inject constructor(private val rxPrefs: RxSharedPreferences)
const val SWIPE_ACTION_DELETE = 2
const val SWIPE_ACTION_CALL = 3
const val SWIPE_ACTION_READ = 4
const val SWIPE_ACTION_UNREAD = 5
}
// Internal
@@ -122,6 +122,7 @@ class ConversationItemTouchCallback @Inject constructor(
Preferences.SWIPE_ACTION_DELETE -> R.drawable.ic_delete_white_24dp
Preferences.SWIPE_ACTION_CALL -> R.drawable.ic_call_white_24dp
Preferences.SWIPE_ACTION_READ -> R.drawable.ic_check_white_24dp
Preferences.SWIPE_ACTION_UNREAD -> R.drawable.ic_markunread_black_24dp
else -> null
}
@@ -339,6 +339,7 @@ class MainViewModel @Inject constructor(
Preferences.SWIPE_ACTION_DELETE -> view.showDeleteDialog(listOf(threadId))
Preferences.SWIPE_ACTION_CALL -> conversationRepo.getConversation(threadId)?.recipients?.firstOrNull()?.address?.let(navigator::makePhoneCall)
Preferences.SWIPE_ACTION_READ -> markRead.execute(listOf(threadId))
Preferences.SWIPE_ACTION_UNREAD -> markUnread.execute(listOf(threadId))
}
}
@@ -73,6 +73,7 @@ class SwipeActionsPresenter @Inject constructor(
Preferences.SWIPE_ACTION_DELETE -> R.drawable.ic_delete_white_24dp
Preferences.SWIPE_ACTION_CALL -> R.drawable.ic_call_white_24dp
Preferences.SWIPE_ACTION_READ -> R.drawable.ic_check_white_24dp
Preferences.SWIPE_ACTION_UNREAD -> R.drawable.ic_markunread_black_24dp
else -> 0
}
@@ -237,6 +237,7 @@
<item>Delete</item>
<item>Call</item>
<item>Mark read</item>
<item>Mark unread</item>
</string-array>
<string name="settings_delivery_title">Delivery confirmations</string>
<string name="settings_delivery_summary">Confirm that messages were sent successfully</string>