Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left menu improvement #100

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Abrupt padding animation fixed
  • Loading branch information
UmairKhalid786 committed Sep 14, 2023
commit f20686433263108b5249c5781739df0e5521f13b
Original file line number Diff line number Diff line change
@@ -24,10 +24,10 @@ import compose.icons.lineawesomeicons.TvSolid
fun MenuHeader(expanded: Boolean = true) {
val animatedAlpha = animateFloatAsState(
animationSpec = keyframes {
this.delayMillis = 500
this.durationMillis = 500
this.delayMillis = 100
this.durationMillis = 100
},
targetValue = if (expanded) 1f else 0f,
targetValue = if (expanded) 1f else 0f, label = "animatedAlpha",
)
Column(
horizontalAlignment = Alignment.CenterHorizontally,
Original file line number Diff line number Diff line change
@@ -37,11 +37,12 @@ val navigationRow: @Composable (
onMenuSelected: ((menuItem: MenuItem) -> Unit)?,
) -> Unit =
{ drawerValue, menu, modifier, onMenuSelected ->

val padding = animateDpAsState(
animationSpec = keyframes {
this.delayMillis = 100
},
targetValue = if (drawerValue == DrawerValue.Open) 4.dp else 0.dp,
targetValue = if (drawerValue == DrawerValue.Open) 4.dp else 0.dp, label = "",
)

Surface(
@@ -60,7 +61,7 @@ val navigationRow: @Composable (
Icon(
imageVector = it,
contentDescription = menu.text,
modifier = Modifier.size(16.dp),
modifier = Modifier.size(20.dp),
)
Spacer(modifier = Modifier.padding(horizontal = padding.value))
}