android - Skipping custom ViewGroup's child layout to improve perfomance -
i creating custom viewgroup
manual (touch) , animated resizing of it's child views
. resizing done re-calculating child view's
sizes , calling requestlayout()
, (on animation
):
@override protected void applytransformation(float interpolatedtime, transformation t) { (int = 0; < childlist.size; i++) { newsize[i] = startsize[i] + (int)(delta[i] * interpolatedtime); } requestlayout(); }
in onmeasure()
, onlayout()
apply calculated sizes. questions are: can skip child.measure()
in onmeasure()
and/or child.layout()
in onlayout()
if:
- child's size 0?
- child's size and/or position in
viewgroup
hasn't changed since last layout?
Comments
Post a Comment