mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +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) {
|
if (cursor != null) {
|
||||||
val messageTimestamp = messageToScrollTimestamp.getAndSet(-1)
|
val messageTimestamp = messageToScrollTimestamp.getAndSet(-1)
|
||||||
val author = messageToScrollAuthor.getAndSet(null)
|
val author = messageToScrollAuthor.getAndSet(null)
|
||||||
|
var initialUnreadCount = 0
|
||||||
|
|
||||||
// Update the unreadCount value to be loaded from the database since we got a new message
|
// Update the unreadCount value to be loaded from the database since we got a new message
|
||||||
if (firstLoad.get() || oldCount != newCount) {
|
if (firstLoad.get() || oldCount != newCount) {
|
||||||
// Update the unreadCount value to be loaded from the database since we got a new message
|
// Update the unreadCount value to be loaded from the database since we got a new
|
||||||
unreadCount = mmsSmsDb.getUnreadCount(viewModel.threadId)
|
// 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()
|
updateUnreadCountIndicator()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,7 +522,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||||||
val lastSeenItemPosition = scrollToFirstUnreadMessageIfNeeded(true)
|
val lastSeenItemPosition = scrollToFirstUnreadMessageIfNeeded(true)
|
||||||
handleRecyclerViewScrolled()
|
handleRecyclerViewScrolled()
|
||||||
|
|
||||||
if (lastSeenItemPosition != null) {
|
if (initialUnreadCount > 0 && lastSeenItemPosition != null) {
|
||||||
forceHighlightNextLoad.set(lastSeenItemPosition)
|
forceHighlightNextLoad.set(lastSeenItemPosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ class VoiceMessageView : RelativeLayout, AudioSlidePlayer.Listener {
|
|||||||
if (progress == 1.0) {
|
if (progress == 1.0) {
|
||||||
togglePlayback()
|
togglePlayback()
|
||||||
handleProgressChanged(0.0)
|
handleProgressChanged(0.0)
|
||||||
delegate?.playVoiceMessageAtIndexIfPossible(indexInAdapter - 1)
|
delegate?.playVoiceMessageAtIndexIfPossible(indexInAdapter + 1)
|
||||||
} else {
|
} else {
|
||||||
handleProgressChanged(progress)
|
handleProgressChanged(progress)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user