Duration Map
This commit is contained in:
@@ -17,8 +17,8 @@ android {
|
||||
applicationId = "com.kouros.navigation"
|
||||
minSdk = 33
|
||||
targetSdk = 36
|
||||
versionCode = 83
|
||||
versionName = "0.2.0.83"
|
||||
versionCode = 84
|
||||
versionName = "0.2.0.84"
|
||||
base.archivesName = "navi-$versionName"
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ import com.google.android.gms.location.LocationServices
|
||||
import com.kouros.data.R
|
||||
import com.kouros.navigation.MainApplication.Companion.navigationViewModel
|
||||
import com.kouros.navigation.car.TextToSpeechManager
|
||||
import com.kouros.navigation.car.navigation.NavigationService
|
||||
import com.kouros.navigation.data.Constants.DESTINATION_ARRIVAL_DISTANCE
|
||||
import com.kouros.navigation.data.Constants.INSTRUCTION_DISTANCE
|
||||
import com.kouros.navigation.data.Constants.TAG
|
||||
@@ -80,8 +79,6 @@ import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
|
||||
var navigationService: NavigationService? = null
|
||||
|
||||
var isBound: Boolean = false
|
||||
val routeData = MutableLiveData("")
|
||||
val routeModel = RouteModel()
|
||||
@@ -102,20 +99,6 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
// Monitors the state of the connection to the navigation service.
|
||||
private val serviceConnection: ServiceConnection = object : ServiceConnection {
|
||||
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
|
||||
val binder: NavigationService.LocalBinder = service as NavigationService.LocalBinder
|
||||
navigationService = binder.service
|
||||
isBound = true
|
||||
}
|
||||
|
||||
override fun onServiceDisconnected(name: ComponentName?) {
|
||||
navigationService = null
|
||||
isBound = false
|
||||
}
|
||||
}
|
||||
|
||||
val cameraPosition = MutableLiveData(
|
||||
CameraPosition(
|
||||
zoom = 15.0, target = Position(latitude = 48.1857475, longitude = 11.5793627)
|
||||
@@ -168,27 +151,6 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
Log.i(TAG, "In onStart()")
|
||||
bindService(
|
||||
Intent(this, NavigationService::class.java),
|
||||
serviceConnection,
|
||||
BIND_AUTO_CREATE
|
||||
)
|
||||
requestPermissions(arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), 1)
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
Log.i(TAG, "In onStop(). bound $isBound")
|
||||
if (isBound) {
|
||||
unbindService(serviceConnection)
|
||||
isBound = false
|
||||
navigationService = null
|
||||
}
|
||||
super.onStop()
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun StartScreen(
|
||||
@@ -356,7 +318,6 @@ class MainActivity : ComponentActivity() {
|
||||
routeModel.navState = routeModel.navState.copy(routingEngine = routingEngine)
|
||||
routeModel.startNavigation(newRoute)
|
||||
routeData.value = routeModel.curRoute.routeGeoJson
|
||||
navigationService?.startNavigation()
|
||||
}
|
||||
fun stopNavigation(closeSheet: () -> Unit) {
|
||||
closeSheet()
|
||||
@@ -364,7 +325,6 @@ class MainActivity : ComponentActivity() {
|
||||
getSettingsViewModel(applicationContext).onLastRouteChanged("")
|
||||
routeData.value = ""
|
||||
stepData.value = StepData("", "", 0.0, 0, 0, 0, 0.0)
|
||||
navigationService?.stopNavigation()
|
||||
}
|
||||
|
||||
fun textToSpeech() {
|
||||
|
||||
Reference in New Issue
Block a user