mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 02:55:23 +00:00
Fixed a couple of bugs with the highlighting
This commit is contained in:
parent
da02d385d1
commit
ba7a759905
@ -501,11 +501,15 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
if (cursor != null) {
|
||||
val messageTimestamp = messageToScrollTimestamp.getAndSet(-1)
|
||||
val author = messageToScrollAuthor.getAndSet(null)
|
||||
var initialUnreadCount = 0
|
||||
|
||||
// Update the unreadCount value to be loaded from the database since we got a new message
|
||||
if (firstLoad.get() || oldCount != newCount) {
|
||||
// Update the unreadCount value to be loaded from the database since we got a new message
|
||||
unreadCount = mmsSmsDb.getUnreadCount(viewModel.threadId)
|
||||
// Update the unreadCount value to be loaded from the database since we got a new
|
||||
// message (we need to store it in a local variable as it can get overwritten on
|
||||
// another thread before the 'firstLoad.getAndSet(false)' case below)
|
||||
initialUnreadCount = mmsSmsDb.getUnreadCount(viewModel.threadId)
|
||||
unreadCount = initialUnreadCount
|
||||
updateUnreadCountIndicator()
|
||||
}
|
||||
|
||||
@ -518,7 +522,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
val lastSeenItemPosition = scrollToFirstUnreadMessageIfNeeded(true)
|
||||
handleRecyclerViewScrolled()
|
||||
|
||||
if (lastSeenItemPosition != null) {
|
||||
if (initialUnreadCount > 0 && lastSeenItemPosition != null) {
|
||||
forceHighlightNextLoad.set(lastSeenItemPosition)
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class VoiceMessageView : RelativeLayout, AudioSlidePlayer.Listener {
|
||||
if (progress == 1.0) {
|
||||
togglePlayback()
|
||||
handleProgressChanged(0.0)
|
||||
delegate?.playVoiceMessageAtIndexIfPossible(indexInAdapter - 1)
|
||||
delegate?.playVoiceMessageAtIndexIfPossible(indexInAdapter + 1)
|
||||
} else {
|
||||
handleProgressChanged(progress)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user