1

I'm interested in knowing an animated view's current location at any given time. What's the best way to handle this?

int[] loc = new int[2]; 
MyListView.this.findViewById(R.id.tvTop).getLocationInWindow(loc);
final int tvTopX = loc[0];
Log.e("---xLocation---", Integer.toString(tvTopX));

This seems to trace the same value, even after an animation. Do I need to invalidate or something to get the location value to update? Thanks, any help is appreciated!

worked
  • 5,762
  • 5
  • 54
  • 79
  • 1
    [This](http://stackoverflow.com/questions/2638342/incorrect-coordinates-from-getlocationonscreen-getlocationinwindow) maybe covers your needs, too. – Lukas Knuth Aug 22 '11 at 20:36
  • Thanks for responding. That's actually where I got the code above. :) I'll post back if I find the solution. – worked Aug 22 '11 at 23:34

1 Answers1

0

In Android <3.0 animation not currently change view position. You can animate view by changing layout params to track current position or use http://nineoldandroids.com/ for access Android 3.0 Animation API on older Android versions. Here is a link with description http://developer.android.com/guide/topics/graphics/prop-animation.html

Stepango
  • 4,721
  • 3
  • 31
  • 44