2017-04-17 20:31:50 +02:00
|
|
|
package com.simplemobiletools.gallery
|
|
|
|
|
|
|
|
import android.app.Application
|
2017-09-27 21:50:42 +02:00
|
|
|
import com.github.ajalt.reprint.core.Reprint
|
2017-11-07 17:31:40 +01:00
|
|
|
import com.simplemobiletools.gallery.BuildConfig.USE_LEAK_CANARY
|
2017-11-08 12:08:36 +01:00
|
|
|
import com.simplemobiletools.gallery.extensions.config
|
2017-04-17 20:31:50 +02:00
|
|
|
import com.squareup.leakcanary.LeakCanary
|
2017-11-08 12:08:36 +01:00
|
|
|
import java.util.*
|
2017-04-17 20:31:50 +02:00
|
|
|
|
|
|
|
class App : Application() {
|
|
|
|
override fun onCreate() {
|
|
|
|
super.onCreate()
|
2017-07-09 09:28:26 +02:00
|
|
|
if (USE_LEAK_CANARY) {
|
|
|
|
if (LeakCanary.isInAnalyzerProcess(this)) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
LeakCanary.install(this)
|
2017-04-17 20:31:50 +02:00
|
|
|
}
|
2017-11-07 17:31:40 +01:00
|
|
|
|
2017-11-08 12:08:36 +01:00
|
|
|
if (config.useEnglish) {
|
|
|
|
val conf = resources.configuration
|
|
|
|
conf.locale = Locale.ENGLISH
|
|
|
|
resources.updateConfiguration(conf, resources.displayMetrics)
|
|
|
|
}
|
2017-11-07 17:31:40 +01:00
|
|
|
Reprint.initialize(this)
|
2017-04-17 20:31:50 +02:00
|
|
|
}
|
|
|
|
}
|