views:

29

answers:

1

I need to capture the absolute positions of some ImageViews to use as drop targets. I can't seem to find what event I need to put my code in to read the screen and get the Left(), Top() .. positions. I do not want monitor the inflation of each individual view. There must be some sort of onScreenFinsihed type of event, but I can't find it. onMeasure and onDraw seem to fire at the start of their work, I need to know when they are done. TIA.

+1  A: 

There is no such event. You can simply post a message/Runnable in the UI events queue at the beginning of a drawing sequence to have this message/Runnable executed after drawing is complete (see View.post(Runnable) for instance.) Also, getLeft/getTop return the correct value after measurement and layout, you don't need to wait for drawing to end to use them.

Romain Guy