Skip to content

Commit

Permalink
Making InlineIconText Single Line (#518)
Browse files Browse the repository at this point in the history
Progress toward #280.
  • Loading branch information
AdamMc331 authored Jul 12, 2024
1 parent c0a0ce7 commit dada545
Show file tree
Hide file tree
Showing 99 changed files with 22 additions and 0 deletions.
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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow

private const val INLINE_CONTENT_ID = "inlineContent"

Expand All @@ -35,6 +36,7 @@ private const val INLINE_CONTENT_ID = "inlineContent"
* @param[textAlign] @see [Text]
* @param[style] @see [Text]
* @param[fontWeight] @see [Text]
* @param[maxLines] @see [Text]
*/
@Composable
fun InlineIconText(
Expand All @@ -48,6 +50,7 @@ fun InlineIconText(
textAlign: TextAlign? = null,
style: TextStyle = LocalTextStyle.current,
fontWeight: FontWeight? = null,
maxLines: Int = Int.MAX_VALUE,
) {
Text(
text = text.getAnnotatedString(
Expand All @@ -64,6 +67,8 @@ fun InlineIconText(
style = style,
color = textColor,
fontWeight = fontWeight,
maxLines = maxLines,
overflow = TextOverflow.Ellipsis,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ private fun MatchTeamResultRow(
icon = Icons.Default.EmojiEvents,
showIcon = teamResult.winner,
fontWeight = fontWeight,
maxLines = 1,
modifier = Modifier
.weight(1F),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,20 @@ class MatchCardPaparazziTest {
)
}
}

@Test
fun renderLongTeamName() {
paparazzi.snapshotScreen(useDarkTheme) {
MatchCard(
match = TestDisplayModel.matchDetailOrangeWinner.copy(
orangeTeamResult = TestDisplayModel.matchTeamResultWinner.copy(
team = TestDisplayModel.g2.copy(
name = "SUPER DUPER LONG TEAM NAME THAT SHOULD OVERFLOW",
),
),
),
onClick = {},
)
}
}
}
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 dada545

Please sign in to comment.