You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to say to leave this method clean, try to move any instantiation of values or heavy operations to out of the scope of this element. You can reduce the CPU and battery usage doing this. This method was build just to read values and draw on canvas.
Of course, this is not a problem:
voidonDraw(Canvascanvas) {
canvas.draw(x + diff, y + diff, paint)
}
You can do it, the performance will be not affected when the calculation of values is not that heavy.
To create some values based on the bounds of its view, you can use the method onLayout(...).
The text was updated successfully, but these errors were encountered:
Hi Harjot.
I would like to say to leave this method clean, try to move any instantiation of values or heavy operations to out of the scope of this element. You can reduce the CPU and battery usage doing this. This method was build just to read values and draw on canvas.
Of course, this is not a problem:
You can do it, the performance will be not affected when the calculation of values is not that heavy.
To create some values based on the bounds of its view, you can use the method
onLayout(...)
.The text was updated successfully, but these errors were encountered: