From 8152cd275b9175542023fea82ffa24a6d00e9221 Mon Sep 17 00:00:00 2001 From: "sha.sdk_deployment" Date: Wed, 20 Mar 2024 08:28:47 +0000 Subject: [PATCH] Added v3.14.1 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- .../sendbird/uikit/widgets/StatusFrameView.kt | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b446e3a4..25c1e15b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # Changelog +### v3.14.1 (Mar 20, 2024) with Chat SDK `v4.15.6` +* Fixed issue where the position of the empty icon was displayed incorrectly. ### v3.14.0 (Mar 19, 2024) with Chat SDK `v4.15.6` * A feedback feature has been added to give opinions on the message. * Added `setEmptyIcon(int)`, `setEmptyIcon(int, ColorStateList)`, `setEmptyText(int)`, and `setErrorText(int)` in `ChatNotificationChannelFragment`. diff --git a/gradle.properties b/gradle.properties index c8ede4fc..dcafcc80 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,5 +16,5 @@ org.gradle.jvmargs=-Xmx1536m # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -UIKIT_VERSION = 3.14.0 +UIKIT_VERSION = 3.14.1 UIKIT_VERSION_CODE = 1 diff --git a/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt b/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt index f5d7d48f..c1adb60f 100644 --- a/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt +++ b/uikit/src/main/java/com/sendbird/uikit/widgets/StatusFrameView.kt @@ -2,10 +2,12 @@ package com.sendbird.uikit.widgets import android.content.Context import android.content.res.ColorStateList +import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable import android.util.AttributeSet import android.view.LayoutInflater import android.widget.FrameLayout +import androidx.core.content.ContextCompat import com.sendbird.uikit.R import com.sendbird.uikit.databinding.SbViewStatusFrameBinding import com.sendbird.uikit.internal.extensions.setAppearance @@ -67,7 +69,12 @@ class StatusFrameView @JvmOverloads constructor( private fun setAlert(text: String?, icon: Drawable?, iconTint: ColorStateList?) { this.visibility = VISIBLE - binding.ivAlertIcon.setImageDrawable(DrawableUtils.setTintList(icon, iconTint)) + if (!isValidDrawable(icon)) { + binding.ivAlertIcon.visibility = GONE + } else { + binding.ivAlertIcon.visibility = VISIBLE + binding.ivAlertIcon.setImageDrawable(DrawableUtils.setTintList(icon, iconTint)) + } binding.ivAlertText.text = text binding.tvAction.setText(actionText) binding.actionPanel.visibility = if (showAction) VISIBLE else GONE @@ -77,6 +84,14 @@ class StatusFrameView @JvmOverloads constructor( } } + private fun isValidDrawable(drawable: Drawable?): Boolean { + val isTransparentColor = if (drawable is ColorDrawable) { + val transparent = ContextCompat.getColor(context, android.R.color.transparent) + drawable.color == transparent + } else false + return drawable != null && !isTransparentColor + } + init { val a = context.theme.obtainStyledAttributes(attrs, R.styleable.StatusComponent, defStyleAttr, 0) try {