mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 16:58:39 +00:00
Remove unused sizeResId
This commit is contained in:
parent
b9f24bc4bd
commit
d24cfef3d1
@ -5,7 +5,6 @@ import android.util.AttributeSet
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.RelativeLayout
|
import android.widget.RelativeLayout
|
||||||
import androidx.annotation.DimenRes
|
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import network.loki.messenger.databinding.ViewProfilePictureBinding
|
import network.loki.messenger.databinding.ViewProfilePictureBinding
|
||||||
@ -77,8 +76,8 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||||||
val publicKey = publicKey ?: return
|
val publicKey = publicKey ?: return
|
||||||
val additionalPublicKey = additionalPublicKey
|
val additionalPublicKey = additionalPublicKey
|
||||||
if (additionalPublicKey != null) {
|
if (additionalPublicKey != null) {
|
||||||
setProfilePictureIfNeeded(binding.doubleModeImageView1, publicKey, displayName, R.dimen.small_profile_picture_size)
|
setProfilePictureIfNeeded(binding.doubleModeImageView1, publicKey, displayName)
|
||||||
setProfilePictureIfNeeded(binding.doubleModeImageView2, additionalPublicKey, additionalDisplayName, R.dimen.small_profile_picture_size)
|
setProfilePictureIfNeeded(binding.doubleModeImageView2, additionalPublicKey, additionalDisplayName)
|
||||||
binding.doubleModeImageViewContainer.visibility = View.VISIBLE
|
binding.doubleModeImageViewContainer.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
glide.clear(binding.doubleModeImageView1)
|
glide.clear(binding.doubleModeImageView1)
|
||||||
@ -86,14 +85,14 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||||||
binding.doubleModeImageViewContainer.visibility = View.INVISIBLE
|
binding.doubleModeImageViewContainer.visibility = View.INVISIBLE
|
||||||
}
|
}
|
||||||
if (additionalPublicKey == null && !isLarge) {
|
if (additionalPublicKey == null && !isLarge) {
|
||||||
setProfilePictureIfNeeded(binding.singleModeImageView, publicKey, displayName, R.dimen.medium_profile_picture_size)
|
setProfilePictureIfNeeded(binding.singleModeImageView, publicKey, displayName)
|
||||||
binding.singleModeImageView.visibility = View.VISIBLE
|
binding.singleModeImageView.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
glide.clear(binding.singleModeImageView)
|
glide.clear(binding.singleModeImageView)
|
||||||
binding.singleModeImageView.visibility = View.INVISIBLE
|
binding.singleModeImageView.visibility = View.INVISIBLE
|
||||||
}
|
}
|
||||||
if (additionalPublicKey == null && isLarge) {
|
if (additionalPublicKey == null && isLarge) {
|
||||||
setProfilePictureIfNeeded(binding.largeSingleModeImageView, publicKey, displayName, R.dimen.large_profile_picture_size)
|
setProfilePictureIfNeeded(binding.largeSingleModeImageView, publicKey, displayName)
|
||||||
binding.largeSingleModeImageView.visibility = View.VISIBLE
|
binding.largeSingleModeImageView.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
glide.clear(binding.largeSingleModeImageView)
|
glide.clear(binding.largeSingleModeImageView)
|
||||||
@ -101,7 +100,7 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setProfilePictureIfNeeded(imageView: ImageView, publicKey: String, displayName: String?, @DimenRes sizeResId: Int) {
|
private fun setProfilePictureIfNeeded(imageView: ImageView, publicKey: String, displayName: String?) {
|
||||||
if (publicKey.isNotEmpty()) {
|
if (publicKey.isNotEmpty()) {
|
||||||
val recipient = Recipient.from(context, Address.fromSerialized(publicKey), false)
|
val recipient = Recipient.from(context, Address.fromSerialized(publicKey), false)
|
||||||
if (profilePicturesCache.containsKey(publicKey) && profilePicturesCache[publicKey] == recipient.profileAvatar) return
|
if (profilePicturesCache.containsKey(publicKey) && profilePicturesCache[publicKey] == recipient.profileAvatar) return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user