From 7257fc792668ece3c4e6f5c505c4389fe87bdb01 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 26 Apr 2017 23:04:01 +0200 Subject: [PATCH] pass the context instead of whole activity on a couple places --- .../simplemobiletools/gallery/extensions/activity.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt index 43a80582c..1f5128ffc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -169,7 +169,7 @@ fun Activity.hasNavBar(): Boolean { realWidth - displayWidth > 0 || realHeight - displayHeight > 0 } else { - val hasMenuKey = ViewConfiguration.get(this).hasPermanentMenuKey() + val hasMenuKey = ViewConfiguration.get(applicationContext).hasPermanentMenuKey() val hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK) !hasMenuKey && !hasBackKey } @@ -271,7 +271,7 @@ fun Activity.loadImage(path: String, target: MySquareImageView) { } fun Activity.loadPng(path: String, target: MySquareImageView) { - val builder = Glide.with(this) + val builder = Glide.with(applicationContext) .load(path) .asBitmap() .signature(getFileSignature(path)) @@ -283,7 +283,7 @@ fun Activity.loadPng(path: String, target: MySquareImageView) { } fun Activity.loadJpg(path: String, target: MySquareImageView) { - val builder = Glide.with(this) + val builder = Glide.with(applicationContext) .load(path) .signature(getFileSignature(path)) .diskCacheStrategy(DiskCacheStrategy.RESULT) @@ -294,7 +294,7 @@ fun Activity.loadJpg(path: String, target: MySquareImageView) { } fun Activity.loadAnimatedGif(path: String, target: MySquareImageView) { - val builder = Glide.with(this) + val builder = Glide.with(applicationContext) .load(path) .asGif() .signature(getFileSignature(path)) @@ -306,7 +306,7 @@ fun Activity.loadAnimatedGif(path: String, target: MySquareImageView) { } fun Activity.loadStaticGif(path: String, target: MySquareImageView) { - val builder = Glide.with(this) + val builder = Glide.with(applicationContext) .load(path) .asBitmap() .signature(getFileSignature(path))