Last active
July 7, 2021 13:55
-
-
Save catalinghita8/a7c41968ab7830fbcb78b52a22d6f7e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
private fun CategoryDetailsCollapsingToolbar(category: FoodItem?, scrollOffset: Float) { | |
val imageSize by animateDpAsState(targetValue = max(72.dp, 128.dp * scrollOffset)) | |
val linesCount = max(3f, scrollOffset * 6).toInt() | |
Row { | |
Image(modifier = Modifier.size(imageSize), ...) | |
Column { | |
Text(text = item?.name) | |
Text( | |
text = item.description.trim(), | |
maxLines = linesCount | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment