Skip to content

Commit 6e0e32c

Browse files
committed
Update TopAppBar.kt
1 parent 8cf7b3d commit 6e0e32c

File tree

1 file changed

+3
-5
lines changed
  • miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic

1 file changed

+3
-5
lines changed

miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/TopAppBar.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.WindowInsets
1818
import androidx.compose.foundation.layout.WindowInsetsSides
1919
import androidx.compose.foundation.layout.captionBar
2020
import androidx.compose.foundation.layout.displayCutout
21-
import androidx.compose.foundation.layout.fillMaxHeight
2221
import androidx.compose.foundation.layout.fillMaxWidth
2322
import androidx.compose.foundation.layout.heightIn
2423
import androidx.compose.foundation.layout.navigationBars
@@ -61,7 +60,6 @@ import androidx.compose.ui.util.fastFirst
6160
import top.yukonga.miuix.kmp.basic.TopAppBarState.Companion.Saver
6261
import top.yukonga.miuix.kmp.theme.MiuixTheme
6362
import kotlin.math.abs
64-
import kotlin.math.max
6563
import kotlin.math.roundToInt
6664

6765
/**
@@ -611,9 +609,9 @@ private fun TopAppBarLayout(
611609
.padding(horizontal = horizontalPadding)
612610
.graphicsLayer(alpha = 1f - (abs(scrolledOffset.offset()) / expandedHeightPx * 2).coerceIn(0f, 1f))
613611
.clipToBounds()
614-
){
612+
) {
615613
Text(
616-
modifier = Modifier.offset{IntOffset(0,heightOffset)},
614+
modifier = Modifier.offset { IntOffset(0, heightOffset) },
617615
text = largeTitle,
618616
maxLines = 1,
619617
fontSize = MiuixTheme.textStyles.title1.fontSize,
@@ -670,7 +668,7 @@ private fun TopAppBarLayout(
670668
measurables
671669
.fastFirst { it.layoutId == "largeTitle" }
672670
.measure(
673-
constraints.copy(minWidth = 0)
671+
constraints.copy(minWidth = 0, minHeight = 0)
674672
)
675673

676674
layout(constraints.maxWidth, layoutHeight) {

0 commit comments

Comments
 (0)