Skip to content

Commit 99a133d

Browse files
bmanderclaude
andauthored
Fix lint errors surfaced by the new nightly lint job (#1937)
The lint job added in #1914 is the first run of lintObaGoogleDebug since lint was pulled off PR/push CI in #1843, so two unrelated regressions from that gap surfaced together: - AdjacencyRouteColors.kt's @SuppressLint("RestrictedApi") covers adjacencyRouteColors() but not the private routeColor() it calls, where the actual restricted Hct.from(...).toInt() calls live. - #1865 added new optional parameters ahead of the existing `modifier` parameter in RouteArrivalRow and ArrivalsList, breaking the Compose convention that modifier be the first optional parameter. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 7fa89d8 commit 99a133d

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

onebusaway-android/src/main/java/org/onebusaway/android/map/AdjacencyRouteColors.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ internal fun <K : Any> adjacencyRouteColors(
5252
return keys.associateWith(assigned::getValue)
5353
}
5454

55+
// Hct is Material Components' vendored color-science util (LIBRARY_GROUP); no public equivalent
56+
// exists, so this is deliberate long-term use, not a migration to track (same as LineBadge).
57+
@SuppressLint("RestrictedApi")
5558
private fun routeColor(hue: Double): Int =
5659
Hct.from(hue, ADJACENCY_ROUTE_CHROMA, ADJACENCY_ROUTE_TONE).toInt()
5760

onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/ArrivalsScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ internal fun ArrivalsList(
340340
/** Whether a load-more request is in flight, for the footer button's spinner. Collected only by
341341
* the footer item below, so a toggle recomposes just that item, not the whole list. */
342342
loadingMore: StateFlow<Boolean>,
343+
modifier: Modifier = Modifier,
343344
/** Stop-focus map colors keyed by route-direction. Empty outside the home drawer. */
344345
mapRouteColors: Map<RouteDirectionKey, Int> = emptyMap(),
345346
/** Exact route-direction row selected over the home map's stop focus; null outside that state. */
@@ -348,7 +349,6 @@ internal fun ArrivalsList(
348349
selectedRouteId: String? = null,
349350
/** Route names in the selected vehicle block, beginning with the route on this row. */
350351
selectedRouteNames: List<String> = emptyList(),
351-
modifier: Modifier = Modifier,
352352
listState: LazyListState = rememberLazyListState(),
353353
/** Hosts that show the stop's direction elsewhere (e.g. in their own header) set this false to
354354
* avoid duplicating it as a list item. */

onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/components/ArrivalRows.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ fun RouteArrivalRow(
260260
actionsFor: (ArrivalInfo) -> ArrivalActions?,
261261
isFavorite: Boolean,
262262
callbacks: ArrivalRowCallbacks,
263+
modifier: Modifier = Modifier,
263264
mapRouteColor: Int? = null,
264265
selected: Boolean = false,
265266
selectedRouteNames: List<String> = emptyList(),
266-
modifier: Modifier = Modifier,
267267
etaAnchor: Modifier = Modifier,
268268
) {
269269
val representative = group.representative

0 commit comments

Comments
 (0)