pull/1630/head
kunfei 3 years ago
parent 88e9de47a5
commit 0dfbc43f92
  1. 11
      app/src/main/java/io/legado/app/ui/widget/text/BadgeView.kt

@ -16,7 +16,7 @@ import androidx.appcompat.widget.AppCompatTextView
import io.legado.app.R
import io.legado.app.lib.theme.accentColor
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.gone
import io.legado.app.utils.invisible
import io.legado.app.utils.visible
@ -129,7 +129,7 @@ class BadgeView @JvmOverloads constructor(
*/
override fun setText(text: CharSequence, type: BufferType) {
if (isHideOnNull && TextUtils.isEmpty(text)) {
gone()
invisible()
} else {
visible()
}
@ -137,12 +137,7 @@ class BadgeView @JvmOverloads constructor(
}
fun setBadgeCount(count: Int) {
text = count.toString()
if (count == 0) {
gone()
} else {
visible()
}
text = if (count == 0) "" else count.toString()
}
fun setHighlight(highlight: Boolean) {

Loading…
Cancel
Save