Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Fix annoying more menu open when scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed May 23, 2022
1 parent 25aef3c commit 79fb5f9
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions app/src/main/java/com/ivy/wallet/ui/home/HomeTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Velocity
import androidx.compose.ui.unit.dp
import com.google.accompanist.insets.systemBarsPadding
import com.ivy.design.l0_system.Theme
Expand Down Expand Up @@ -355,7 +354,6 @@ fun HomeLazyColumn(
) {
val ivyContext = ivyWalletCtx()
val nav = navigation()
val doubleExpanded = remember { mutableStateOf(true) }

val nestedScrollConnection = remember {
object : NestedScrollConnection {
Expand All @@ -372,19 +370,9 @@ fun HomeLazyColumn(
hideBalanceRowState.value = false
}
}
if (listState.firstVisibleItemIndex == 0 && listState.firstVisibleItemScrollOffset == 0 && doubleExpanded.value) {
moreMenuExpanded(true)
} else
doubleExpanded.value = false

return super.onPostScroll(consumed, available, source)
}

override suspend fun onPostFling(consumed: Velocity, available: Velocity): Velocity {
if (consumed.y <= 30f || available.y >= 1000f)
doubleExpanded.value = true
return super.onPostFling(consumed, available)
}
}
}

Expand Down

0 comments on commit 79fb5f9

Please sign in to comment.