diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-03 00:22:10 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-03 00:22:10 -0700 |
commit | 5796566137995c8d244720f87ba85bce0e0d2f00 (patch) | |
tree | 1736e12182c7cf2769ad953029dc6a645b803802 /app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt | |
parent | bc197ad5769ee792d930ac5b634e1e9000230689 (diff) | |
download | frost-5796566137995c8d244720f87ba85bce0e0d2f00.tar.gz frost-5796566137995c8d244720f87ba85bce0e0d2f00.tar.bz2 frost-5796566137995c8d244720f87ba85bce0e0d2f00.zip |
css updates and beginning login migration
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index 068cf739..4c34ccfc 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -1,16 +1,23 @@ package com.pitchedapps.frost import android.app.Application +import android.content.Context +import android.graphics.drawable.Drawable +import android.net.Uri +import android.widget.ImageView +import com.bumptech.glide.Glide +import com.bumptech.glide.request.RequestOptions +import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader +import com.mikepenz.materialdrawer.util.DrawerImageLoader +import com.mikepenz.materialdrawer.util.DrawerUIUtils import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.utils.CrashReportingTree -import com.pitchedapps.frost.utils.GlideUtils import com.pitchedapps.frost.utils.Prefs import com.raizlabs.android.dbflow.config.FlowConfig import com.raizlabs.android.dbflow.config.FlowManager import timber.log.Timber import timber.log.Timber.DebugTree - /** * Created by Allan Wang on 2017-05-28. */ @@ -21,9 +28,22 @@ class FrostApp : Application() { else Timber.plant(CrashReportingTree()) FlowManager.init(FlowConfig.Builder(this).build()) Prefs(this) - GlideUtils(this) FbCookie() super.onCreate() + + //Drawer profile loading logic + 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) + } + + override fun placeholder(ctx: Context, tag: String): Drawable { + when (tag) { + DrawerImageLoader.Tags.PROFILE.name, DrawerImageLoader.Tags.ACCOUNT_HEADER.name -> DrawerUIUtils.getPlaceHolder(ctx) + } + return super.placeholder(ctx, tag); + } + }) } |