mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
fix(AppBar): Also adjust the other placeables' padding
This commit is contained in:
parent
8b53e5ad10
commit
d2ddf7dfb0
1 changed files with 3 additions and 6 deletions
|
@ -475,13 +475,11 @@ private class TopAppBarMeasurePolicy(
|
||||||
y =
|
y =
|
||||||
when (titleVerticalArrangement) {
|
when (titleVerticalArrangement) {
|
||||||
Arrangement.Bottom -> {
|
Arrangement.Bottom -> {
|
||||||
val padding = (constraints.maxHeight - navigationIconPlaceable.height) / 2
|
val paddingFromBottom = (constraints.maxHeight - (navigationIconPlaceable.height - titleBaseline)) / 2
|
||||||
val paddingFromBottom = padding - (navigationIconPlaceable.height - titleBaseline)
|
|
||||||
val heightWithPadding = paddingFromBottom + navigationIconPlaceable.height
|
val heightWithPadding = paddingFromBottom + navigationIconPlaceable.height
|
||||||
val adjustedBottomPadding =
|
val adjustedBottomPadding =
|
||||||
if (heightWithPadding > constraints.maxHeight) {
|
if (heightWithPadding > constraints.maxHeight) {
|
||||||
paddingFromBottom -
|
paddingFromBottom - (heightWithPadding - constraints.maxHeight)
|
||||||
(heightWithPadding - constraints.maxHeight)
|
|
||||||
} else {
|
} else {
|
||||||
paddingFromBottom
|
paddingFromBottom
|
||||||
}
|
}
|
||||||
|
@ -557,8 +555,7 @@ private class TopAppBarMeasurePolicy(
|
||||||
y =
|
y =
|
||||||
when (titleVerticalArrangement) {
|
when (titleVerticalArrangement) {
|
||||||
Arrangement.Bottom -> {
|
Arrangement.Bottom -> {
|
||||||
val padding = (constraints.maxHeight - actionIconsPlaceable.height) / 2
|
val paddingFromBottom = (constraints.maxHeight - (actionIconsPlaceable.height - titleBaseline)) / 2
|
||||||
val paddingFromBottom = padding - (actionIconsPlaceable.height - titleBaseline)
|
|
||||||
val heightWithPadding = paddingFromBottom + actionIconsPlaceable.height
|
val heightWithPadding = paddingFromBottom + actionIconsPlaceable.height
|
||||||
val adjustedBottomPadding =
|
val adjustedBottomPadding =
|
||||||
if (heightWithPadding > constraints.maxHeight) {
|
if (heightWithPadding > constraints.maxHeight) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue