From 1e69561e847484e665b96f3b2c88b2aa6ddc8a34 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 6 Nov 2017 23:54:31 +0100 Subject: [PATCH] use applicationContext at getting a Config instance --- .../com/simplemobiletools/gallery/extensions/context.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index d4b01c633..b6d19504f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -5,17 +5,12 @@ import android.content.Intent import android.content.res.Configuration import android.graphics.Point import android.media.AudioManager -import android.net.Uri import android.os.Build import android.view.WindowManager -import com.simplemobiletools.commons.extensions.getFilePublicUri -import com.simplemobiletools.commons.extensions.getMimeTypeFromPath import com.simplemobiletools.commons.extensions.humanizePath -import com.simplemobiletools.gallery.BuildConfig import com.simplemobiletools.gallery.activities.SettingsActivity import com.simplemobiletools.gallery.helpers.Config import com.simplemobiletools.gallery.models.Directory -import java.io.File val Context.portrait get() = resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT val Context.audioManager get() = getSystemService(Context.AUDIO_SERVICE) as AudioManager @@ -55,7 +50,7 @@ fun Context.launchSettings() { startActivity(Intent(this, SettingsActivity::class.java)) } -val Context.config: Config get() = Config.newInstance(this) +val Context.config: Config get() = Config.newInstance(applicationContext) fun Context.movePinnedDirectoriesToFront(dirs: ArrayList): ArrayList { val foundFolders = ArrayList()