File tree Expand file tree Collapse file tree
androidTest/java/org/scottishtecharmy/soundscape
assets/osm-liberty-accessible
java/org/scottishtecharmy/soundscape Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ import org.scottishtecharmy.soundscape.screens.markers_routes.screens.addandedit
3636import org.scottishtecharmy.soundscape.screens.markers_routes.screens.routedetailsscreen.RouteDetailsScreen
3737import org.scottishtecharmy.soundscape.screens.markers_routes.screens.routedetailsscreen.RouteDetailsUiState
3838import org.scottishtecharmy.soundscape.services.RoutePlayerState
39- import org.scottishtecharmy.soundscape.utils.processMaps
4039import org.scottishtecharmy.soundscape.viewmodels.home.HomeState
4140import java.io.File
4241import java.io.FileOutputStream
@@ -104,9 +103,6 @@ class DocumentationScreens {
104103
105104 val targetContext = InstrumentationRegistry .getInstrumentation().targetContext
106105
107- // Unpack map assets
108- processMaps(targetContext)
109-
110106 val themeStateFlow = MutableStateFlow (ThemeState ())
111107 composeTestRule.setContent {
112108 SoundscapeTheme (themeStateFlow) {
Original file line number Diff line number Diff line change 66 "maputnik:renderer" : " mbgljs" ,
77 "openmaptiles:version" : " 3.x"
88 },
9- "sprite" : " file:///data/user/0/org.scottishtecharmy.soundscape/files /osm-liberty-accessible/osm-liberty" ,
10- "glyphs" : " file:///data/user/0/org.scottishtecharmy.soundscape/files /osm-liberty-accessible/fonts/{fontstack}/{range}.pbf" ,
9+ "sprite" : " asset:/ /osm-liberty-accessible/osm-liberty" ,
10+ "glyphs" : " asset:/ /osm-liberty-accessible/fonts/{fontstack}/{range}.pbf" ,
1111 "layers" : [
1212 {
1313 "id" : " background" ,
Original file line number Diff line number Diff line change 66 "maputnik:renderer" : " mbgljs" ,
77 "openmaptiles:version" : " 3.x"
88 },
9- "sprite" : " file:///data/user/0/org.scottishtecharmy.soundscape/files /osm-liberty-accessible/osm-liberty" ,
10- "glyphs" : " file:///data/user/0/org.scottishtecharmy.soundscape/files /osm-liberty-accessible/fonts/{fontstack}/{range}.pbf" ,
9+ "sprite" : " asset:/ /osm-liberty-accessible/osm-liberty" ,
10+ "glyphs" : " asset:/ /osm-liberty-accessible/fonts/{fontstack}/{range}.pbf" ,
1111 "layers" : [
1212 {
1313 "id" : " background" ,
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ import org.scottishtecharmy.soundscape.utils.LogcatHelper
6161import org.scottishtecharmy.soundscape.database.local.model.RouteEntity
6262import org.scottishtecharmy.soundscape.utils.findExtracts
6363import org.scottishtecharmy.soundscape.utils.getOfflineMapStorage
64- import org.scottishtecharmy.soundscape.utils.processMaps
6564import java.io.File
6665import java.util.Locale
6766import javax.inject.Inject
@@ -416,9 +415,6 @@ class MainActivity : AppCompatActivity() {
416415 // Validate offline map directory
417416 getOfflineMapStorage(this )
418417
419- // Unpack map assets
420- processMaps(applicationContext)
421-
422418 // When opening a JSON file containing a route from Android File we can end up with two
423419 // instances of the app running. This check ensures that we have only one instance.
424420 if (! isTaskRoot) {
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package org.scottishtecharmy.soundscape.screens.home.home
33import android.content.Context
44import android.graphics.Color
55import android.graphics.drawable.Drawable
6- import android.net.Uri
76import android.os.Environment
87import android.util.Log
98import android.view.Gravity
@@ -314,7 +313,6 @@ fun MapContainerLibre(
314313 val currentBeaconIndex = remember { mutableStateOf(currentBeaconWaypointIndex) }
315314 val symbol = remember { mutableStateOf<Symbol ?>(null ) }
316315 val symbolManager = remember { mutableStateOf<SymbolManager ?>(null ) }
317- val filesDir = remember { context.filesDir.toString() }
318316
319317 val res = context.resources
320318 val userPositionDrawable = remember {
@@ -381,8 +379,7 @@ fun MapContainerLibre(
381379 if (mapDestroyed.get()) return @getMapAsync
382380 val styleName =
383381 if (accessibleMapEnabled) " style.json" else " originalStyle.json"
384- val styleUrl =
385- Uri .fromFile(File (" $filesDir /osm-liberty-accessible/$styleName " )).toString()
382+ val styleUrl = " asset://osm-liberty-accessible/$styleName "
386383 mapLibre.setStyle(styleUrl) { style ->
387384 // The style load is asynchronous, so the map may have been destroyed
388385 // between requesting the style and it loading. Bail out before touching any
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments