Friday, 9 August 2013

If inflater is not blocking, then how do I know when it's done?

If inflater is not blocking, then how do I know when it's done?

I have a situation where my inflation is fairly tasking (I'm populating a
custom date module, that has 3 spinners filled with cusom views, for
Month, Date, Year) and as a result the ViewFlipper that this
RelativeLayout is being inflated into skips 90% of its animation (the view
is supposed to slide in from the right, but instead just appears almost
entirely finished in its motion and just animates the last few pixels to
the Left).
I'm looking around and not seeing anything in the way of
onCompletedInflation or anything like that. But clearly either the the
inflate() or the addView() call is async because if it wasn't then there
would simply be a pause while it did its work and then the View would
animate in smoothly (as it does if the View is simply included in the
XML).
So, my question is, how do I prevent the animation from starting until I
know for sure that all the inflation and view addition has completed, so
that I can get a smooth Flipper animation, rather than just seeing the
last few "frames" of the animation after the Main thread has caught up
with all it's trying to do?

No comments:

Post a Comment