Skip to content

Commit

Permalink
Merge pull request #187 from stadiamaps/feat/android/proguard-plus-fixes
Browse files Browse the repository at this point in the history
Added proguard rules and minor fixes
  • Loading branch information
ianthetechie authored Aug 20, 2024
2 parents ec418f9 + 85dd610 commit a79daf4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
11 changes: 10 additions & 1 deletion android/core/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Ferrostar & JNA
# TODO: This needs validation from a publishing app. Ticket https://github.com/stadiamaps/ferrostar/issues/185
-keep class com.sun.jna.** { *; }
-keep class uniffi.ferrostar.** { *; }
-dontwarn java.awt.Component
-dontwarn java.awt.GraphicsEnvironment
-dontwarn java.awt.HeadlessException
-dontwarn java.awt.Window
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ fun BorderedPolyline(
zIndex: Int = 1,
color: String = "#3583dd",
borderColor: String = "#ffffff",
lineWidth: Float = 6f,
borderWidth: Float = 2f,
lineWidth: Float = 10f,
borderWidth: Float = 3f
) {
Polyline(
points = points,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.maplibre.compose.settings.MapControls
import com.stadiamaps.ferrostar.core.NavigationUiState
import com.stadiamaps.ferrostar.core.NavigationViewModel
import com.stadiamaps.ferrostar.core.toAndroidLocation
import com.stadiamaps.ferrostar.maplibreui.extensions.NavigationCentered
import com.stadiamaps.ferrostar.maplibreui.extensions.AutomotiveNavigationCentered
import com.stadiamaps.ferrostar.maplibreui.extensions.NavigationDefault

/**
Expand All @@ -42,7 +42,9 @@ fun NavigationMapView(
viewModel: NavigationViewModel,
locationRequestProperties: LocationRequestProperties =
LocationRequestProperties.NavigationDefault(),
onMapReadyCallback: (Style) -> Unit = { camera.value = MapViewCamera.NavigationCentered() },
onMapReadyCallback: (Style) -> Unit = {
camera.value = MapViewCamera.AutomotiveNavigationCentered()
},
content: @Composable @MapLibreComposable() ((State<NavigationUiState>) -> Unit)? = null
) {
val uiState = viewModel.uiState.collectAsState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package com.stadiamaps.ferrostar.maplibreui.extensions
import com.maplibre.compose.camera.MapViewCamera

/**
* The centered camera configuration for navigation. This configuration sets the camera to track the
* user, with a bearing of 18 degrees and a pitch of 45 degrees.
* The centered camera configuration for automotive navigation.
*
* This configuration sets the camera to track the user, with a zoom of 16 degrees and a pitch of 45
* degrees.
*
* @return The navigation MapViewCamera
*/
fun MapViewCamera.Companion.NavigationCentered(): MapViewCamera {
return MapViewCamera.TrackingUserLocationWithBearing(zoom = 18.0, pitch = 45.0)
fun MapViewCamera.Companion.AutomotiveNavigationCentered(): MapViewCamera {
return MapViewCamera.TrackingUserLocationWithBearing(zoom = 16.0, pitch = 45.0)
}

0 comments on commit a79daf4

Please sign in to comment.