Icons and strings

This commit is contained in:
Dimitris
2025-12-23 16:22:24 +01:00
parent e5c74f6fa2
commit 8673380b9e
37 changed files with 435 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
package com.kouros.navigation.car.map
import android.annotation.SuppressLint
import android.location.Location
import android.content.Context
import androidx.compose.foundation.Canvas
@@ -115,41 +116,41 @@ fun MapLibre(
fun RouteLayer(routeData: String?) {
if (routeData != null && routeData.isNotEmpty()) {
val routes = rememberGeoJsonSource(GeoJsonData.JsonString(routeData))
LineLayer(
id = "routes-casing",
source = routes,
color = const(Color.White),
width =
interpolate(
type = exponential(1.2f),
input = zoom(),
5 to const(0.4.dp),
6 to const(0.8.dp),
7 to const(2.0.dp),
20 to const(24.dp),
),
)
LineLayer(
id = "routes",
source = routes,
color = const(RouteColor),
width =
interpolate(
type = exponential(1.2f),
input = zoom(),
5 to const(0.4.dp),
6 to const(0.7.dp),
7 to const(1.75.dp),
20 to const(22.dp),
),
)
LineLayer(
id = "routes-casing",
source = routes,
color = const(Color.White),
width =
interpolate(
type = exponential(1.2f),
input = zoom(),
5 to const(0.4.dp),
6 to const(0.8.dp),
7 to const(2.0.dp),
20 to const(24.dp),
),
)
LineLayer(
id = "routes",
source = routes,
color = const(RouteColor),
width =
interpolate(
type = exponential(1.2f),
input = zoom(),
5 to const(0.4.dp),
6 to const(0.7.dp),
7 to const(1.75.dp),
20 to const(22.dp),
),
)
}
}
@Composable
fun AmenityLayer(routeData: String?) {
if (routeData != null && routeData.isNotEmpty()) {
val color = if (routeData.contains(Constants.PHARMACY)) {
val color = if (routeData.contains(Constants.PHARMACY)) {
const(Color.Red)
} else {
const(Color.Green)
@@ -164,6 +165,7 @@ fun AmenityLayer(routeData: String?) {
)
}
}
@Composable
fun BuildingLayer(tiles: Source) {
Anchor.Replace("building-3d") {
@@ -177,7 +179,13 @@ fun BuildingLayer(tiles: Source) {
}
@Composable
fun DrawNavigationImages(padding: PaddingValues, speed: Float?, maxSpeed: Int, width: Int, height: Int) {
fun DrawNavigationImages(
padding: PaddingValues,
speed: Float?,
maxSpeed: Int,
width: Int,
height: Int
) {
NavigationImage(padding, width, height)
CurrentSpeed(width, height, speed)
if (speed != null && maxSpeed > 0 && (speed * 3.6) > maxSpeed) {
@@ -199,7 +207,7 @@ fun NavigationImage(padding: PaddingValues, width: Int, height: Int) {
}
}
Icon(
painter = painterResource(id = R.drawable.navigation),
painter = painterResource(id = R.drawable.navigation_48px),
"Navigation",
tint = color.copy(alpha = 1f),
modifier = Modifier.size(imageSize.dp, imageSize.dp),

View File

@@ -294,7 +294,7 @@ class NavigationScreen(
CarIcon.Builder(
IconCompat.createWithResource(
carContext,
R.drawable.assistant_navigation_48px
R.drawable.navigation_48px
)
)
.build()
@@ -328,7 +328,7 @@ class NavigationScreen(
private fun searchAction(): Action {
return Action.Builder()
.setIcon(routeModel.createCarIcon(carContext, R.drawable.ic_search_black36dp))
.setIcon(routeModel.createCarIcon(carContext, R.drawable.search_48px))
.setOnClickListener {
startSearchScreen()
}
@@ -337,7 +337,7 @@ class NavigationScreen(
private fun settingsAction(): Action {
return Action.Builder()
.setIcon(routeModel.createCarIcon(carContext, R.drawable.settings_24px))
.setIcon(routeModel.createCarIcon(carContext, R.drawable.settings_applications_48px))
.setOnClickListener {
screenManager.push(SettingsScreen(carContext))
}

View File

@@ -152,7 +152,7 @@ class PlaceListScreen(
.setIcon(
RouteCarModel().createCarIcon(
carContext,
R.drawable.ic_delete_foreground
R.drawable.ic_pan_24
)
)
.setOnClickListener {

View File

@@ -143,7 +143,7 @@ class RoutePreviewScreen(
.getString(R.string.favorites)
else
carContext.getString(
R.string.not_favorite_toast_msg
R.string.favorites
),
CarToast.LENGTH_SHORT
)
@@ -165,7 +165,7 @@ class RoutePreviewScreen(
CarIcon.Builder(
IconCompat.createWithResource(
carContext,
R.drawable.ic_delete_foreground
R.drawable.ic_pan_24
)
)
.build()

View File

@@ -137,7 +137,7 @@ class SearchScreen(
R.drawable.ic_favorite_white_24dp
}
else -> {
R.drawable.navigation
R.drawable.navigation_48px
}
}
return CarIcon.Builder(