@@ -3,6 +3,7 @@ package org.prauga.compass.screens
33import android.Manifest
44import androidx.activity.compose.rememberLauncherForActivityResult
55import androidx.activity.result.contract.ActivityResultContracts
6+ import org.prauga.compass.BuildConfig
67import androidx.compose.animation.core.LinearOutSlowInEasing
78import androidx.compose.animation.core.animateFloatAsState
89import androidx.compose.animation.core.tween
@@ -43,6 +44,7 @@ fun CompassScreen(viewModel: CompassViewModel) {
4344 val latitude by viewModel.latitude.collectAsState()
4445 val longitude by viewModel.longitude.collectAsState()
4546 val placeName by viewModel.placeName.collectAsState()
47+ val showLocationInfo = BuildConfig .SHOW_LOCATION_INFO
4648 val animatedHeading by animateFloatAsState(
4749 targetValue = cumulativeHeading,
4850 animationSpec = tween(durationMillis = 300 , easing = LinearOutSlowInEasing )
@@ -70,7 +72,9 @@ fun CompassScreen(viewModel: CompassViewModel) {
7072
7173 LaunchedEffect (Unit ) {
7274 viewModel.start()
73- permissionLauncher.launch(Manifest .permission.ACCESS_FINE_LOCATION )
75+ if (showLocationInfo) {
76+ permissionLauncher.launch(Manifest .permission.ACCESS_FINE_LOCATION )
77+ }
7478 }
7579 DisposableEffect (Unit ) {
7680 onDispose { viewModel.stop() }
@@ -98,7 +102,7 @@ fun CompassScreen(viewModel: CompassViewModel) {
98102 fontWeight = FontWeight .Bold ,
99103 textAlign = TextAlign .Center
100104 )
101- if (locationGranted) {
105+ if (showLocationInfo && locationGranted) {
102106 // Coordinates in DMS
103107 val lat = latitude
104108 val lng = longitude
0 commit comments