Skip to content

Commit

Permalink
Added v3.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sendbird-sdk-deployment committed Mar 20, 2024
1 parent 3de1ff7 commit 8152cd2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 8152cd2

Please sign in to comment.