Skip to content

Commit e1b7b8f

Browse files
committed
map related updates
1 parent e34ca0b commit e1b7b8f

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

android-app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ dependencies {
125125
implementation(libs.androidx.compose.material.iconsExtended)
126126
implementation(libs.androidx.compose.material3.windowSizeClass)
127127

128-
implementation("com.google.maps.android:maps-compose:2.11.0")
129-
implementation("com.google.maps.android:maps-compose-utils:2.11.0")
128+
implementation(libs.googleMapsCompose)
129+
implementation(libs.googleMapsComposeUtils)
130130

131131
implementation(libs.accompanist.swiperefresh)
132132

android-app/src/main/java/dev/johnoreilly/galwaybus/ui/screens/BusInfoScreen.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import kotlinx.coroutines.launch
2727
fun BusInfoScreen(viewModel: GalwayBusViewModel,
2828
popBack: () -> Unit, onBusSelected: (String) -> Unit) {
2929
val busInfoList by viewModel.busInfoList.collectAsState(emptyList())
30-
val routeId = viewModel.routeId.value
30+
val routeId by viewModel.routeId.collectAsState()
3131
val currentBusStop = viewModel.currentBusStop.collectAsState()
3232
val coroutineScope = rememberCoroutineScope()
3333

@@ -88,6 +88,10 @@ fun BusInfoMapViewContainer(stop: BusStop, busInfoList: List<Bus>, onBusSelected
8888
}
8989

9090

91+
LaunchedEffect(busInfoList) {
92+
println(busInfoList.map { it.vehicle_id })
93+
}
94+
9195
val mapProperties by remember { mutableStateOf(MapProperties(isMyLocationEnabled = true)) }
9296
val uiSettings by remember { mutableStateOf(MapUiSettings(myLocationButtonEnabled = true)) }
9397
GoogleMap(
@@ -127,14 +131,15 @@ fun BusInfoMapViewContainer(stop: BusStop, busInfoList: List<Bus>, onBusSelected
127131
R.plurals.mins,
128132
delayMins
129133
)
130-
}"
134+
}, (${bus.vehicle_id})"
131135
} else {
132136
""
133137
}
134138

135139
val icon = bitmapDescriptorFromVector(context, R.drawable.bus_side, tintColor)
136140
MarkerInfoWindowContent(
137-
state = MarkerState(position = busLocation), title = title,
141+
state = MarkerState(position = busLocation),
142+
title = title,
138143
snippet = snippet, icon = icon, tag = bus,
139144
onInfoWindowClick = {
140145
onBusSelected(bus.vehicle_id)

android-app/src/main/java/dev/johnoreilly/galwaybus/ui/screens/NearbyBusStopsScreen.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ data class BusStopPositionClusterItem(
229229
override fun getPosition(): LatLng = itemPosition
230230
override fun getTitle(): String = itemTitle
231231
override fun getSnippet(): String = itemSnippet
232+
override fun getZIndex(): Float? {
233+
return null
234+
}
232235
}
233236

234237
@Composable

android-app/src/main/java/dev/johnoreilly/galwaybus/ui/viewmodel/GalwayBusViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ class GalwayBusViewModel(
114114
}
115115
}
116116

117-
fun pollBusInfoForRoute(routeId: String): Flow<List<Bus>> = flow {
117+
private fun pollBusInfoForRoute(routeId: String): Flow<List<Bus>> = flow {
118118
if (routeId.isNotEmpty()) {
119119
emit(emptyList())
120120
while (true) {
121121
val result = repository.fetchBusListForRoute(routeId)
122122
if (result is Result.Success) {
123123
Logger.d { result.data.toString() }
124-
emit(result.data)
124+
emit(result.data.sortedBy { it.vehicle_id })
125125
}
126126
delay(POLL_INTERVAL)
127127
}

fastlane/Fastfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ default_platform :android
1717

1818
platform :android do
1919

20-
versionNum = 85
21-
20+
versionNum = 86
2221

2322
before_all do
2423
end

gradle/libs.versions.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jbComposeCompiler = "1.5.4"
2323
androidxComposeBom = "2024.06.00"
2424
androidxNavigationCompose = "2.7.7"
2525
uiToolingPreview = "1.6.8"
26-
wearCompose = "1.3.1"
2726
androidxLifecycle = "2.8.2"
2827
imageLoader = "1.7.8"
2928
osmdroidAndroid = "6.1.18"
29+
googleMapsCompose = "5.0.3"
3030

3131
composeMultiplatform = "1.6.11"
3232
accompanist = "0.32.0"
@@ -44,9 +44,7 @@ multiplatformSettings = "1.1.1"
4444
kermit = "2.0.3"
4545

4646
minSdk = "24"
47-
minWearSdk = "26"
4847
targetSdk = "34"
49-
targetWearSdk = "33"
5048
compileSdk = "34"
5149
coreKtx = "1.13.1"
5250
espressoCore = "3.5.1"
@@ -66,7 +64,6 @@ kotlinx-serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-seria
6664

6765
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "uiToolingPreview" }
6866
androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "uiToolingPreview" }
69-
wear-ui-tooling = { module = "androidx.wear.compose:compose-ui-tooling", version.ref = "composeUiTooling" }
7067

7168
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivity" }
7269
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" }
@@ -79,7 +76,7 @@ androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
7976
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
8077
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
8178
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
82-
androidx-compose-material3-WindowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class" }
79+
androidx-compose-material3-windowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class" }
8380
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigationCompose" }
8481
androidx-lifecycle-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidxLifecycle" }
8582
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidxLifecycle" }
@@ -91,10 +88,8 @@ metrics = "androidx.metrics:metrics-performance:1.0.0-beta01"
9188

9289
imageLoader = { module = "io.github.qdsfdhvh:image-loader", version.ref = "imageLoader" }
9390
osmdroidAndroid = { module = "org.osmdroid:osmdroid-android", version.ref = "osmdroidAndroid" }
94-
95-
wear-compose-founndation = { module = "androidx.wear.compose:compose-foundation", version.ref = "wearCompose" }
96-
wear-compose-material = { module = "androidx.wear.compose:compose-material", version.ref = "wearCompose" }
97-
wear-compose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "wearCompose" }
91+
googleMapsCompose = { module = "com.google.maps.android:maps-compose", version.ref = "googleMapsCompose" }
92+
googleMapsComposeUtils = { module = "com.google.maps.android:maps-compose-utils", version.ref = "googleMapsCompose" }
9893

9994
coilCompose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coilCompose" }
10095
accompanist-swiperefresh = { group = "com.google.accompanist", name = "accompanist-swiperefresh", version.ref = "accompanist" }

0 commit comments

Comments
 (0)