I have a custom View
that draws a complex Path
. The dimensions of path elements are calculated using the view width and height.
I need a way to pre-create this path before onDraw
is called to "Avoid object allocations during draw/layout...", in a moment when the view width and height are already known.
What is the proper moment in the View lifecycle to do such pre-creation?
just override View.onSizeChanged
and do your initialization there