feat: 优化代码

pull/142/head
kunfei 5 years ago
parent 6a5d381314
commit 19e2fa92c9
  1. 7
      app/src/main/java/io/legado/app/ui/widget/BatteryView.kt

@ -42,7 +42,12 @@ class BatteryView(context: Context, attrs: AttributeSet?) : AppCompatTextView(co
layout.getLineBottom(0) - 2.dp layout.getLineBottom(0) - 2.dp
) )
val dj = (outFrame.bottom - outFrame.top) / 3 val dj = (outFrame.bottom - outFrame.top) / 3
polar.set(outFrame.right, outFrame.top + dj, width - 1.dp, outFrame.bottom - dj) polar.set(
outFrame.right,
outFrame.top + dj,
width - 1.dp,
outFrame.bottom - dj
)
batteryPaint.style = Paint.Style.STROKE batteryPaint.style = Paint.Style.STROKE
canvas.drawRect(outFrame, batteryPaint) canvas.drawRect(outFrame, batteryPaint)
batteryPaint.style = Paint.Style.FILL batteryPaint.style = Paint.Style.FILL

Loading…
Cancel
Save