From 9aa7935590401e4fb206f721742b2def2f034c37 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 30 Nov 2017 20:39:51 +0100 Subject: [PATCH] update commons to 3.0.12 --- app/build.gradle | 2 +- app/src/main/kotlin/com/simplemobiletools/camera/App.kt | 9 ++------- .../simplemobiletools/camera/activities/MainActivity.kt | 2 +- .../camera/activities/SimpleActivity.kt | 7 +------ .../com/simplemobiletools/camera/extensions/context.kt | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 085d1faf..4f32efb1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.0.3' + implementation 'com.simplemobiletools:commons:3.0.12' debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion" releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion" diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/App.kt b/app/src/main/kotlin/com/simplemobiletools/camera/App.kt index 738c4fd3..da7fb5bf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/App.kt @@ -2,9 +2,8 @@ package com.simplemobiletools.camera import android.app.Application import com.simplemobiletools.camera.BuildConfig.USE_LEAK_CANARY -import com.simplemobiletools.camera.extensions.config +import com.simplemobiletools.commons.extensions.checkUseEnglish import com.squareup.leakcanary.LeakCanary -import java.util.* class App : Application() { override fun onCreate() { @@ -16,10 +15,6 @@ class App : Application() { LeakCanary.install(this) } - if (config.useEnglish) { - val conf = resources.configuration - conf.locale = Locale.ENGLISH - resources.updateConfiguration(conf, resources.displayMetrics) - } + checkUseEnglish() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt index 65afa73a..e4d54a87 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt @@ -54,6 +54,7 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave override fun onCreate(savedInstanceState: Bundle?) { useDynamicTheme = false super.onCreate(savedInstanceState) + appLaunched() requestWindowFeature(Window.FEATURE_NO_TITLE) window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) if (config.alwaysOpenBackCamera) @@ -62,7 +63,6 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave initVariables() tryInitCamera() supportActionBar?.hide() - storeStoragePaths() checkWhatsNewDialog() setupOrientationEventListener() } diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/SimpleActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/SimpleActivity.kt index 3ede69f9..2eb66505 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/SimpleActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/SimpleActivity.kt @@ -1,10 +1,5 @@ package com.simplemobiletools.camera.activities -import android.os.Bundle import com.simplemobiletools.commons.activities.BaseSimpleActivity -open class SimpleActivity : BaseSimpleActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - } -} +open class SimpleActivity : BaseSimpleActivity() diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/camera/extensions/context.kt index 4fa3626e..98f32636 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/extensions/context.kt @@ -8,7 +8,7 @@ import java.io.File import java.text.SimpleDateFormat import java.util.* -val Context.config: Config get() = Config.newInstance(this) +val Context.config: Config get() = Config.newInstance(applicationContext) internal val Context.windowManager: WindowManager get() = getSystemService(Context.WINDOW_SERVICE) as WindowManager