Skip to content

Commit 57a9723

Browse files
Restrict Toolbar to only 2 lines
1 parent edcc5bf commit 57a9723

File tree

1 file changed

+5
-5
lines changed
  • lib_theme/src/main/java/no/nordicsemi/android/theme/view

1 file changed

+5
-5
lines changed

lib_theme/src/main/java/no/nordicsemi/android/theme/view/TopAppBar.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import no.nordicsemi.android.theme.R
1717
@Composable
1818
fun CloseIconAppBar(text: String, onClick: () -> Unit) {
1919
SmallTopAppBar(
20-
title = { Text(text) },
20+
title = { Text(text, maxLines = 2) },
2121
colors = TopAppBarDefaults.smallTopAppBarColors(
2222
scrolledContainerColor = MaterialTheme.colorScheme.primary,
2323
containerColor = colorResource(id = R.color.appBarColor),
@@ -39,7 +39,7 @@ fun CloseIconAppBar(text: String, onClick: () -> Unit) {
3939
@Composable
4040
fun TitleAppBar(text: String) {
4141
SmallTopAppBar(
42-
title = { Text(text) },
42+
title = { Text(text, maxLines = 2) },
4343
colors = TopAppBarDefaults.smallTopAppBarColors(
4444
scrolledContainerColor = MaterialTheme.colorScheme.primary,
4545
containerColor = colorResource(id = R.color.appBarColor),
@@ -53,7 +53,7 @@ fun TitleAppBar(text: String) {
5353
@Composable
5454
fun LoggerBackIconAppBar(text: String, onClick: () -> Unit) {
5555
SmallTopAppBar(
56-
title = { Text(text) },
56+
title = { Text(text, maxLines = 2) },
5757
colors = TopAppBarDefaults.smallTopAppBarColors(
5858
scrolledContainerColor = MaterialTheme.colorScheme.primary,
5959
containerColor = colorResource(id = R.color.appBarColor),
@@ -86,7 +86,7 @@ fun LoggerBackIconAppBar(text: String, onClick: () -> Unit) {
8686
@Composable
8787
fun BackIconAppBar(text: String, onClick: () -> Unit) {
8888
SmallTopAppBar(
89-
title = { Text(text) },
89+
title = { Text(text, maxLines = 2) },
9090
colors = TopAppBarDefaults.smallTopAppBarColors(
9191
scrolledContainerColor = MaterialTheme.colorScheme.primary,
9292
containerColor = colorResource(id = R.color.appBarColor),
@@ -109,7 +109,7 @@ fun BackIconAppBar(text: String, onClick: () -> Unit) {
109109
@Composable
110110
fun LoggerIconAppBar(text: String, onClick: () -> Unit, onDisconnectClick: () -> Unit, onLoggerClick: () -> Unit) {
111111
SmallTopAppBar(
112-
title = { Text(text) },
112+
title = { Text(text, maxLines = 2) },
113113
colors = TopAppBarDefaults.smallTopAppBarColors(
114114
scrolledContainerColor = MaterialTheme.colorScheme.primary,
115115
containerColor = colorResource(id = R.color.appBarColor),

0 commit comments

Comments
 (0)