Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#16632: fixes after review #17524

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ abstract class BaseOsmAndAndroidAutoScreen(carContext: CarContext) : Screen(carC
}

companion object {
private const val DEFAULT_CONTENT_LIMIT = 100
private const val DEFAULT_CONTENT_LIMIT = 12
}
}
8 changes: 3 additions & 5 deletions OsmAnd/src/net/osmand/plus/auto/TracksScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class TracksScreen(
private val trackTab: TrackTab
) : BaseOsmAndAndroidAutoScreen(carContext) {
val gpxDbHelper: GpxDbHelper = app.gpxDbHelper
var loadGpxFilesThread: Thread? = null
private var loadedGpxFiles = HashMap<TrackItem, SelectedGpxFile>()
private lateinit var loadTracksTask: LoadTracksTask

Expand All @@ -49,7 +48,6 @@ class TracksScreen(

override fun onDestroy(owner: LifecycleOwner) {
super.onDestroy(owner)
loadGpxFilesThread?.interrupt()
app.osmandMap.mapLayers.gpxLayer.setCustomMapObjects(null)
app.osmandMap.mapView.backToLocation()
}
Expand Down Expand Up @@ -87,7 +85,7 @@ class TracksScreen(
}

private fun prepareTrackItems() {
loadedGpxFiles = HashMap()
val newMap = HashMap<TrackItem, SelectedGpxFile>()
for (track in trackTab.trackItems) {
track.file?.let { file ->
val item = gpxDbHelper.getItem(file) { updateTrack(track, it) }
Expand All @@ -97,14 +95,14 @@ class TracksScreen(
val gpxFile = GPXUtilities.loadGPXFile(file)
val selectedGpxFile = SelectedGpxFile()
selectedGpxFile.setGpxFile(gpxFile, app)
loadedGpxFiles[track] = selectedGpxFile
newMap[track] = selectedGpxFile
}
}
loadedGpxFiles = newMap
}

private fun updateTrack(trackItem: TrackItem, dataItem: GpxDataItem?) {
trackItem.dataItem = dataItem
invalidate()
}

private fun setupTracks(templateBuilder: PlaceListNavigationTemplate.Builder) {
Expand Down