mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Add compose divider to CFV2.
This commit is contained in:
committed by
Greyson Parrelli
parent
42fe827cb3
commit
27e7383db6
@@ -1949,6 +1949,9 @@ class ConversationFragment :
|
||||
}
|
||||
|
||||
private inner class ScrollListener : RecyclerView.OnScrollListener() {
|
||||
|
||||
private var wasAtBottom = true
|
||||
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
if (isScrolledToBottom()) {
|
||||
viewModel.setShowScrollButtons(false)
|
||||
@@ -1956,9 +1959,22 @@ class ConversationFragment :
|
||||
viewModel.setShowScrollButtons(true)
|
||||
}
|
||||
|
||||
presentComposeDivider()
|
||||
|
||||
val timestamp = MarkReadHelper.getLatestTimestamp(adapter, layoutManager)
|
||||
timestamp.ifPresent(markReadHelper::onViewsRevealed)
|
||||
}
|
||||
|
||||
private fun presentComposeDivider() {
|
||||
val isAtBottom = isScrolledToBottom()
|
||||
if (isAtBottom && !wasAtBottom) {
|
||||
ViewUtil.fadeOut(binding.composeDivider, 50, View.INVISIBLE)
|
||||
} else if (wasAtBottom && !isAtBottom) {
|
||||
ViewUtil.fadeIn(binding.composeDivider, 500)
|
||||
}
|
||||
|
||||
wasAtBottom = isAtBottom
|
||||
}
|
||||
}
|
||||
|
||||
private inner class DataObserver(
|
||||
|
||||
Reference in New Issue
Block a user