Created
April 20, 2020 04:56
-
-
Save jisungbin/69b8c6577862cf1e121fa4c76cb88e93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sungbin.autoreply.bot.three.utils.ui | |
import android.content.Context | |
import android.content.res.Resources | |
import android.graphics.Bitmap | |
import android.graphics.drawable.Drawable | |
import android.widget.ImageView | |
import com.bumptech.glide.Glide | |
import com.bumptech.glide.load.DecodeFormat | |
import com.bumptech.glide.load.engine.DiskCacheStrategy | |
object Glide { | |
fun set(context: Context, content: Drawable, view: ImageView) { | |
Glide.with(context) | |
.load(content) | |
.format(DecodeFormat.PREFER_ARGB_8888) | |
.diskCacheStrategy(DiskCacheStrategy.RESOURCE) | |
.skipMemoryCache(true) | |
.into(view) | |
} | |
fun set(context: Context, content: Resources, view: ImageView) { | |
Glide.with(context) | |
.load(content) | |
.format(DecodeFormat.PREFER_ARGB_8888) | |
.diskCacheStrategy(DiskCacheStrategy.RESOURCE) | |
.skipMemoryCache(true) | |
.into(view) | |
} | |
fun set(context: Context, content: String, view: ImageView) { | |
Glide.with(context) | |
.load(content) | |
.format(DecodeFormat.PREFER_ARGB_8888) | |
.diskCacheStrategy(DiskCacheStrategy.RESOURCE) | |
.skipMemoryCache(true) | |
.into(view) | |
} | |
fun set(context: Context, content: Bitmap, view: ImageView) { | |
Glide.with(context) | |
.load(content) | |
.format(DecodeFormat.PREFER_ARGB_8888) | |
.diskCacheStrategy(DiskCacheStrategy.RESOURCE) | |
.skipMemoryCache(true) | |
.into(view) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment