From 7a13673828f088c179763e8621a94e334319f226 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 4 Jul 2017 03:28:52 -0400 Subject: Misc fixes * Remove experimental by default * Update theme * Update glide caching to reload with every version * Pause hidden searchview when not in use * Convert glide to glide app --- app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index cba6b878..aa84edf7 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -6,12 +6,14 @@ import android.net.Uri import android.widget.ImageView import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions +import com.bumptech.glide.signature.ApplicationVersionSignature import com.crashlytics.android.Crashlytics import com.crashlytics.android.answers.Answers import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader import com.mikepenz.materialdrawer.util.DrawerImageLoader import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.utils.CrashReportingTree +import com.pitchedapps.frost.utils.GlideApp import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.Showcase import com.raizlabs.android.dbflow.config.FlowConfig @@ -57,10 +59,16 @@ class FrostApp : Application() { super.onCreate() - //Drawer profile loading logic + /** + * Drawer profile loading logic + * Reload the image on every version update + */ DrawerImageLoader.init(object : AbstractDrawerImageLoader() { override fun set(imageView: ImageView, uri: Uri, placeholder: Drawable, tag: String) { - Glide.with(imageView.context).load(uri).apply(RequestOptions().placeholder(placeholder)).into(imageView) + val c = imageView.context + val old = GlideApp.with(c).load(uri).apply(RequestOptions().placeholder(placeholder)) + GlideApp.with(c).load(uri).apply(RequestOptions().signature(ApplicationVersionSignature.obtain(c))) + .thumbnail(old).into(imageView) } }) } -- cgit v1.2.3