[TMP] Debug read marker placement
Change-Id: Ib7a400bf4c5e1357f5b8f2e0cc8333bcf1306d50
This commit is contained in:
parent
6a96b50b84
commit
e6a7e05a92
@ -25,6 +25,7 @@ import im.vector.app.features.home.room.detail.timeline.item.DaySeparatorItem
|
|||||||
import im.vector.app.features.home.room.detail.timeline.item.ItemWithEvents
|
import im.vector.app.features.home.room.detail.timeline.item.ItemWithEvents
|
||||||
import im.vector.app.features.home.room.detail.timeline.item.TimelineReadMarkerItem_
|
import im.vector.app.features.home.room.detail.timeline.item.TimelineReadMarkerItem_
|
||||||
import org.matrix.android.sdk.api.session.room.timeline.Timeline
|
import org.matrix.android.sdk.api.session.room.timeline.Timeline
|
||||||
|
import timber.log.Timber
|
||||||
import kotlin.reflect.KMutableProperty0
|
import kotlin.reflect.KMutableProperty0
|
||||||
|
|
||||||
private const val DEFAULT_PREFETCH_THRESHOLD = 30
|
private const val DEFAULT_PREFETCH_THRESHOLD = 30
|
||||||
@ -49,6 +50,8 @@ class TimelineControllerInterceptorHelper(private val positionOfReadMarker: KMut
|
|||||||
models.addBackwardPrefetchIfNeeded(timeline, callback)
|
models.addBackwardPrefetchIfNeeded(timeline, callback)
|
||||||
models.addForwardPrefetchIfNeeded(timeline, callback)
|
models.addForwardPrefetchIfNeeded(timeline, callback)
|
||||||
|
|
||||||
|
Timber.i("ReadMarker debug: intercept $unreadState")
|
||||||
|
|
||||||
val modelsIterator = models.listIterator()
|
val modelsIterator = models.listIterator()
|
||||||
var index = 0
|
var index = 0
|
||||||
val firstUnreadEventId = (unreadState as? UnreadState.HasUnread)?.firstUnreadEventId
|
val firstUnreadEventId = (unreadState as? UnreadState.HasUnread)?.firstUnreadEventId
|
||||||
@ -81,6 +84,7 @@ class TimelineControllerInterceptorHelper(private val positionOfReadMarker: KMut
|
|||||||
index++
|
index++
|
||||||
positionOfReadMarker.set(index)
|
positionOfReadMarker.set(index)
|
||||||
appendReadMarker = false
|
appendReadMarker = false
|
||||||
|
Timber.i("ReadMarker debug: read marker appended at $index")
|
||||||
}
|
}
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user