Selectable renderer implementation (#1247)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -33,6 +33,8 @@ android {
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
jniDebuggable true
|
||||
debuggable true
|
||||
testCoverageEnabled true
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
@@ -46,6 +48,19 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions += "renderer"
|
||||
productFlavors {
|
||||
create("legacy") {
|
||||
dimension = "renderer"
|
||||
}
|
||||
create("drawable") {
|
||||
dimension = "renderer"
|
||||
}
|
||||
create("split") {
|
||||
dimension = "renderer"
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
@@ -78,7 +93,7 @@ dependencies {
|
||||
|
||||
implementation dependenciesList.okhttp3
|
||||
|
||||
implementation dependenciesList.leakCanary
|
||||
debugImplementation dependenciesList.leakCanary
|
||||
|
||||
androidTestImplementation dependenciesList.supportAnnotations
|
||||
androidTestImplementation dependenciesList.testRunner
|
||||
|
||||
@@ -11,4 +11,13 @@
|
||||
# GMS
|
||||
-dontnote com.google.android.gms.**
|
||||
|
||||
-keep class org.maplibre.android.testapp.model.customlayer.ExampleCustomLayer { *; }
|
||||
-keep class com.mapbox.mapboxsdk.testapp.model.customlayer.ExampleCustomLayer { *; }
|
||||
|
||||
# okhttp
|
||||
-dontwarn org.bouncycastle.jsse.BCSSLSocket
|
||||
-dontwarn org.bouncycastle.jsse.BCSSLParameters
|
||||
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
|
||||
-dontwarn org.conscrypt.*
|
||||
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
|
||||
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
|
||||
-dontwarn org.openjsse.net.ssl.OpenJSSE
|
||||
@@ -3,9 +3,10 @@ package org.maplibre.android.testapp.activity.maplayout
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import org.maplibre.android.maps.*
|
||||
import org.maplibre.android.testapp.R
|
||||
import org.maplibre.android.testapp.utils.NavUtils
|
||||
import com.mapbox.mapboxsdk.maps.*
|
||||
import com.mapbox.mapboxsdk.testapp.R
|
||||
import com.mapbox.mapboxsdk.testapp.utils.ApiKeyUtils
|
||||
import com.mapbox.mapboxsdk.testapp.utils.NavUtils
|
||||
|
||||
/**
|
||||
* Test activity showcasing a simple MapView without any MapboxMap interaction.
|
||||
@@ -18,11 +19,16 @@ class SimpleMapActivity : AppCompatActivity() {
|
||||
mapView = findViewById(R.id.mapView)
|
||||
mapView.onCreate(savedInstanceState)
|
||||
mapView.getMapAsync(
|
||||
OnMapReadyCallback { maplibreMap: MapLibreMap ->
|
||||
val styles = Style.getPredefinedStyles()
|
||||
if (styles != null && styles.size > 0) {
|
||||
val styleUrl = styles[0].url
|
||||
maplibreMap.setStyle(Style.Builder().fromUri(styleUrl))
|
||||
OnMapReadyCallback { mapboxMap: MapboxMap ->
|
||||
var key = ApiKeyUtils.getApiKey(applicationContext)
|
||||
if (key == null || key == "YOUR_API_KEY_GOES_HERE") {
|
||||
mapboxMap.setStyle(Style.Builder().fromUri("https://demotiles.maplibre.org/style.json"))
|
||||
} else {
|
||||
val styles = Style.getPredefinedStyles()
|
||||
if (styles != null && styles.size > 0) {
|
||||
val styleUrl = styles[0].url
|
||||
mapboxMap.setStyle(Style.Builder().fromUri(styleUrl))
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user