Mark all messages as read upon opening a conversation

This commit is contained in:
Niels Andriesse 2021-06-25 09:44:27 +10:00
parent 2a06904d76
commit a7e5ff1ce2

View File

@ -126,6 +126,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
setUpBlockedBanner()
setUpLinkPreviewObserver()
scrollToFirstUnreadMessage()
markAllAsRead()
}
private fun setUpRecyclerView() {
@ -257,6 +258,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
// endregion
// region Updating & Animation
private fun markAllAsRead() {
DatabaseFactory.getThreadDatabase(this).setRead(threadID, true)
}
override fun inputBarHeightChanged(newValue: Int) {
@Suppress("NAME_SHADOWING") val newValue = max(newValue, resources.getDimension(R.dimen.input_bar_height).roundToInt())
// 36 DP is the exact height of the typing indicator view. It's also exactly 18 * 2, and 18 is the large message