pull/70/head
kunfei 5 years ago
parent 530c9b176d
commit f5873c6070
  1. 14
      app/src/main/java/io/legado/app/ui/widget/BadgeView.kt

@ -108,17 +108,9 @@ class BadgeView @JvmOverloads constructor(
} }
fun setBackground(dipRadius: Float, badgeColor: Int) { fun setBackground(dipRadius: Float, badgeColor: Int) {
val radius = dip2Px(dipRadius) val radius = dip2Px(dipRadius).toFloat()
val radiusArray = floatArrayOf( val radiusArray =
radius.toFloat(), floatArrayOf(radius, radius, radius, radius, radius, radius, radius, radius)
radius.toFloat(),
radius.toFloat(),
radius.toFloat(),
radius.toFloat(),
radius.toFloat(),
radius.toFloat(),
radius.toFloat()
)
val roundRect = RoundRectShape(radiusArray, null, null) val roundRect = RoundRectShape(radiusArray, null, null)
val bgDrawable = ShapeDrawable(roundRect) val bgDrawable = ShapeDrawable(roundRect)

Loading…
Cancel
Save