2

I have a View in an Android application, which is used to show a graphic. This View is being animated by a translation animation, specified in an XML file. In my case, the translation is moving the View from right to left across the screen.

I'd like to be able to tell where on the screen the View is when a touch event occurs, but I can't find any method which would let me do this. I've tried View.getLeft() and View.getTop(), and I've tried getting position settings by overriding onLayoutChanged().

I can see that back in 2008 this sort of thing wasn't possible, but was planned:

http://code.google.com/p/android/issues/detail?id=321

...but can't see if it's ever made it into Android. Anyone know how I might do this?

Tom Hume
  • 499
  • 1
  • 6
  • 12
  • 2
    The problem is that those kinds of animations only affect the drawing of the View, not its actual position. See these almost duplicate questions: http://stackoverflow.com/questions/2125694/android-button-doesnt-respond-after-animation/2126285#2126285 and http://stackoverflow.com/questions/2367100/get-location-of-object-when-animation-is-complete-in-android. Unfortunately, as shown by the lack of responses to the latter question, people don't seem to know how to do it. – Steve Haley Mar 24 '10 at 14:08

0 Answers0