Preview after Search
This commit is contained in:
@@ -17,8 +17,8 @@ android {
|
|||||||
applicationId = "com.kouros.navigation"
|
applicationId = "com.kouros.navigation"
|
||||||
minSdk = 33
|
minSdk = 33
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 93
|
versionCode = 94
|
||||||
versionName = "0.2.3.93"
|
versionName = "0.2.3.94"
|
||||||
base.archivesName = "navi-$versionName"
|
base.archivesName = "navi-$versionName"
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ class RoutePreviewScreen(
|
|||||||
location(destination.longitude, destination.latitude),
|
location(destination.longitude, destination.latitude),
|
||||||
surfaceRenderer.carOrientation
|
surfaceRenderer.carOrientation
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import com.kouros.navigation.data.Constants.CATEGORIES
|
|||||||
import com.kouros.navigation.data.Constants.FAVORITES
|
import com.kouros.navigation.data.Constants.FAVORITES
|
||||||
import com.kouros.navigation.data.Constants.RECENT
|
import com.kouros.navigation.data.Constants.RECENT
|
||||||
import com.kouros.navigation.data.Place
|
import com.kouros.navigation.data.Place
|
||||||
import com.kouros.navigation.data.ViewStyle
|
|
||||||
import com.kouros.navigation.data.nominatim.SearchResult
|
import com.kouros.navigation.data.nominatim.SearchResult
|
||||||
import com.kouros.navigation.model.NavigationViewModel
|
import com.kouros.navigation.model.NavigationViewModel
|
||||||
|
|
||||||
@@ -86,22 +85,7 @@ class SearchScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
screenManager
|
startPlaceListScreen(it)
|
||||||
.pushForResult(
|
|
||||||
PlaceListScreen(
|
|
||||||
carContext,
|
|
||||||
surfaceRenderer,
|
|
||||||
it.id,
|
|
||||||
navigationViewModel,
|
|
||||||
recentPlaces
|
|
||||||
)
|
|
||||||
) { obj: Any? ->
|
|
||||||
surfaceRenderer.setStandardView()
|
|
||||||
if (obj != null) {
|
|
||||||
setResult(obj)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.setBrowsable(true)
|
.setBrowsable(true)
|
||||||
@@ -131,6 +115,24 @@ class SearchScreen(
|
|||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun startPlaceListScreen(it: Category) {
|
||||||
|
screenManager
|
||||||
|
.pushForResult(
|
||||||
|
PlaceListScreen(
|
||||||
|
carContext,
|
||||||
|
surfaceRenderer,
|
||||||
|
it.id,
|
||||||
|
navigationViewModel,
|
||||||
|
recentPlaces
|
||||||
|
)
|
||||||
|
) { obj: Any? ->
|
||||||
|
surfaceRenderer.setStandardView()
|
||||||
|
if (obj != null) {
|
||||||
|
setResult(obj)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
fun categoryIcon(category: String?): CarIcon {
|
fun categoryIcon(category: String?): CarIcon {
|
||||||
val resId: Int = when (category) {
|
val resId: Int = when (category) {
|
||||||
RECENT -> {
|
RECENT -> {
|
||||||
@@ -182,7 +184,28 @@ class SearchScreen(
|
|||||||
distance = result.distance
|
distance = result.distance
|
||||||
)
|
)
|
||||||
recentPlaces.add(place)
|
recentPlaces.add(place)
|
||||||
|
startPreviewScreen(place)
|
||||||
setResult(place)
|
setResult(place)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun startPreviewScreen(it: Place) {
|
||||||
|
screenManager
|
||||||
|
.pushForResult(
|
||||||
|
RoutePreviewScreen(
|
||||||
|
carContext,
|
||||||
|
RoutePreviewType.SINGLE_ROUTE,
|
||||||
|
surfaceRenderer,
|
||||||
|
destination = it,
|
||||||
|
navigationViewModel,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
) { obj: Any? ->
|
||||||
|
surfaceRenderer.setStandardView()
|
||||||
|
if (obj != null) {
|
||||||
|
setResult(obj)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user