Upgrade libs and remove Jetifier (#218)
Co-authored-by: Birk Skyum <74932975+birkskyum@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
cafd4cbf24
commit
39574ed238
@@ -12,7 +12,6 @@ import com.mapbox.mapboxsdk.log.Logger
|
||||
import com.mapbox.mapboxsdk.testapp.utils.ApiKeyUtils
|
||||
import com.mapbox.mapboxsdk.testapp.utils.TileLoadingMeasurementUtils
|
||||
import com.mapbox.mapboxsdk.testapp.utils.TimberLogger
|
||||
import com.squareup.leakcanary.LeakCanary
|
||||
import timber.log.Timber
|
||||
import timber.log.Timber.DebugTree
|
||||
|
||||
@@ -26,24 +25,11 @@ import timber.log.Timber.DebugTree
|
||||
class MapLibreApplication : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (!initializeLeakCanary()) {
|
||||
return
|
||||
}
|
||||
initializeLogger()
|
||||
initializeStrictMode()
|
||||
initializeMapbox()
|
||||
}
|
||||
|
||||
protected fun initializeLeakCanary(): Boolean {
|
||||
if (LeakCanary.isInAnalyzerProcess(this)) {
|
||||
// This process is dedicated to LeakCanary for heap analysis.
|
||||
// You should not init your app in this process.
|
||||
return false
|
||||
}
|
||||
LeakCanary.install(this)
|
||||
return true
|
||||
}
|
||||
|
||||
private fun initializeLogger() {
|
||||
Logger.setLoggerDefinition(TimberLogger())
|
||||
if (BuildConfig.DEBUG) {
|
||||
|
||||
@@ -14,11 +14,8 @@ import com.google.gson.Gson
|
||||
import com.google.gson.JsonObject
|
||||
import com.mapbox.mapboxsdk.snapshotter.MapSnapshot
|
||||
import com.mapbox.mapboxsdk.snapshotter.MapSnapshotter
|
||||
import com.mapbox.mapboxsdk.testapp.activity.render.RenderTestActivity.LoadRenderDefinitionTask
|
||||
import com.mapbox.mapboxsdk.testapp.activity.render.RenderTestActivity.LoadRenderIgnoreTask
|
||||
import com.mapbox.mapboxsdk.testapp.activity.render.RenderTestActivity.OnRenderTestCompletionListener
|
||||
import com.mapbox.mapboxsdk.testapp.activity.render.RenderTestActivity.SaveResultToDiskTask
|
||||
import okio.Okio
|
||||
import okio.buffer
|
||||
import okio.source
|
||||
import timber.log.Timber
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
@@ -343,7 +340,7 @@ class RenderTestActivity : AppCompatActivity() {
|
||||
val ignores: MutableList<String> = ArrayList()
|
||||
try {
|
||||
assets.open(String.format("%s/ignores.json", TEST_BASE_PATH)).use { input ->
|
||||
val source = Okio.buffer(Okio.source(input))
|
||||
val source = input.source().buffer()
|
||||
val styleJson = source.readByteString().string(Charset.forName("utf-8"))
|
||||
val `object` = Gson().fromJson(styleJson, JsonObject::class.java)
|
||||
for ((key) in `object`.entrySet()) {
|
||||
@@ -368,7 +365,7 @@ class RenderTestActivity : AppCompatActivity() {
|
||||
test
|
||||
)
|
||||
).use { input ->
|
||||
val source = Okio.buffer(Okio.source(input))
|
||||
val source = input.source().buffer()
|
||||
styleJson = source.readByteString().string(Charset.forName("utf-8"))
|
||||
}
|
||||
} catch (exception: IOException) {
|
||||
|
||||
Reference in New Issue
Block a user