diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 578437299..6b5e81b5f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -317,7 +317,7 @@ dependencies { automotiveImplementation("androidx.car.app:app-automotive:$carAppVersion") // AnyMaps - val anyMapsVersion = "aa1093c756" + val anyMapsVersion = "13c2395053" implementation("com.github.ev-map.AnyMaps:anymaps-base:$anyMapsVersion") googleImplementation("com.github.ev-map.AnyMaps:anymaps-google:$anyMapsVersion") googleImplementation("com.google.android.gms:play-services-maps:19.0.0") @@ -367,6 +367,7 @@ dependencies { debugImplementation("com.facebook.flipper:flipper:0.238.0") debugImplementation("com.facebook.soloader:soloader:0.10.5") debugImplementation("com.facebook.flipper:flipper-network-plugin:0.238.0") + debugImplementation("com.jakewharton.timber:timber:5.0.1") // testing testImplementation("junit:junit:4.13.2") diff --git a/app/src/debug/java/net/vonforst/evmap/DebugInits.kt b/app/src/debug/java/net/vonforst/evmap/DebugInits.kt index eb6b813aa..c39d2d19f 100644 --- a/app/src/debug/java/net/vonforst/evmap/DebugInits.kt +++ b/app/src/debug/java/net/vonforst/evmap/DebugInits.kt @@ -11,6 +11,7 @@ import com.facebook.flipper.plugins.network.NetworkFlipperPlugin import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin import com.facebook.soloader.SoLoader import okhttp3.OkHttpClient +import timber.log.Timber private val networkFlipperPlugin = NetworkFlipperPlugin() @@ -24,6 +25,8 @@ fun addDebugInterceptors(context: Context) { client.addPlugin(DatabasesFlipperPlugin(context)) client.addPlugin(SharedPreferencesFlipperPlugin(context)) client.start() + + Timber.plant(Timber.DebugTree()) } fun OkHttpClient.Builder.addDebugInterceptors(): OkHttpClient.Builder { diff --git a/app/src/main/java/net/vonforst/evmap/fragment/MapFragment.kt b/app/src/main/java/net/vonforst/evmap/fragment/MapFragment.kt index 83a4c61c4..3df79137d 100644 --- a/app/src/main/java/net/vonforst/evmap/fragment/MapFragment.kt +++ b/app/src/main/java/net/vonforst/evmap/fragment/MapFragment.kt @@ -197,14 +197,10 @@ class MapFragment : Fragment(), OnMapReadyCallback, MapsActivity.FragmentCallbac mapFragment = childFragmentManager.findFragmentByTag(mapFragmentTag) as MapFragment? } - if (mapFragment == null || mapFragment!!.priority[0] != provider) { + if (mapFragment == null || mapFragment!!.priority[0] != getMapProvider(provider)) { mapFragment = MapFragment() mapFragment!!.priority = arrayOf( - when (provider) { - "mapbox" -> MapFactory.MAPLIBRE - "google" -> MapFactory.GOOGLE - else -> null - }, + getMapProvider(provider), MapFactory.GOOGLE, MapFactory.MAPLIBRE ) @@ -265,6 +261,12 @@ class MapFragment : Fragment(), OnMapReadyCallback, MapsActivity.FragmentCallbac return binding.root } + private fun getMapProvider(provider: String) = when (provider) { + "mapbox" -> MapFactory.MAPLIBRE + "google" -> MapFactory.GOOGLE + else -> null + } + val bottomSheetCollapsible get() = resources.getBoolean(R.bool.bottom_sheet_collapsible)