|
1 | 1 | package com.amsterdam.ui.components.appBar |
2 | 2 |
|
| 3 | +import androidx.compose.foundation.layout.Box |
3 | 4 | import androidx.compose.foundation.layout.PaddingValues |
| 5 | +import androidx.compose.foundation.layout.height |
4 | 6 | import androidx.compose.runtime.Composable |
| 7 | +import androidx.compose.ui.Alignment |
5 | 8 | import androidx.compose.ui.Modifier |
6 | 9 | import androidx.compose.ui.graphics.Color |
7 | 10 | import androidx.compose.ui.graphics.painter.Painter |
@@ -41,13 +44,15 @@ fun DefaultAppBar( |
41 | 44 | title = |
42 | 45 | title.takeIf { it.isNotBlank() }?.let { text -> |
43 | 46 | { |
44 | | - Text( |
45 | | - text = text, |
46 | | - color = AppTheme.color.title, |
47 | | - style = AppTheme.textStyle.title.large, |
48 | | - maxLines = 1, |
49 | | - overflow = TextOverflow.Ellipsis |
50 | | - ) |
| 47 | + Box(Modifier.height(40.dp), contentAlignment = Alignment.Center) { |
| 48 | + Text( |
| 49 | + text = text, |
| 50 | + color = AppTheme.color.title, |
| 51 | + style = AppTheme.textStyle.title.large, |
| 52 | + maxLines = 1, |
| 53 | + overflow = TextOverflow.Ellipsis |
| 54 | + ) |
| 55 | + } |
51 | 56 | } |
52 | 57 | }, |
53 | 58 | leadingIcon = |
@@ -102,3 +107,15 @@ private fun DefaultAppBarPreview() { |
102 | 107 | ) |
103 | 108 | } |
104 | 109 | } |
| 110 | + |
| 111 | +@ThemeAndLocalePreviews |
| 112 | +@Composable |
| 113 | +private fun DefaultAppBaarPreview() { |
| 114 | + AflamiTheme { |
| 115 | + DefaultAppBar( |
| 116 | + title = stringResource(R.string.my_account), |
| 117 | + containerColor = AppTheme.color.surface, |
| 118 | + showNavigateBackButton = false |
| 119 | + ) |
| 120 | + } |
| 121 | +} |
0 commit comments