Skip to content

Commit

Permalink
map related updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joreilly committed Jun 23, 2024
1 parent e34ca0b commit e1b7b8f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions android-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ dependencies {
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.compose.material3.windowSizeClass)

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

implementation(libs.accompanist.swiperefresh)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import kotlinx.coroutines.launch
fun BusInfoScreen(viewModel: GalwayBusViewModel,
popBack: () -> Unit, onBusSelected: (String) -> Unit) {
val busInfoList by viewModel.busInfoList.collectAsState(emptyList())
val routeId = viewModel.routeId.value
val routeId by viewModel.routeId.collectAsState()
val currentBusStop = viewModel.currentBusStop.collectAsState()
val coroutineScope = rememberCoroutineScope()

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


LaunchedEffect(busInfoList) {
println(busInfoList.map { it.vehicle_id })
}

val mapProperties by remember { mutableStateOf(MapProperties(isMyLocationEnabled = true)) }
val uiSettings by remember { mutableStateOf(MapUiSettings(myLocationButtonEnabled = true)) }
GoogleMap(
Expand Down Expand Up @@ -127,14 +131,15 @@ fun BusInfoMapViewContainer(stop: BusStop, busInfoList: List<Bus>, onBusSelected
R.plurals.mins,
delayMins
)
}"
}, (${bus.vehicle_id})"
} else {
""
}

val icon = bitmapDescriptorFromVector(context, R.drawable.bus_side, tintColor)
MarkerInfoWindowContent(
state = MarkerState(position = busLocation), title = title,
state = MarkerState(position = busLocation),
title = title,
snippet = snippet, icon = icon, tag = bus,
onInfoWindowClick = {
onBusSelected(bus.vehicle_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ data class BusStopPositionClusterItem(
override fun getPosition(): LatLng = itemPosition
override fun getTitle(): String = itemTitle
override fun getSnippet(): String = itemSnippet
override fun getZIndex(): Float? {
return null
}
}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ class GalwayBusViewModel(
}
}

fun pollBusInfoForRoute(routeId: String): Flow<List<Bus>> = flow {
private fun pollBusInfoForRoute(routeId: String): Flow<List<Bus>> = flow {
if (routeId.isNotEmpty()) {
emit(emptyList())
while (true) {
val result = repository.fetchBusListForRoute(routeId)
if (result is Result.Success) {
Logger.d { result.data.toString() }
emit(result.data)
emit(result.data.sortedBy { it.vehicle_id })
}
delay(POLL_INTERVAL)
}
Expand Down
3 changes: 1 addition & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ default_platform :android

platform :android do

versionNum = 85

versionNum = 86

before_all do
end
Expand Down
13 changes: 4 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jbComposeCompiler = "1.5.4"
androidxComposeBom = "2024.06.00"
androidxNavigationCompose = "2.7.7"
uiToolingPreview = "1.6.8"
wearCompose = "1.3.1"
androidxLifecycle = "2.8.2"
imageLoader = "1.7.8"
osmdroidAndroid = "6.1.18"
googleMapsCompose = "5.0.3"

composeMultiplatform = "1.6.11"
accompanist = "0.32.0"
Expand All @@ -44,9 +44,7 @@ multiplatformSettings = "1.1.1"
kermit = "2.0.3"

minSdk = "24"
minWearSdk = "26"
targetSdk = "34"
targetWearSdk = "33"
compileSdk = "34"
coreKtx = "1.13.1"
espressoCore = "3.5.1"
Expand All @@ -66,7 +64,6 @@ kotlinx-serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-seria

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

androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivity" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" }
Expand All @@ -79,7 +76,7 @@ androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-compose-material3-WindowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class" }
androidx-compose-material3-windowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigationCompose" }
androidx-lifecycle-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidxLifecycle" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidxLifecycle" }
Expand All @@ -91,10 +88,8 @@ metrics = "androidx.metrics:metrics-performance:1.0.0-beta01"

imageLoader = { module = "io.github.qdsfdhvh:image-loader", version.ref = "imageLoader" }
osmdroidAndroid = { module = "org.osmdroid:osmdroid-android", version.ref = "osmdroidAndroid" }

wear-compose-founndation = { module = "androidx.wear.compose:compose-foundation", version.ref = "wearCompose" }
wear-compose-material = { module = "androidx.wear.compose:compose-material", version.ref = "wearCompose" }
wear-compose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "wearCompose" }
googleMapsCompose = { module = "com.google.maps.android:maps-compose", version.ref = "googleMapsCompose" }
googleMapsComposeUtils = { module = "com.google.maps.android:maps-compose-utils", version.ref = "googleMapsCompose" }

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

0 comments on commit e1b7b8f

Please sign in to comment.