mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-26 15:04:54 +01:00
use a transparent placeholder at loading mms images
This commit is contained in:
parent
5880fa3c85
commit
6349d18c62
@ -3,6 +3,8 @@ package com.simplemobiletools.smsmessenger.adapters
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.telephony.SubscriptionManager
|
||||
@ -277,10 +279,12 @@ class ThreadAdapter(
|
||||
val imageView = layoutInflater.inflate(R.layout.item_attachment_image, null)
|
||||
thread_mesage_attachments_holder.addView(imageView)
|
||||
|
||||
val placeholderDrawable = ColorDrawable(Color.TRANSPARENT)
|
||||
val isTallImage = attachment.height > attachment.width
|
||||
val transformation = if (isTallImage) CenterCrop() else FitCenter()
|
||||
val options = RequestOptions()
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.placeholder(placeholderDrawable)
|
||||
.transform(transformation, RoundedCorners(roundedCornersRadius))
|
||||
|
||||
var builder = Glide.with(context)
|
||||
|
Loading…
Reference in New Issue
Block a user