Fix unread filter deactivating when scrolling through the conversation list.

This commit is contained in:
jeffrey-signal
2026-03-19 19:47:51 -04:00
committed by Cody Henthorne
parent a0c0acb8fc
commit 9594599d60
2 changed files with 9 additions and 3 deletions

View File

@@ -22,14 +22,14 @@ class ConversationFilterBehavior(context: Context, attributeSet: AttributeSet) :
override fun onStopNestedScroll(coordinatorLayout: CoordinatorLayout, child: AppBarLayout, target: View, type: Int) {
super.onStopNestedScroll(coordinatorLayout, child, target, type)
child.setExpanded(false, true)
callback?.onStopNestedScroll()
child.setExpanded(false, true)
}
override fun onTouchEvent(parent: CoordinatorLayout, child: AppBarLayout, ev: MotionEvent): Boolean {
if (ev.action == MotionEvent.ACTION_UP) {
child.setExpanded(false, true)
callback?.onStopNestedScroll()
child.setExpanded(false, true)
}
return super.onTouchEvent(parent, child, ev)
}

View File

@@ -78,6 +78,7 @@ class ConversationListFilterPullView @JvmOverloads constructor(
private val velocityTracker = ProgressVelocityTracker(5)
private var animateHelpText = 0
private var helpTextStartFraction = 0.35f
private var previousDragProgress: Float? = null
private val pillDefaultBackgroundTint = ContextCompat.getColor(context, CoreUiR.color.signal_colorSecondaryContainer)
private val pillWillCloseBackgroundTint = ContextCompat.getColor(context, CoreUiR.color.signal_colorSurface1)
@@ -114,6 +115,9 @@ class ConversationListFilterPullView @JvmOverloads constructor(
}
fun onUserDrag(progress: Float) {
val previousProgress = previousDragProgress ?: progress
val enteredApexFromBelow = previousProgress < 1f && progress >= 1f
binding.filterCircle.progress = progress
if (state == FilterPullState.CLOSED && progress <= 0) {
@@ -123,7 +127,7 @@ class ConversationListFilterPullView @JvmOverloads constructor(
vibrate()
resetHelpText()
resetPillColor()
} else if (state == FilterPullState.OPEN && progress >= 1f) {
} else if (state == FilterPullState.OPEN && enteredApexFromBelow) {
setState(FilterPullState.CLOSE_APEX, ConversationFilterSource.DRAG)
vibrate()
animatePillColor()
@@ -167,6 +171,8 @@ class ConversationListFilterPullView @JvmOverloads constructor(
if (state == FilterPullState.CLOSE_APEX) {
binding.filterText.alpha = FilterLerp.getPillCloseApexAlphaLerp(progress)
}
previousDragProgress = progress
}
fun onUserDragFinished() {