Skip to content

Commit

Permalink
Update Confirmation - maxLines is always 3 and set text to fillMaxWid…
Browse files Browse the repository at this point in the history
…th. (google#2142)

Co-authored-by: stevebower <stevebower@google.com>
  • Loading branch information
BowerSteve and stevebower authored Mar 18, 2024
1 parent 536a255 commit d671e45
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.google.android.horologist.compose.material
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -115,10 +116,11 @@ public fun ConfirmationContent(
title = title?.let {
{
Text(
modifier = Modifier.fillMaxWidth(),
text = it,
color = MaterialTheme.colors.onBackground,
textAlign = TextAlign.Center,
maxLines = if (icon == null) 3 else 2,
maxLines = 3,
overflow = TextOverflow.Ellipsis,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,20 @@ class DialogTest(device: Device) : ScreenSizeTest(
)
}
}

@Test
fun multiLineConfirmationScreen() {
runTest {
ConfirmationContent(
icon = {
Icon(
imageVector = Icons.Filled.Check,
contentDescription = "Completed",
tint = Color.Green,
)
},
title = "This example uses three lines of text to show max limit",
)
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d671e45

Please sign in to comment.