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()
|
||||
.padding(vertical = 14.dp, horizontal = 12.dp)
|
||||
.then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier),
|
||||
verticalAlignment = Alignment.Bottom
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
AnimatedContent(
|
||||
targetState = Pair(year, month),
|
||||
@ -53,7 +53,8 @@ fun MonthHeader(
|
||||
slideInVertically(tween(250)) { it } + fadeIn(tween(250)) togetherWith
|
||||
slideOutVertically(tween(250)) { -it } + fadeOut(tween(250))
|
||||
}
|
||||
}
|
||||
},
|
||||
modifier = Modifier.alignByBaseline()
|
||||
) { (y, m) ->
|
||||
Text(
|
||||
text = "${y}年${m}月",
|
||||
@ -71,7 +72,8 @@ fun MonthHeader(
|
||||
slideInVertically(tween(250)) { it } + fadeIn(tween(250)) togetherWith
|
||||
slideOutVertically(tween(250)) { -it } + fadeOut(tween(250))
|
||||
}
|
||||
}
|
||||
},
|
||||
modifier = Modifier.alignByBaseline()
|
||||
) { week ->
|
||||
Text(
|
||||
text = "第${week}周",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user