Automotive
@@ -32,14 +32,8 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="androidx.car.app.ACCESS_SURFACE" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
|
||||
<application android:requestLegacyExternalStorage="true">
|
||||
<!--
|
||||
Since this app does not use any features from beyond API level 1, it makes the most sense
|
||||
to use that as the `minCarApiLevel`. Even if it did use features from higher API levels,
|
||||
it could still use this value as long as those features are only used behind a runtime check
|
||||
-->
|
||||
<meta-data
|
||||
android:name="androidx.car.app.minCarApiLevel"
|
||||
android:value="1" />
|
||||
|
||||
BIN
common/car/src/main/ic_delete-playstore.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
@@ -18,6 +18,7 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.drawText
|
||||
@@ -115,12 +116,15 @@ fun BuildingLayer(tiles: Source) {
|
||||
|
||||
@Composable
|
||||
fun DrawImage(padding: PaddingValues, location: Location, width: Int, height: Int, street: String) {
|
||||
NavigationImage(padding, street)
|
||||
NavigationImage(padding, width,height, street)
|
||||
Speed(width, height, location)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun NavigationImage(padding: PaddingValues, street: String) {
|
||||
fun NavigationImage(padding: PaddingValues, width: Int, height: Int, street: String) {
|
||||
|
||||
val imageSize = (height/6)
|
||||
println("Image Size: $imageSize")
|
||||
val vector = ImageVector.vectorResource(id = R.drawable.assistant_navigation_48px)
|
||||
val color = remember { NavigationColor }
|
||||
BadgedBox(
|
||||
@@ -131,11 +135,18 @@ fun NavigationImage(padding: PaddingValues, street: String) {
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
modifier = Modifier.size(72.dp, 72.dp),
|
||||
imageVector = vector,
|
||||
contentDescription = "Navigation",
|
||||
tint = color
|
||||
painter = painterResource(id = R.drawable.navigation),
|
||||
"Navigation",
|
||||
tint = color,
|
||||
modifier = Modifier.size(imageSize.dp, imageSize.dp),
|
||||
)
|
||||
|
||||
// Icon(
|
||||
// modifier = Modifier.size(72.dp, 72.dp),
|
||||
// imageVector = vector,
|
||||
// contentDescription = "Navigation",
|
||||
// tint = color
|
||||
// )
|
||||
if (street.isNotEmpty())
|
||||
Text(text = street)
|
||||
}
|
||||
@@ -209,13 +220,12 @@ fun getPaddingValues(width: Int, height: Int, preView: Boolean): PaddingValues {
|
||||
return if (preView) {
|
||||
PaddingValues(start = 150.dp, bottom = 0.dp)
|
||||
} else {
|
||||
// PaddingValues(start = width.dp, top = distanceFromTop(height).dp)
|
||||
PaddingValues(start = 0.dp, top = distanceFromTop(height).dp)
|
||||
PaddingValues(start = 50.dp, top = distanceFromTop(height).dp)
|
||||
}
|
||||
}
|
||||
|
||||
fun distanceFromTop(height: Int): Int {
|
||||
return height - percent(height, 25)
|
||||
return height - percent(height, 40)
|
||||
}
|
||||
|
||||
fun percent(maxValue: Int, value: Int): Int {
|
||||
|
||||
@@ -25,12 +25,12 @@ import com.kouros.navigation.car.screen.SearchScreen
|
||||
import com.kouros.navigation.data.Constants.MAXIMAL_ROUTE_DEVIATION
|
||||
import com.kouros.navigation.data.Constants.MAXIMAL_SNAP_CORRECTION
|
||||
import com.kouros.navigation.data.Constants.TAG
|
||||
import com.kouros.navigation.data.ObjectBox
|
||||
import com.kouros.navigation.utils.NavigationUtils.snapLocation
|
||||
|
||||
class NavigationSession : Session(), NavigationScreen.Listener {
|
||||
val uriScheme = "samples";
|
||||
|
||||
val uriHost = "navigation";
|
||||
val useContacts = false
|
||||
|
||||
lateinit var routeModel: RouteCarModel;
|
||||
|
||||
@@ -81,9 +81,9 @@ class NavigationSession : Session(), NavigationScreen.Listener {
|
||||
navigationScreen = NavigationScreen(carContext, surfaceRenderer, routeModel, this)
|
||||
|
||||
if (carContext.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
== PackageManager.PERMISSION_GRANTED
|
||||
&& carContext.checkSelfPermission(Manifest.permission.READ_CONTACTS)
|
||||
== PackageManager.PERMISSION_GRANTED
|
||||
== PackageManager.PERMISSION_GRANTED && !useContacts
|
||||
|| (useContacts && carContext.checkSelfPermission(Manifest.permission.READ_CONTACTS)
|
||||
== PackageManager.PERMISSION_GRANTED)
|
||||
) {
|
||||
requestLocationUpdates()
|
||||
} else {
|
||||
@@ -166,8 +166,7 @@ class NavigationSession : Session(), NavigationScreen.Listener {
|
||||
navigationScreen.calculateNewRoute(routeModel.destination)
|
||||
return
|
||||
}
|
||||
routeModel.updateLocation(location)
|
||||
navigationScreen.updateTrip()
|
||||
navigationScreen.updateTrip(location)
|
||||
if (distance < MAXIMAL_SNAP_CORRECTION) {
|
||||
surfaceRenderer.updateLocation(snapedLocation)
|
||||
} else {
|
||||
@@ -181,4 +180,10 @@ class NavigationSession : Session(), NavigationScreen.Listener {
|
||||
override fun stopNavigation() {
|
||||
routeModel.stopNavigation()
|
||||
}
|
||||
|
||||
companion object {
|
||||
var uriHost: String = "navigation"
|
||||
|
||||
var uriScheme: String = "samples"
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import androidx.car.app.AppManager
|
||||
import androidx.car.app.CarContext
|
||||
import androidx.car.app.SurfaceCallback
|
||||
import androidx.car.app.SurfaceContainer
|
||||
import androidx.car.app.connection.CarConnection
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -27,8 +28,10 @@ import androidx.savedstate.setViewTreeSavedStateRegistryOwner
|
||||
import com.kouros.navigation.car.navigation.RouteCarModel
|
||||
import com.kouros.navigation.data.Constants
|
||||
import com.kouros.navigation.data.Constants.SHOW_THREED_BUILDING
|
||||
import com.kouros.navigation.data.ObjectBox
|
||||
import com.kouros.navigation.model.RouteModel
|
||||
import com.kouros.navigation.utils.NavigationUtils.getBooleanKeyValue
|
||||
import com.kouros.navigation.utils.bearing
|
||||
import com.kouros.navigation.utils.calculateZoom
|
||||
import org.maplibre.compose.camera.CameraPosition
|
||||
import org.maplibre.compose.camera.CameraState
|
||||
@@ -160,17 +163,22 @@ class SurfaceRenderer(
|
||||
lifecycle.addObserver(this)
|
||||
}
|
||||
|
||||
fun onConnectionStateUpdated(connectionState: Int) {
|
||||
when(connectionState) {
|
||||
CarConnection.CONNECTION_TYPE_NATIVE -> ObjectBox.init(carContext)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun MapView() {
|
||||
val stateWidth = visibleArea.observeAsState()
|
||||
val position: CameraPosition? by cameraPosition.observeAsState()
|
||||
val route: String? by routeData.observeAsState()
|
||||
val previewRoute: String? by previewRouteData.observeAsState()
|
||||
val paddingValues = getPaddingValues( width - stateWidth.value!!.width(), height, preview)
|
||||
val paddingValues = getPaddingValues(width - stateWidth.value!!.width(), height, preview)
|
||||
val cameraState = cameraState(paddingValues, position, tilt)
|
||||
|
||||
val baseStyle = BaseStyle.Uri(Constants.STYLE)
|
||||
if (isSystemInDarkTheme()) BaseStyle.Uri(Constants.STYLE_DARK) else BaseStyle.Uri(
|
||||
val baseStyle =if (isSystemInDarkTheme()) BaseStyle.Uri(Constants.STYLE_DARK) else BaseStyle.Uri(
|
||||
Constants.STYLE
|
||||
)
|
||||
MaplibreMap(
|
||||
@@ -189,7 +197,11 @@ class SurfaceRenderer(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ShowPosition(cameraState: CameraState, position: CameraPosition?, paddingValues: PaddingValues) {
|
||||
fun ShowPosition(
|
||||
cameraState: CameraState,
|
||||
position: CameraPosition?,
|
||||
paddingValues: PaddingValues
|
||||
) {
|
||||
val cameraDuration = duration(position)
|
||||
var bearing = position!!.bearing
|
||||
var zoom = position.zoom
|
||||
@@ -197,9 +209,9 @@ class SurfaceRenderer(
|
||||
var localTilt = tilt
|
||||
if (!preview) {
|
||||
if (routeModel.isNavigating()) {
|
||||
DrawImage(paddingValues, lastLocation, width, height,"")
|
||||
DrawImage(paddingValues, lastLocation, width, height, "")
|
||||
} else {
|
||||
DrawImage(paddingValues, lastLocation,width, height, "")
|
||||
DrawImage(paddingValues, lastLocation, width, height, "")
|
||||
}
|
||||
} else {
|
||||
bearing = 0.0
|
||||
@@ -222,6 +234,7 @@ class SurfaceRenderer(
|
||||
}
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
CarConnection(carContext).type.observe(owner, ::onConnectionStateUpdated)
|
||||
Log.i(TAG, "SurfaceRenderer created")
|
||||
carContext.getCarService(AppManager::class.java)
|
||||
.setSurfaceCallback(mSurfaceCallback)
|
||||
@@ -260,11 +273,7 @@ class SurfaceRenderer(
|
||||
fun updateLocation(location: Location) {
|
||||
synchronized(this) {
|
||||
if (!preview) {
|
||||
val bearing = if (routeModel.isNavigating()) {
|
||||
routeModel.currentStep().bearing
|
||||
} else {
|
||||
lastLocation.bearingTo(location).toInt().toDouble().absoluteValue
|
||||
}
|
||||
val bearing = bearing(lastLocation, location)
|
||||
val zoom = if (!panView) {
|
||||
calculateZoom(location.speed.toDouble())
|
||||
} else {
|
||||
@@ -278,10 +287,9 @@ class SurfaceRenderer(
|
||||
lastBearing = cameraPosition.value!!.bearing
|
||||
lastLocation = location
|
||||
} else {
|
||||
val bearing = 0.0
|
||||
val zoom = previewZoom()
|
||||
updateCameraPosition(
|
||||
bearing,
|
||||
0.0,
|
||||
zoom,
|
||||
Position(centerLocation.longitude, centerLocation.latitude)
|
||||
)
|
||||
@@ -295,7 +303,7 @@ class SurfaceRenderer(
|
||||
bearing = bearing,
|
||||
zoom = zoom,
|
||||
tilt = 0.0,
|
||||
padding = getPaddingValues(width-visibleArea.value!!.width(), height, preview),
|
||||
padding = getPaddingValues(width - visibleArea.value!!.width(), height, preview),
|
||||
target = target
|
||||
)
|
||||
)
|
||||
|
||||
@@ -209,8 +209,8 @@ class RouteCarModel() : RouteModel() {
|
||||
)
|
||||
.setRemainingTimeColor(CarColor.YELLOW)
|
||||
.setRemainingDistanceColor(CarColor.RED)
|
||||
//.setTripText(createCarText(carContext,R.string.travel_est_trip_text))
|
||||
.setTripIcon(createCarIcon(carContext, R.drawable.ic_close_white_24dp))
|
||||
//.setTripText(createCarText(carContext,R.string.navigate))
|
||||
//.setTripIcon(createCarIcon(carContext, R.drawable.navigation_48px))
|
||||
.build()
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import androidx.lifecycle.Observer
|
||||
import com.kouros.android.cars.carappservice.R
|
||||
import com.kouros.navigation.car.NavigationCarAppService
|
||||
import com.kouros.navigation.car.SurfaceRenderer
|
||||
import com.kouros.navigation.car.navigation.NavigationMessage
|
||||
import com.kouros.navigation.car.navigation.RouteCarModel
|
||||
import com.kouros.navigation.data.NavigationRepository
|
||||
import com.kouros.navigation.data.Place
|
||||
@@ -288,7 +287,7 @@ class NavigationScreen(
|
||||
.build()
|
||||
)
|
||||
.setOnClickListener {
|
||||
val navigateTo = location(recentPlace.latitude, recentPlace.longitude)
|
||||
val navigateTo = location(recentPlace.longitude, recentPlace.latitude)
|
||||
viewModel.loadRoute(carContext, surfaceRenderer.lastLocation, navigateTo)
|
||||
routeModel.destination = recentPlace
|
||||
}
|
||||
@@ -443,11 +442,12 @@ class NavigationScreen(
|
||||
}
|
||||
|
||||
fun reRoute(destination: Place) {
|
||||
val dest = location(destination.latitude, destination.longitude)
|
||||
val dest = location( destination.longitude, destination.latitude)
|
||||
viewModel.loadRoute(carContext, surfaceRenderer.lastLocation, dest)
|
||||
}
|
||||
|
||||
fun updateTrip() {
|
||||
fun updateTrip(location: Location) {
|
||||
routeModel.updateLocation(location)
|
||||
if (routeModel.maneuverType == Maneuver.TYPE_DESTINATION && routeModel.leftStepDistance() * 1000 < 25.0) {
|
||||
routeModel.arrived = true
|
||||
routeModel.stopNavigation()
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.kouros.navigation.model.ViewModel
|
||||
class PlaceListScreen(
|
||||
private val carContext: CarContext,
|
||||
private val surfaceRenderer: SurfaceRenderer,
|
||||
location: Location,
|
||||
private val location: Location,
|
||||
private val category: String
|
||||
) : Screen(carContext) {
|
||||
|
||||
@@ -45,6 +45,7 @@ class PlaceListScreen(
|
||||
places = newPlaces
|
||||
invalidate()
|
||||
}
|
||||
|
||||
val observerAddress = Observer<List<Place>> { newContacts ->
|
||||
places = newContacts
|
||||
invalidate()
|
||||
@@ -53,17 +54,30 @@ class PlaceListScreen(
|
||||
init {
|
||||
if (category == Constants.RECENT) {
|
||||
viewModel.places.observe(this, observer)
|
||||
viewModel.loadPlaces(carContext, location)
|
||||
}
|
||||
if (category == Constants.CONTACTS) {
|
||||
viewModel.contactAddress.observe(this, observerAddress)
|
||||
viewModel.loadContacts(carContext, location)
|
||||
}
|
||||
if (category == Constants.FAVORITES) {
|
||||
viewModel.favorites.observe(this, observer)
|
||||
}
|
||||
loadPlaces()
|
||||
}
|
||||
|
||||
fun loadPlaces() {
|
||||
if (category == Constants.RECENT) {
|
||||
viewModel.loadPlaces(carContext, location)
|
||||
}
|
||||
if (category == Constants.CONTACTS) {
|
||||
viewModel.loadContacts(carContext, location)
|
||||
}
|
||||
if (category == Constants.FAVORITES) {
|
||||
viewModel.loadFavorites(carContext, location)
|
||||
}
|
||||
}
|
||||
override fun onGetTemplate(): Template {
|
||||
val itemListBuilder = ItemList.Builder()
|
||||
.setNoItemsMessage("No places to show")
|
||||
.setNoItemsMessage(carContext.getString(R.string.no_places))
|
||||
places.forEach {
|
||||
itemListBuilder.addItem(
|
||||
Row.Builder()
|
||||
@@ -111,10 +125,11 @@ class PlaceListScreen(
|
||||
.build()
|
||||
)
|
||||
}
|
||||
val title = if (category == Constants.RECENT) {
|
||||
carContext.getString(R.string.recent_destinations)
|
||||
} else {
|
||||
carContext.getString(R.string.contacts)
|
||||
var title = ""
|
||||
when(category) {
|
||||
Constants.RECENT -> title = carContext.getString(R.string.recent_destinations)
|
||||
Constants.CONTACTS -> title = carContext.getString(R.string.contacts)
|
||||
Constants.FAVORITES -> title = carContext.getString(R.string.favorites)
|
||||
}
|
||||
val header = Header.Builder()
|
||||
.setStartHeaderAction(Action.BACK)
|
||||
@@ -131,16 +146,16 @@ class PlaceListScreen(
|
||||
.setIcon(
|
||||
RouteCarModel().createCarIcon(
|
||||
carContext,
|
||||
R.drawable.ic_close_white_24dp
|
||||
R.drawable.ic_delete_foreground
|
||||
)
|
||||
)
|
||||
.setOnClickListener {
|
||||
viewModel.deleteRecent(place)
|
||||
viewModel.deletePlace(place)
|
||||
CarToast.makeText(
|
||||
carContext,
|
||||
R.string.recent_Item_deleted, CarToast.LENGTH_LONG
|
||||
).show()
|
||||
invalidate()
|
||||
loadPlaces()
|
||||
}
|
||||
.build()
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.kouros.navigation.car.screen
|
||||
|
||||
import android.graphics.drawable.Icon
|
||||
import android.location.Location
|
||||
import android.location.LocationManager
|
||||
import android.os.CountDownTimer
|
||||
@@ -77,11 +78,10 @@ class RoutePreviewScreen(
|
||||
val location = Location(LocationManager.GPS_PROVIDER)
|
||||
location.latitude = destination.latitude
|
||||
location.longitude = destination.longitude
|
||||
vieModel.loadPreviewRoute(carContext,surfaceRenderer.lastLocation, location)
|
||||
vieModel.loadPreviewRoute(carContext, surfaceRenderer.lastLocation, location)
|
||||
}
|
||||
|
||||
override fun onGetTemplate(): Template {
|
||||
// Adjust the item limit according to the car constrains.
|
||||
mItemLimit =
|
||||
carContext.getCarService(ConstraintManager::class.java)
|
||||
.getContentLimit(
|
||||
@@ -127,7 +127,7 @@ class RoutePreviewScreen(
|
||||
carContext,
|
||||
if (mIsFavorite)
|
||||
carContext
|
||||
.getString(R.string.favorite_toast_msg)
|
||||
.getString(R.string.favorites)
|
||||
else
|
||||
carContext.getString(
|
||||
R.string.not_favorite_toast_msg
|
||||
@@ -135,18 +135,26 @@ class RoutePreviewScreen(
|
||||
CarToast.LENGTH_SHORT
|
||||
)
|
||||
.show()
|
||||
vieModel.saveFavorite(destination)
|
||||
println(destination)
|
||||
invalidate()
|
||||
}
|
||||
.build()
|
||||
)
|
||||
.addEndHeaderAction(
|
||||
Action.Builder()
|
||||
.setOnClickListener { finish() }
|
||||
.setOnClickListener {
|
||||
if (mIsFavorite) {
|
||||
vieModel.deleteFavorite(destination)
|
||||
}
|
||||
mIsFavorite = !mIsFavorite
|
||||
finish()
|
||||
}
|
||||
.setIcon(
|
||||
CarIcon.Builder(
|
||||
IconCompat.createWithResource(
|
||||
carContext,
|
||||
R.drawable.ic_close_white_24dp
|
||||
R.drawable.ic_delete_foreground
|
||||
)
|
||||
)
|
||||
.build()
|
||||
@@ -155,7 +163,7 @@ class RoutePreviewScreen(
|
||||
)
|
||||
.build()
|
||||
|
||||
val timer = object: CountDownTimer(10000, 15000) {
|
||||
val timer = object : CountDownTimer(10000, 15000) {
|
||||
override fun onTick(millisUntilFinished: Long) {}
|
||||
override fun onFinish() {
|
||||
onNavigate()
|
||||
@@ -183,7 +191,7 @@ class RoutePreviewScreen(
|
||||
return Row.Builder()
|
||||
.setTitle(route)
|
||||
.setOnClickListener { onRouteSelected(index) }
|
||||
.addText( "${destination.street!!} ${destination.postalCode} ${destination.city}")
|
||||
.addText("${destination.street!!} ${destination.postalCode} ${destination.city}")
|
||||
.addAction(action)
|
||||
.build()
|
||||
}
|
||||
@@ -194,7 +202,7 @@ class RoutePreviewScreen(
|
||||
val length = BigDecimal(routeModel.route.distance).setScale(1, RoundingMode.HALF_EVEN)
|
||||
val firstRoute = SpannableString(" \u00b7 $length km")
|
||||
firstRoute.setSpan(
|
||||
DurationSpan.create(time.toLong()), 0, 1,0
|
||||
DurationSpan.create(time.toLong()), 0, 1, 0
|
||||
)
|
||||
return CarText.Builder(firstRoute)
|
||||
.build()
|
||||
|
||||
@@ -31,7 +31,8 @@ class SearchScreen(
|
||||
|
||||
var categories: List<Category> = listOf(
|
||||
Category(id = Constants.RECENT, name = carContext.getString(R.string.recent_destinations)),
|
||||
Category(id = Constants.CONTACTS, name = carContext.getString(R.string.contacts))
|
||||
Category(id = Constants.CONTACTS, name = carContext.getString(R.string.contacts)),
|
||||
Category(id = Constants.FAVORITES, name = carContext.getString(R.string.favorites))
|
||||
)
|
||||
|
||||
lateinit var searchResult: List<SearchResult>
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
74
common/car/src/main/res/drawable/ic_delete_background.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
15
common/car/src/main/res/drawable/ic_delete_foreground.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="#000000">
|
||||
<group android:scaleX="0.7888"
|
||||
android:scaleY="0.7888"
|
||||
android:translateX="101.376"
|
||||
android:translateY="101.376">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M280,240L280,240L280,400Q280,400 280,481.5Q280,563 280,680Q280,701 280,721Q280,741 280,760L280,760Q280,760 280,760Q280,760 280,760L280,240ZM450,840L280,840Q247,840 223.5,816.5Q200,793 200,760L200,240L160,240L160,160L360,160L360,120L600,120L600,160L800,160L800,240L760,240L760,412Q743,407 720.5,403.5Q698,400 680,400L680,240L280,240L280,760Q280,760 280,760Q280,760 280,760L412,760Q418,781 428,801.5Q438,822 450,840ZM360,680L400,680Q400,617 420,576.5Q440,536 440,536L440,320L360,320L360,680ZM520,450Q537,439 558.5,428Q580,417 600,412L600,320L520,320L520,450ZM680,880Q597,880 538.5,821.5Q480,763 480,680Q480,597 538.5,538.5Q597,480 680,480Q763,480 821.5,538.5Q880,597 880,680Q880,763 821.5,821.5Q763,880 680,880ZM746,774L774,746L700,672L700,560L660,560L660,688L746,774Z"/>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -1,58 +0,0 @@
|
||||
<!--
|
||||
Copyright (C) 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="512dp"
|
||||
android:height="512dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<group>
|
||||
<clip-path android:pathData="M256,256m-256,0a256,256 0,1 1,512 0a256,256 0,1 1,-512 0 M 0,0"/>
|
||||
<path
|
||||
android:pathData="M0.3,-1h512v512h-512z"
|
||||
android:fillColor="#9334E6"/>
|
||||
<path
|
||||
android:pathData="M668,-2.1v-4.8h-73.2v-69.8h73v-4.8h-73.2v-73.7h-4.8v73.7h-70v-73.7H515v73.7h-70v-73.7h-4.8v73.7h-70v-73.7h-4.8v73.7h-70v-73.7h-4.8v73.7h-69.8v-73.7H216v73.7h-70v-73.7h-4.8v73.7h-70v-73.7h-4.8v73.7h-70v-73.7h-4.8v73.7h-70v-73.7h-4.8v73.7h-73.2v4.8h73.2v69.8h-73.2v4.8h73.2v69.7h-73.2v4.8h73.2v69.8h-73.2v4.8h73.2v69.7h-73.2v4.8h73.2v69.8h-73.2v4.8h73.2v69.7h-73.2v4.8h73.2v69.8h-73.2v4.8h73.2V515h-73.2v4.8h73.2v69.8h-73.2v4.8h73.2v73.8h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7h70v73.7h4.8v-73.7H668v-4.8h-73.2v-69.8H668v-4.8h-73.2v-69.7H668v-4.8h-73.2v-69.8H668V366h-73.2v-69.7H668v-4.8h-73.2v-69.8H668v-4.8h-73.2v-69.7H668v-4.8h-73.2V72.5H668v-4.8h-73.2V-2.1H668zM440.3,519.9v69.8h-70v-69.8H440.3zM440.3,445.4v69.7h-70v-69.7L440.3,445.4L440.3,445.4zM440.3,370.8v69.8h-70v-69.8H440.3zM440.3,296.3V366h-70v-69.7H440.3zM440.3,221.7v69.8h-70v-69.8H440.3zM440.3,147v69.7h-70V147H440.3zM440.3,72.4v69.8h-70V72.4H440.3zM440.3,-2.1v69.7h-70V-2.1H440.3zM440.3,-76.8V-7h-70v-69.8H440.3zM365.4,519.9v69.8h-70v-69.8H365.4zM365.4,445.4v69.7h-70v-69.7L365.4,445.4L365.4,445.4zM365.4,370.8v69.8h-70v-69.8H365.4zM365.4,296.3V366h-70v-69.7H365.4zM365.4,221.7v69.8h-70v-69.8H365.4zM365.4,147v69.7h-70V147H365.4zM365.4,72.4v69.8h-70V72.4H365.4zM365.4,-2.1v69.7h-70V-2.1H365.4zM295.5,-6.9v-69.8h70v69.8C365.5,-6.9 295.5,-6.9 295.5,-6.9zM290.8,519.9v69.8h-70v-69.8H290.8zM290.8,445.4v69.7h-70v-69.7L290.8,445.4L290.8,445.4zM290.8,370.8v69.8h-70v-69.8H290.8zM220.8,291.3v-69.8h69.8v69.8H220.8zM290.8,296.3V366h-70v-69.7H290.8zM220.8,67.6V-2.1h70v69.7H220.8zM290.8,142.2h-70V72.4h70V142.2zM290.8,147v69.7h-70V147H290.8zM220.8,-6.9v-69.8h69.8v69.8C290.6,-6.9 220.8,-6.9 220.8,-6.9zM589.9,519.9v69.8h-70v-69.8H589.9zM589.9,445.4v69.7h-70v-69.7L589.9,445.4L589.9,445.4zM589.9,370.8v69.8h-70v-69.8H589.9zM589.9,296.3V366h-70v-69.7H589.9zM589.9,221.7v69.8h-70v-69.8H589.9zM589.9,147v69.7h-70V147H589.9zM589.9,72.4v69.8h-70V72.4H589.9zM589.9,-2.1v69.7h-70V-2.1H589.9zM589.9,-76.8V-7h-70v-69.8H589.9zM515.1,519.9v69.8h-70v-69.8H515.1zM515.1,445.4v69.7h-70v-69.7L515.1,445.4L515.1,445.4zM515.1,370.8v69.8h-70v-69.8H515.1zM515.1,296.3V366h-70v-69.7H515.1zM515.1,221.7v69.8h-70v-69.8H515.1zM515.1,147v69.7h-70V147H515.1zM515.1,72.4v69.8h-70V72.4H515.1zM445.1,67.6V-2.1h70v69.7H445.1zM445.1,-6.9v-69.8h70v69.8C515.1,-6.9 445.1,-6.9 445.1,-6.9zM216,519.9v69.8h-70v-69.8H216zM216,445.4v69.7h-70v-69.7L216,445.4L216,445.4zM216,370.8v69.8h-70v-69.8H216zM216,296.3V366h-70v-69.7H216zM216,221.5v69.8h-70v-69.8L216,221.5L216,221.5zM216,147v69.7h-70V147H216zM216,72.4v69.8h-70V72.4H216zM216,-2.1v69.7h-70V-2.1H216zM216,-76.8V-7h-70v-69.8H216zM141.2,519.9v69.8h-70v-69.8H141.2zM141.2,445.4v69.7h-70v-69.7L141.2,445.4L141.2,445.4zM141.2,370.8v69.8h-70v-69.8H141.2zM141.2,296.3V366h-70v-69.7H141.2zM141.2,221.5v69.8h-70v-69.8L141.2,221.5L141.2,221.5zM141.2,147v69.7h-70V147H141.2zM141.2,72.4v69.8h-70V72.4H141.2zM141.2,-2.1v69.7h-70V-2.1H141.2zM141.2,-76.8V-7h-70v-69.8H141.2zM66.4,519.9v69.8h-70v-69.8H66.4zM66.4,445.4v69.7h-70v-69.7L66.4,445.4L66.4,445.4zM66.4,370.8v69.8h-70v-69.8H66.4zM66.4,296.3V366h-70v-69.7H66.4zM66.4,221.5v69.8h-70v-69.8L66.4,221.5L66.4,221.5zM66.4,147v69.7h-70V147H66.4zM66.4,72.4v69.8h-70V72.4H66.4zM66.4,-2.1v69.7h-70V-2.1H66.4zM66.4,-76.8V-7h-70v-69.8H66.4zM-8.4,519.9v69.8h-70v-69.8H-8.4zM-8.4,445.4v69.7h-70v-69.7L-8.4,445.4L-8.4,445.4zM-8.4,370.8v69.8h-70v-69.8H-8.4zM-8.4,296.3V366h-70v-69.7H-8.4zM-8.4,221.5v69.8h-70v-69.8L-8.4,221.5L-8.4,221.5zM-8.4,147v69.7h-70V147H-8.4zM-8.4,72.4v69.8h-70V72.4H-8.4zM-8.4,-2.1v69.7h-70V-2.1H-8.4zM-8.4,-76.8V-7h-70v-69.8H-8.4z"
|
||||
android:strokeAlpha="0.7"
|
||||
android:fillColor="#C58AF9"
|
||||
android:fillAlpha="0.7"/>
|
||||
<path
|
||||
android:pathData="M95.9,333.5l151.6,-250.3l18.7,3.8l164,272l-108,30l-70.5,-29.5l-89.4,39.5l-18,-10l25,-33l-63,-1.5z"
|
||||
android:fillColor="#9334E6"/>
|
||||
<path
|
||||
android:pathData="M415.5,321.6L279.2,90.3C274.4,82 265.6,77 256.1,77s-18.4,5 -23.2,13.3L95,322.9c-4.9,7.9 -4.9,17.9 0,25.8c4.9,8.2 13.7,13.2 23.2,13.3h41.2l-15.1,27.4l16.8,16.8l94.9,-38.1l94.8,38.5l16.8,-16.8l-15.1,-27.2h39.9c14.3,0.9 26.6,-10 27.5,-24.3c0.4,-5.8 -1.2,-11.5 -4.5,-16.3L415.5,321.6zM347.5,389.5l-91.4,-37.1l-91.5,37.1l-2.6,-2.6l94.1,-168.6L350,386.9L347.5,389.5zM392.5,348h-46.8l-28.5,-48l-61.1,-111l-60.4,107.8l-29.4,51H119c-4.5,-0.1 -8.7,-2.5 -11,-6.4c-2.2,-3.5 -2.2,-7.9 0,-11.4L245,97.2c4,-6 12.2,-7.6 18.2,-3.6c1.4,1 2.7,2.2 3.6,3.6l136.4,231.5l0,0c1.4,2.1 2.2,4.5 2.1,7c-0.2,6.9 -6,12.3 -12.8,12.1L392.5,348z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
<path
|
||||
android:pathData="M362.8,354m-86.3,0a86.3,86.3 0,1 1,172.6 0a86.3,86.3 0,1 1,-172.6 0"
|
||||
android:fillColor="#9334E6"
|
||||
android:fillType="evenOdd"/>
|
||||
<group>
|
||||
<clip-path android:pathData="M362.8,351.9c-5.7,0 -10.3,-4.6 -10.3,-10.3c0,-5.7 4.6,-10.3 10.3,-10.3s10.3,4.6 10.3,10.3C373.2,347.3 368.5,351.9 362.8,351.9zM362.8,315.9c-14.8,0 -26.6,11.9 -26.6,26.6c0,19.9 26.6,49.4 26.6,49.4s26.6,-29.4 26.6,-49.4C389.4,327.9 377.5,315.9 362.8,315.9zM293.9,353.9c0,-35.7 27,-65.1 61.8,-68.7v14c-27,3.6 -48,26.8 -48,54.8s20.9,51.2 48,54.8v14C321,419 293.9,389.6 293.9,353.9zM406.6,300.5c-10.4,-8.6 -23.3,-13.9 -36.7,-15.3v14c10.1,1.3 19.3,5.3 26.9,11.2L406.6,300.5zM417.8,347h14c-1.4,-13.9 -6.9,-26.5 -15.3,-36.7l-9.9,9.9C412.5,327.8 416.5,336.9 417.8,347zM406.6,387.8l9.9,9.8c8.6,-10.4 13.9,-23.3 15.3,-36.7h-14C416.5,370.7 412.6,380 406.6,387.8zM369.8,408.8v14c13.9,-1.4 26.5,-6.9 36.7,-15.3l-9.8,-9.9C389,403.6 379.6,407.5 369.8,408.8z M 0,0"/>
|
||||
<group>
|
||||
<clip-path android:pathData="M279.9,271.1h165.8v165.8h-165.8z M 0,0"/>
|
||||
<group>
|
||||
<clip-path android:pathData="M279.9,271.1h165.8v165.8h-165.8z M 0,0"/>
|
||||
<group>
|
||||
<clip-path android:pathData="M279.9,271.1h165.8v165.8h-165.8z M 0,0"/>
|
||||
<path
|
||||
android:pathData="M245.3,236.5h235v235h-235z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -1,170 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
|
||||
BIN
common/car/src/main/res/drawable/navigation.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
5
common/car/src/main/res/mipmap-anydpi-v26/ic_delete.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_delete_background"/>
|
||||
<foreground android:drawable="@drawable/ic_delete_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_delete_background"/>
|
||||
<foreground android:drawable="@drawable/ic_delete_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
BIN
common/car/src/main/res/mipmap-hdpi/ic_delete.webp
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
common/car/src/main/res/mipmap-hdpi/ic_delete_round.webp
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.9 KiB |
BIN
common/car/src/main/res/mipmap-mdpi/ic_delete.webp
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
common/car/src/main/res/mipmap-mdpi/ic_delete_round.webp
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
common/car/src/main/res/mipmap-xhdpi/ic_delete.webp
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
common/car/src/main/res/mipmap-xhdpi/ic_delete_round.webp
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 5.1 KiB |
BIN
common/car/src/main/res/mipmap-xxhdpi/ic_delete.webp
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
common/car/src/main/res/mipmap-xxhdpi/ic_delete_round.webp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 8.4 KiB |
BIN
common/car/src/main/res/mipmap-xxxhdpi/ic_delete.webp
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
common/car/src/main/res/mipmap-xxxhdpi/ic_delete_round.webp
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 12 KiB |
@@ -43,8 +43,7 @@
|
||||
<string name="no_action_title" msgid="1452124604210014010">"Nein"</string>
|
||||
<string name="zoomed_in_toast_msg" msgid="8915301497303842649">"Herangezoomt"</string>
|
||||
<string name="zoomed_out_toast_msg" msgid="6260981223227212493">"Herausgezoomt"</string>
|
||||
<string name="triggered_toast_msg" msgid="3396166539208366382">"Ausgelöst"</string>
|
||||
<string name="favorite_toast_msg" msgid="522064494016370117">"Favorit!"</string>
|
||||
<string name="favorites" msgid="522064494016370117">"Favoriten"</string>
|
||||
<string name="not_favorite_toast_msg" msgid="6831181108681007428">"Kein Favorit!"</string>
|
||||
<string name="nav_requested_toast_msg" msgid="6696525973145493908">"Navigation angefragt"</string>
|
||||
<string name="selected_route_toast_msg" msgid="3149189677200086656">"Ausgewählte Route"</string>
|
||||
@@ -166,19 +165,7 @@
|
||||
<string name="long_msg_template_demo_title" msgid="1793748562161438131">"Demo der langen Nachrichtenvorlage"</string>
|
||||
<string name="long_msg_template_not_supported_text" msgid="3641559637317672505">"Dein Host unterstützt keine lange Nachrichtenvorlage"</string>
|
||||
<string name="long_msg_template_not_supported_title" msgid="8600719470226274925">"Inkompatibler Host"</string>
|
||||
<string name="msg_template_demo_title" msgid="3895210951340409473">"Demo der Nachrichtenvorlage"</string>
|
||||
<string name="msg_template_demo_text" msgid="2275291617716161409">"Nachricht wird hier angezeigt.\nMehr Text in der zweiten Zeile."</string>
|
||||
<string name="short_msg_template_demo_title" msgid="6798738013668580714">"Demo der kurzen Nachrichtenvorlage"</string>
|
||||
<string name="sectioned_item_template_demo_title" msgid="8377594346379786774">"Demo für Elementvorlage mit Abschnitten"</string>
|
||||
<string name="sectioned_item_template_radio_button_section_title" msgid="1014325865070733609">"Abschnitt „Optionsfeld“"</string>
|
||||
<string name="sectioned_item_template_toggle_section_title" msgid="3197227971733559949">"Abschnitt wechseln"</string>
|
||||
<string name="sectioned_item_template_lots_of_rows_section_title" msgid="1501401956386938735">"Abschnitt „Viele Zeilen“"</string>
|
||||
<string name="sectioned_item_template_grid_item_section_title" msgid="565528119467142741">"Bereich für Rasterelement"</string>
|
||||
<string name="pane_template_demo_title" msgid="7804292600060341608">"Demo der Bereichsvorlage"</string>
|
||||
<string name="place_list_template_demo_title" msgid="2054022985455460469">"Demo der Ortslistenvorlage"</string>
|
||||
<string name="browse_places_title" msgid="7246005909846715898">"Orte durchsuchen"</string>
|
||||
<string name="search_template_demo_title" msgid="1770474418958318114">"Suchvorlagendemo"</string>
|
||||
<string name="search_hint" msgid="978495498991026792">"Hier suchen"</string>
|
||||
<string name="no_places" msgid="7246005909846715898">"Keine Orte"</string>
|
||||
<string name="additional_text" msgid="5755100726890686184">"Bitte lies unsere "<annotation link="terms_of_service">"Nutzungsbedingungen"</annotation></string>
|
||||
<string name="google_sign_in" msgid="6556259799319701727">"Google Log-in"</string>
|
||||
<string name="use_pin" msgid="7850893299484337431">"PIN nutzen"</string>
|
||||
@@ -306,10 +293,10 @@
|
||||
<string name="loading_screen" msgid="4771507490730308794">"Ladebildschirm"</string>
|
||||
<string name="vector_toggle_details" msgid="1301305340033556819">"Schieberegler zum Hinzufügen/Entfernen von Farben"</string>
|
||||
<string name="map_template_toggle_demo_title" msgid="6510798293640092611">"Kartenvorlage mit Ein-/Aus-Schaltflächen"</string>
|
||||
<string name="avoid_tolls_row_title" msgid="5194057244144831024">"Mautstraßen vermeiden"</string>
|
||||
<string name="avoid_tolls_row_title" msgid="5194057244144831024">"Mautstraßen meiden"</string>
|
||||
<string name="route_options_demo_title" msgid="4599699012716426514">"Routenoptionen"</string>
|
||||
<string name="avoid_highways_row_title" msgid="4711913426200490304">"Autobahnen meiden"</string>
|
||||
<string name="avoid_ferries_row_title" msgid="8232883866013711974">"Fähren vermeiden"</string>
|
||||
<string name="avoid_ferries_row_title" msgid="8232883866013711974">"Fähren meiden"</string>
|
||||
<string name="map_demos_title" msgid="2169766615521476592">"Kartenbezogene Demos"</string>
|
||||
<string name="map_with_content_demo_title" msgid="1032610482145018739">"Demos von Karten mit Inhalten"</string>
|
||||
<string name="map_with_message_demo_title" msgid="7007078234918054436">"Karte mit Demo der Nachrichtenvorlage"</string>
|
||||
|
||||
@@ -45,8 +45,7 @@
|
||||
<!-- Toast Messages -->
|
||||
<string name="zoomed_in_toast_msg">Zoomed in</string>
|
||||
<string name="zoomed_out_toast_msg">Zoomed out</string>
|
||||
<string name="triggered_toast_msg">Triggered</string>
|
||||
<string name="favorite_toast_msg">Favorite!</string>
|
||||
<string name="favorites">Favorites</string>
|
||||
<string name="not_favorite_toast_msg">Not a favorite!</string>
|
||||
<string name="nav_requested_toast_msg">Navigation Requested</string>
|
||||
<string name="selected_route_toast_msg">Selected route</string>
|
||||
@@ -55,7 +54,6 @@
|
||||
<string name="parked_toast_msg">Parked action</string>
|
||||
<string name="more_toast_msg">Clicked More</string>
|
||||
<string name="grant_location_permission_toast_msg">Grant location Permission to see current location</string>
|
||||
<string name="changes_selection_to_index_toast_msg_prefix">Changed selection to index</string>
|
||||
|
||||
|
||||
<!-- Place Details Screen -->
|
||||
@@ -212,28 +210,9 @@
|
||||
<string name="long_msg_template_not_supported_text">Your host doesn\'t support Long Message template</string>
|
||||
<string name="long_msg_template_not_supported_title">Incompatible host</string>
|
||||
|
||||
<!-- MessageTemplateDemoScreen -->
|
||||
<string name="msg_template_demo_title">Message Template Demo</string>
|
||||
<string name="msg_template_demo_text">Message goes here.\nMore text on second line.</string>
|
||||
<string name="short_msg_template_demo_title">Short Message Template Demo</string>
|
||||
|
||||
<!-- SectionedItemTemplateDemo -->
|
||||
<string name="sectioned_item_template_demo_title">Sectioned Item Template Demo</string>
|
||||
<string name="sectioned_item_template_radio_button_section_title">Radio Button Section</string>
|
||||
<string name="sectioned_item_template_toggle_section_title">Toggle Section</string>
|
||||
<string name="sectioned_item_template_lots_of_rows_section_title">Lots of Rows Section</string>
|
||||
<string name="sectioned_item_template_grid_item_section_title">Grid Item Section</string>
|
||||
<string name="no_places">No Places</string>
|
||||
|
||||
<!-- PaneTemplateDemoScreen -->
|
||||
<string name="pane_template_demo_title">Pane Template Demo</string>
|
||||
|
||||
<!-- PlaceListTemplateBrowseDemoScreen -->
|
||||
<string name="place_list_template_demo_title">Place List Template Demo</string>
|
||||
<string name="browse_places_title">Browse Places</string>
|
||||
|
||||
<!-- SearchTemplateDemoScreen -->
|
||||
<string name="search_template_demo_title">Search Template Demo</string>
|
||||
<string name="search_hint">Search here</string>
|
||||
|
||||
<!-- SignInTemplateDemoScreen -->
|
||||
<string name="additional_text">Please review our <annotation link="terms_of_service">terms of service</annotation></string>
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.kouros.navigation.data
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val NavigationColor = Color(0xFF052086)
|
||||
val NavigationColor = Color(0xFF368605)
|
||||
|
||||
val RouteColor = Color(0xFF5582D0)
|
||||
|
||||
|
||||
@@ -146,6 +146,8 @@ object Constants {
|
||||
|
||||
const val RECENT: String = "Recent"
|
||||
|
||||
const val FAVORITES: String = "Favorites"
|
||||
|
||||
/** The initial location to use as an anchor for searches. */
|
||||
val homeLocation: Location = Location(LocationManager.GPS_PROVIDER)
|
||||
val home2Location: Location = Location(LocationManager.GPS_PROVIDER)
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.kouros.navigation.data
|
||||
|
||||
import android.location.Location
|
||||
import com.kouros.navigation.model.RouteModel
|
||||
import com.kouros.navigation.utils.NavigationUtils.getBoundingBox
|
||||
import org.json.JSONArray
|
||||
import java.net.Authenticator
|
||||
import java.net.HttpURLConnection
|
||||
@@ -62,8 +63,14 @@ class NavigationRepository {
|
||||
return routeModel.route.distance
|
||||
}
|
||||
|
||||
fun searchPlaces(search : String) : String {
|
||||
return fetchUrl("${nominatimUrl}search?q=$search&format=jsonv2&addressdetails=true&countrycodes=de", false)
|
||||
fun searchPlaces(search: String, location: Location) : String {
|
||||
// val bbox = getBoundingBox(location.longitude, location.latitude, 10.0)
|
||||
// val neLon = bbox["ne"]?.get("lon")
|
||||
// val neLat = bbox["ne"]?.get("lat")
|
||||
// val swLon = bbox["sw"]?.get("lon")
|
||||
// val swLat = bbox["sw"]?.get("lat")
|
||||
// val viewbox = "&viewbox=$swLon,$swLat,$neLon,$neLat"
|
||||
return fetchUrl("${nominatimUrl}search?q=$search&format=jsonv2&addressdetails=true,&countrycodes=de", false)
|
||||
}
|
||||
|
||||
fun reverseAddress(location: Location) : String {
|
||||
|
||||
@@ -97,7 +97,8 @@ data class Route (
|
||||
} else {
|
||||
currentManeuver().endShapeIndex + 1
|
||||
}
|
||||
return pointLocations.subList(beginShapeIndex, endShapeIndex)
|
||||
//return pointLocations.subList(beginShapeIndex, endShapeIndex)
|
||||
return pointLocations
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
|
||||
@@ -10,8 +10,6 @@ import com.kouros.navigation.utils.location
|
||||
import org.maplibre.geojson.FeatureCollection
|
||||
import org.maplibre.geojson.Point
|
||||
import org.maplibre.turf.TurfMeasurement
|
||||
import org.maplibre.turf.TurfMisc
|
||||
import kotlin.math.absoluteValue
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
open class RouteModel() {
|
||||
@@ -28,7 +26,7 @@ open class RouteModel() {
|
||||
/*
|
||||
current shapeIndex
|
||||
*/
|
||||
private var currentShapeIndex = 0
|
||||
var currentShapeIndex = 0
|
||||
|
||||
var distanceToStepEnd = 0F
|
||||
|
||||
@@ -53,7 +51,7 @@ open class RouteModel() {
|
||||
|
||||
val future = TurfMeasurement.center(FeatureCollection.fromJson(route.routeGeoJson))
|
||||
val point = future.geometry() as Point
|
||||
return location(point.latitude(), point.longitude())
|
||||
return location(point.longitude(), point.latitude())
|
||||
}
|
||||
|
||||
val currentDistance: Double
|
||||
@@ -85,16 +83,16 @@ open class RouteModel() {
|
||||
text = maneuver.streetNames[0]
|
||||
}
|
||||
val curLocation = location(
|
||||
route.pointLocations[currentShapeIndex].latitude(),
|
||||
route.pointLocations[currentShapeIndex].longitude()
|
||||
route.pointLocations[currentShapeIndex].longitude(),
|
||||
route.pointLocations[currentShapeIndex].latitude()
|
||||
)
|
||||
if (currentShapeIndex < route.pointLocations.size) {
|
||||
val nextLocation = location(
|
||||
route.pointLocations[currentShapeIndex + 1].latitude(),
|
||||
route.pointLocations[currentShapeIndex + 1].longitude()
|
||||
)
|
||||
bearing = curLocation.bearingTo(nextLocation).absoluteValue
|
||||
}
|
||||
// if (currentShapeIndex < route.pointLocations.size) {
|
||||
// val nextLocation = location(
|
||||
// route.pointLocations[currentShapeIndex + 1].latitude(),
|
||||
// route.pointLocations[currentShapeIndex + 1].longitude()
|
||||
// )
|
||||
// bearing = curLocation.bearingTo(nextLocation)
|
||||
// }
|
||||
val distanceStepLeft = leftStepDistance() * 1000
|
||||
when (distanceStepLeft) {
|
||||
in 0.0..NEXT_STEP_THRESHOLD -> {
|
||||
|
||||
@@ -40,6 +40,10 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
MutableLiveData<List<Place>>()
|
||||
}
|
||||
|
||||
val favorites: MutableLiveData<List<Place>> by lazy {
|
||||
MutableLiveData<List<Place>>()
|
||||
}
|
||||
|
||||
val searchPlaces: MutableLiveData<List<SearchResult>> by lazy {
|
||||
MutableLiveData<List<SearchResult>>()
|
||||
}
|
||||
@@ -60,7 +64,7 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
val results = query.find()
|
||||
query.close()
|
||||
for (place in results) {
|
||||
val plLocation = location(place.latitude, place.longitude)
|
||||
val plLocation = location(place.longitude,place.latitude)
|
||||
// val distance = repository.getRouteDistance(location, plLocation)
|
||||
//place.distance = distance.toFloat()
|
||||
if (place.distance == 0F) {
|
||||
@@ -78,13 +82,13 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
try {
|
||||
val placeBox = boxStore.boxFor(Place::class)
|
||||
val query = placeBox
|
||||
.query(Place_.name.notEqual(""))
|
||||
.query(Place_.name.notEqual("").and(Place_.category.equal(Constants.RECENT)))
|
||||
.orderDesc(Place_.lastDate)
|
||||
.build()
|
||||
val results = query.find()
|
||||
query.close()
|
||||
for (place in results) {
|
||||
val plLocation = location(place.latitude, place.longitude)
|
||||
val plLocation = location(place.longitude, place.latitude)
|
||||
val distance = repository.getRouteDistance(location, plLocation, getSearchFilter(context))
|
||||
place.distance = distance.toFloat()
|
||||
}
|
||||
@@ -95,6 +99,28 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
}
|
||||
}
|
||||
|
||||
fun loadFavorites(context: Context, location: Location) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
try {
|
||||
val placeBox = boxStore.boxFor(Place::class)
|
||||
val query = placeBox
|
||||
.query(Place_.name.notEqual("").and(Place_.category.equal(Constants.FAVORITES)))
|
||||
.orderDesc(Place_.lastDate)
|
||||
.build()
|
||||
val results = query.find()
|
||||
query.close()
|
||||
for (place in results) {
|
||||
val plLocation = location(place.longitude, place.latitude )
|
||||
val distance = repository.getRouteDistance(location, plLocation, getSearchFilter(context))
|
||||
place.distance = distance.toFloat()
|
||||
}
|
||||
favorites.postValue(results)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun loadRoute(context: Context, currentLocation: Location, location: Location) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
try {
|
||||
@@ -129,7 +155,7 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
) {
|
||||
for (adr in it) {
|
||||
if (addressLines.size > 1) {
|
||||
val plLocation = location(adr.latitude, adr.longitude)
|
||||
val plLocation = location( adr.longitude, adr.latitude)
|
||||
val distance =
|
||||
repository.getRouteDistance(currentLocation, plLocation, getSearchFilter(context))
|
||||
contactList.add(
|
||||
@@ -159,13 +185,13 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
|
||||
fun searchPlaces(search: String, location: Location) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val placesJson = repository.searchPlaces(search)
|
||||
val placesJson = repository.searchPlaces(search, location)
|
||||
val gson = GsonBuilder().serializeNulls().create()
|
||||
val places = gson.fromJson(placesJson, Search::class.java)
|
||||
val distPlaces = mutableListOf<SearchResult>()
|
||||
places.forEach {
|
||||
val plLocation =
|
||||
location(latitude = it.lat.toDouble(), longitude = it.lon.toDouble())
|
||||
location(longitude = it.lon.toDouble(), latitude = it.lat.toDouble())
|
||||
val distance = plLocation.distanceTo(location)
|
||||
it.distance = distance
|
||||
distPlaces.add(it)
|
||||
@@ -183,13 +209,20 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
return place.address.road
|
||||
}
|
||||
|
||||
fun saveFavorite(place: Place) {
|
||||
place.category = Constants.FAVORITES
|
||||
savePlace(place)
|
||||
}
|
||||
fun saveRecent(place: Place) {
|
||||
place.category = Constants.RECENT
|
||||
savePlace(place)
|
||||
}
|
||||
fun savePlace(place: Place) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
place.category = Constants.RECENT
|
||||
try {
|
||||
val placeBox = boxStore.boxFor(Place::class)
|
||||
val query = placeBox
|
||||
.query(Place_.name.equal(place.name!!))
|
||||
.query(Place_.name.equal(place.name!!).and(Place_.category.equal(place.category!!)))
|
||||
.build()
|
||||
val results = query.find()
|
||||
query.close()
|
||||
@@ -205,13 +238,21 @@ class ViewModel(private val repository: NavigationRepository) : ViewModel() {
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteFavorite(place: Place) {
|
||||
place.category = Constants.FAVORITES
|
||||
deletePlace(place)
|
||||
}
|
||||
|
||||
fun deleteRecent(place: Place) {
|
||||
place.category = Constants.RECENT
|
||||
deletePlace(place)
|
||||
}
|
||||
fun deletePlace(place: Place) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
place.category = Constants.RECENT
|
||||
try {
|
||||
val placeBox = boxStore.boxFor(Place::class)
|
||||
val query = placeBox
|
||||
.query(Place_.name.equal(place.name!!))
|
||||
.query(Place_.name.equal(place.name!!).and(Place_.category.equal(place.category!!)))
|
||||
.build()
|
||||
val results = query.find()
|
||||
query.close()
|
||||
|
||||
@@ -3,27 +3,15 @@ package com.kouros.navigation.utils
|
||||
import android.content.Context
|
||||
import android.location.Location
|
||||
import android.location.LocationManager
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.core.content.edit
|
||||
import com.kouros.navigation.data.Constants.MAXIMAL_ROUTE_DEVIATION
|
||||
import com.kouros.navigation.data.Constants.SHARED_PREF_KEY
|
||||
import com.kouros.navigation.data.Constants.SHOW_THREED_BUILDING
|
||||
import com.kouros.navigation.data.GeoJsonFeature
|
||||
import com.kouros.navigation.data.GeoJsonFeatureCollection
|
||||
import com.kouros.navigation.data.GeoJsonLineString
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.maplibre.geojson.Feature
|
||||
import org.maplibre.geojson.FeatureCollection
|
||||
import org.maplibre.geojson.LineString
|
||||
import org.maplibre.geojson.Point
|
||||
import org.maplibre.turf.TurfClassification
|
||||
import org.maplibre.turf.TurfConversion
|
||||
import org.maplibre.turf.TurfJoins
|
||||
import org.maplibre.turf.TurfMeasurement
|
||||
import org.maplibre.turf.TurfMeta
|
||||
import org.maplibre.turf.TurfMisc
|
||||
import org.maplibre.turf.TurfTransformation
|
||||
import org.maplibre.turf.TurfMeasurement
|
||||
import java.lang.Math.toDegrees
|
||||
import java.lang.Math.toRadians
|
||||
import kotlin.math.asin
|
||||
@@ -45,7 +33,6 @@ object NavigationUtils {
|
||||
.getBoolean(key, false)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.GINGERBREAD)
|
||||
fun setBooleanKeyValue(context: Context, `val`: Boolean, key: String) {
|
||||
context
|
||||
.getSharedPreferences(
|
||||
@@ -60,18 +47,13 @@ object NavigationUtils {
|
||||
}
|
||||
}
|
||||
fun snapLocation(location: Location, stepCoordinates: List<Point>) : Location {
|
||||
val newLocation = location(latitude = location.latitude, longitude = location.longitude)
|
||||
val newLocation = Location(location)
|
||||
val oldPoint = Point.fromLngLat(location.longitude, location.latitude)
|
||||
if (stepCoordinates.size > 1) {
|
||||
val pointFeature = TurfMisc.nearestPointOnLine(oldPoint, stepCoordinates)
|
||||
val point = pointFeature.geometry() as Point
|
||||
newLocation.latitude = point.latitude()
|
||||
newLocation.longitude = point.longitude()
|
||||
newLocation.speed = location.speed
|
||||
newLocation.bearing = location.bearing
|
||||
newLocation.time = location.time
|
||||
newLocation.accuracy = location.accuracy
|
||||
newLocation.altitude = location.altitude
|
||||
}
|
||||
return newLocation
|
||||
}
|
||||
@@ -129,10 +111,10 @@ object NavigationUtils {
|
||||
radius: Double
|
||||
): Map<String, Map<String, Double>> {
|
||||
val earthRadius = 6371.0
|
||||
val maxLat = lat + Math.toDegrees(radius / earthRadius)
|
||||
val minLat = lat - Math.toDegrees(radius / earthRadius)
|
||||
val maxLon = lon + Math.toDegrees(radius / earthRadius / cos(Math.toRadians(lat)))
|
||||
val minLon = lon - Math.toDegrees(radius / earthRadius / cos(Math.toRadians(lat)))
|
||||
val maxLat = lat + toDegrees(radius / earthRadius)
|
||||
val minLat = lat - toDegrees(radius / earthRadius)
|
||||
val maxLon = lon + toDegrees(radius / earthRadius / cos(toRadians(lat)))
|
||||
val minLon = lon - toDegrees(radius / earthRadius / cos(toRadians(lat)))
|
||||
|
||||
return mapOf(
|
||||
"nw" to mapOf("lat" to maxLat, "lon" to minLon),
|
||||
@@ -182,8 +164,12 @@ fun calculateZoom(speed: Double?): Double {
|
||||
}
|
||||
return zoom.toDouble()
|
||||
}
|
||||
fun bearing(fromLocation: Location, toLocation: Location ) : Double {
|
||||
val bearing = fromLocation.bearingTo(toLocation).toInt().toDouble()
|
||||
return bearing
|
||||
}
|
||||
|
||||
fun location(latitude: Double, longitude: Double): Location {
|
||||
fun location(longitude : Double, latitude: Double): Location {
|
||||
val location = Location(LocationManager.GPS_PROVIDER)
|
||||
location.longitude = longitude
|
||||
location.latitude = latitude
|
||||
|
||||