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