@@ -29,6 +29,7 @@ import androidx.compose.material3.Icon
2929import androidx.compose.material3.IconButton
3030import androidx.compose.material3.LinearProgressIndicator
3131import androidx.compose.material3.MaterialTheme
32+ import androidx.compose.material3.ProgressIndicatorDefaults
3233import androidx.compose.material3.ProvideTextStyle
3334import androidx.compose.material3.Scaffold
3435import androidx.compose.material3.Text
@@ -70,7 +71,7 @@ fun StationListUI(state: StationListScreen.State, modifier: Modifier = Modifier)
7071 navigationIcon = {
7172 IconButton (onClick = { state.eventSink(StationListScreen .Event .BackClicked ) }) {
7273 Icon (
73- Icons .AutoMirrored .Filled .ArrowBack ,
74+ Icons .AutoMirrored .Filled .ArrowBack ,
7475 contentDescription = " Back" ,
7576 tint = MaterialTheme .colorScheme.onPrimary
7677 )
@@ -119,7 +120,7 @@ fun StationViewPreview() {
119120fun StationView (station : Station ) {
120121 val totalSlots = station.freeBikes() + (station.empty_slots ? : 0 )
121122 val bikePercentage = if (totalSlots > 0 ) station.freeBikes().toFloat() / totalSlots else 0f
122-
123+
123124 // Determine availability color based on percentage of available bikes
124125 val availabilityColor = when {
125126 bikePercentage < 0.2f -> lowAvailabilityColor
@@ -140,28 +141,29 @@ fun StationView(station: Station) {
140141 ) {
141142 // Station name
142143 Text (
143- text = station.name,
144- style = MaterialTheme .typography.titleMedium,
144+ text = station.name,
145+ style = MaterialTheme .typography.titleMedium,
145146 fontWeight = FontWeight .Bold ,
146147 maxLines = 2 ,
147148 overflow = TextOverflow .Ellipsis
148149 )
149-
150+
150151 Spacer (modifier = Modifier .height(12 .dp))
151-
152+
152153 // Availability progress indicator
153154 LinearProgressIndicator (
154- progress = bikePercentage,
155+ progress = { bikePercentage } ,
155156 modifier = Modifier
156157 .fillMaxWidth()
157158 .height(8 .dp)
158159 .clip(RoundedCornerShape (4 .dp)),
159160 color = availabilityColor,
160- trackColor = MaterialTheme .colorScheme.surfaceVariant
161+ trackColor = MaterialTheme .colorScheme.surfaceVariant,
162+ strokeCap = ProgressIndicatorDefaults .LinearStrokeCap ,
161163 )
162-
164+
163165 Spacer (modifier = Modifier .height(12 .dp))
164-
166+
165167 // Availability details
166168 Row (
167169 modifier = Modifier .fillMaxWidth(),
@@ -185,9 +187,9 @@ fun StationView(station: Station) {
185187 modifier = Modifier .size(20 .dp)
186188 )
187189 }
188-
190+
189191 Spacer (modifier = Modifier .width(8 .dp))
190-
192+
191193 Column {
192194 Text (
193195 " Available Bikes" ,
@@ -202,7 +204,7 @@ fun StationView(station: Station) {
202204 )
203205 }
204206 }
205-
207+
206208 // Empty slots
207209 Row (
208210 verticalAlignment = Alignment .CenterVertically
@@ -221,9 +223,9 @@ fun StationView(station: Station) {
221223 modifier = Modifier .size(20 .dp)
222224 )
223225 }
224-
226+
225227 Spacer (modifier = Modifier .width(8 .dp))
226-
228+
227229 Column {
228230 Text (
229231 " Empty Slots" ,
0 commit comments