Lower collapse threshold to 25% for easier fold/unfold triggering
Collapse triggers when progress > 0.25 (was 0.5). Expand triggers when progress < 0.75 (1 - threshold), creating asymmetric thresholds that make both fold and unfold easy to trigger with a short drag. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
69e49b5d81
commit
270346e6ef
@ -102,7 +102,7 @@ class CalendarViewModel(
|
||||
val shouldExpand = when {
|
||||
velocityDpPerSec < -FLING_VELOCITY_THRESHOLD_DP -> true // 快速下滑→展开
|
||||
velocityDpPerSec > FLING_VELOCITY_THRESHOLD_DP -> false // 快速上滑→保持折叠
|
||||
else -> progress < COLLAPSE_THRESHOLD // 慢速按 progress 判断
|
||||
else -> progress < 1f - COLLAPSE_THRESHOLD // 慢速按 progress 判断
|
||||
}
|
||||
if (shouldExpand) {
|
||||
_collapseAnimatable.animateTo(
|
||||
|
||||
@ -9,8 +9,8 @@ import kotlinx.datetime.plus
|
||||
/** 无限分页中心页,用于 HorizontalPager 的起始位置 */
|
||||
const val START_PAGE = Int.MAX_VALUE / 2
|
||||
|
||||
/** 折叠判定阈值:progress > 此值时折叠,< 此值时展开 */
|
||||
const val COLLAPSE_THRESHOLD = 0.5f
|
||||
/** 折叠判定阈值:折叠时 progress > 此值触发,展开时 progress < (1-此值) 触发 */
|
||||
const val COLLAPSE_THRESHOLD = 0.25f
|
||||
|
||||
/** 滑动偏移插值阈值:abs(offsetFraction) > 此值时启用插值 */
|
||||
const val OFFSET_FRACTION_THRESHOLD = 0.01f
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user