Skip to content

Commit ff4ee3a

Browse files
committed
feat(widget): properly distinguish transport line from destination
1 parent 816bb86 commit ff4ee3a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

app/src/main/java/net/youapps/transport/widget/GlanceDepartureItem.kt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fun GlanceDepartureItem(departure: Departure, onDestinationClicked: (Location) -
3333
.clickable {
3434
departure.destination?.let { onDestinationClicked(it) }
3535
}
36-
.padding(horizontal = 10.dp, vertical = 4.dp)
36+
.padding(horizontal = 10.dp, vertical = 4.dp),
3737
) {
3838
Row(
3939
modifier = GlanceModifier.fillMaxWidth(),
@@ -51,9 +51,26 @@ fun GlanceDepartureItem(departure: Departure, onDestinationClicked: (Location) -
5151
modifier = GlanceModifier.width(4.dp)
5252
)
5353

54+
departure.line?.label?.let {
55+
Text(
56+
modifier = GlanceModifier
57+
.cornerRadius(6.dp)
58+
.background(GlanceTheme.colors.primaryContainer)
59+
.padding(horizontal = 6.dp, vertical = 4.dp),
60+
text = it,
61+
style = defaultTextStyle.copy(
62+
color = GlanceTheme.colors.onPrimaryContainer
63+
)
64+
)
65+
66+
Spacer(
67+
modifier = GlanceModifier.width(4.dp)
68+
)
69+
}
70+
5471
Text(
5572
modifier = GlanceModifier.defaultWeight(),
56-
text = "${departure.line.label}, ${departure.destination?.displayName().orEmpty()}",
73+
text = departure.destination?.displayName().orEmpty(),
5774
style = defaultTextStyle
5875
)
5976

0 commit comments

Comments
 (0)