Skip to content

Commit

Permalink
Apply AutoSizeText to other title bars in the app
Browse files Browse the repository at this point in the history
  • Loading branch information
mannodermaus committed Aug 30, 2024
1 parent 78c2279 commit 596faa8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LargeTopAppBar
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarColors
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.TopAppBarScrollBehavior
Expand All @@ -29,6 +28,7 @@ import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import io.github.droidkaigi.confsched.designsystem.component.AutoSizeText

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down Expand Up @@ -68,7 +68,7 @@ fun AnimatedLargeTopAppBar(
// No animation required as it is erased with alpha
exit = ExitTransition.None,
) {
Text(
AutoSizeText(
text = title,
modifier = Modifier.then(
when (isCenterTitle) {
Expand All @@ -82,6 +82,7 @@ fun AnimatedLargeTopAppBar(
},
),
textAlign = TextAlign.Center,
maxLines = 1,
)
}
},
Expand Down

0 comments on commit 596faa8

Please sign in to comment.