Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added proguard rules and minor fixes #187

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
Loading