feat: add avatar presence handling in OtherProfileScreen for improved scroll behavior
This commit is contained in:
@@ -420,11 +420,18 @@ fun OtherProfileScreen(
|
||||
}
|
||||
}
|
||||
|
||||
// DEBUG LOGS
|
||||
// Коллапс при отсутствии аватара
|
||||
LaunchedEffect(hasAvatar) {
|
||||
if (!hasAvatar) {
|
||||
isPulledDown = false
|
||||
overscrollOffset = 0f
|
||||
}
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
// NESTED SCROLL - Telegram style with overscroll support
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
val nestedScrollConnection = remember {
|
||||
val nestedScrollConnection = remember(hasAvatar) {
|
||||
object : NestedScrollConnection {
|
||||
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
||||
val delta = available.y
|
||||
@@ -474,8 +481,8 @@ fun OtherProfileScreen(
|
||||
available: Offset,
|
||||
source: NestedScrollSource
|
||||
): Offset {
|
||||
// Overscroll при свайпе вниз от верха
|
||||
if (available.y > 0 && scrollOffset == 0f) {
|
||||
// Overscroll при свайпе вниз от верха (только если есть аватар)
|
||||
if (available.y > 0 && scrollOffset == 0f && hasAvatar) {
|
||||
// Telegram: сопротивление если ещё не isPulledDown
|
||||
val resistance = if (isPulledDown) 1f else 0.5f
|
||||
val delta = available.y * resistance
|
||||
|
||||
Reference in New Issue
Block a user