Use baseline alignment for month text and week number
This commit is contained in:
parent
418b97baed
commit
888c4d03d3
@ -41,7 +41,7 @@ fun MonthHeader(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(vertical = 14.dp, horizontal = 12.dp)
|
.padding(vertical = 14.dp, horizontal = 12.dp)
|
||||||
.then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier),
|
.then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier),
|
||||||
verticalAlignment = Alignment.Bottom
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
AnimatedContent(
|
AnimatedContent(
|
||||||
targetState = Pair(year, month),
|
targetState = Pair(year, month),
|
||||||
@ -53,7 +53,8 @@ fun MonthHeader(
|
|||||||
slideInVertically(tween(250)) { it } + fadeIn(tween(250)) togetherWith
|
slideInVertically(tween(250)) { it } + fadeIn(tween(250)) togetherWith
|
||||||
slideOutVertically(tween(250)) { -it } + fadeOut(tween(250))
|
slideOutVertically(tween(250)) { -it } + fadeOut(tween(250))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
modifier = Modifier.alignByBaseline()
|
||||||
) { (y, m) ->
|
) { (y, m) ->
|
||||||
Text(
|
Text(
|
||||||
text = "${y}年${m}月",
|
text = "${y}年${m}月",
|
||||||
@ -71,7 +72,8 @@ fun MonthHeader(
|
|||||||
slideInVertically(tween(250)) { it } + fadeIn(tween(250)) togetherWith
|
slideInVertically(tween(250)) { it } + fadeIn(tween(250)) togetherWith
|
||||||
slideOutVertically(tween(250)) { -it } + fadeOut(tween(250))
|
slideOutVertically(tween(250)) { -it } + fadeOut(tween(250))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
modifier = Modifier.alignByBaseline()
|
||||||
) { week ->
|
) { week ->
|
||||||
Text(
|
Text(
|
||||||
text = "第${week}周",
|
text = "第${week}周",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user