mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
55ed40c4b4
commit
0045a3f98c
@ -74,10 +74,12 @@ class BatteryView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
|
||||
super.onLayout(changed, left, top, right, bottom)
|
||||
canvasRecorder.invalidate()
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
if (canvas.isHardwareAccelerated) {
|
||||
canvasRecorder.invalidate()
|
||||
}
|
||||
canvasRecorder.recordIfNeededThenDraw(canvas, width, height) {
|
||||
super.onDraw(this)
|
||||
if (!isBattery) return@recordIfNeededThenDraw
|
||||
|
Loading…
Reference in New Issue
Block a user