mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-27 07:46:14 +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.annotation.SuppressLint
|
||||||
import android.content.ActivityNotFoundException
|
import android.content.ActivityNotFoundException
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.telephony.SubscriptionManager
|
import android.telephony.SubscriptionManager
|
||||||
@ -277,10 +279,12 @@ class ThreadAdapter(
|
|||||||
val imageView = layoutInflater.inflate(R.layout.item_attachment_image, null)
|
val imageView = layoutInflater.inflate(R.layout.item_attachment_image, null)
|
||||||
thread_mesage_attachments_holder.addView(imageView)
|
thread_mesage_attachments_holder.addView(imageView)
|
||||||
|
|
||||||
|
val placeholderDrawable = ColorDrawable(Color.TRANSPARENT)
|
||||||
val isTallImage = attachment.height > attachment.width
|
val isTallImage = attachment.height > attachment.width
|
||||||
val transformation = if (isTallImage) CenterCrop() else FitCenter()
|
val transformation = if (isTallImage) CenterCrop() else FitCenter()
|
||||||
val options = RequestOptions()
|
val options = RequestOptions()
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||||
|
.placeholder(placeholderDrawable)
|
||||||
.transform(transformation, RoundedCorners(roundedCornersRadius))
|
.transform(transformation, RoundedCorners(roundedCornersRadius))
|
||||||
|
|
||||||
var builder = Glide.with(context)
|
var builder = Glide.with(context)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user