Android equivalent work-around for View.getX() before API 11?

Posted by user48998 on Stack Overflow See other posts from Stack Overflow or by user48998
Published on 2012-05-31T20:06:27Z Indexed on 2012/06/20 3:16 UTC
Read the original article Hit count: 253

Filed under:
|
|

I'm using the getX() and getY() method on a view for some special dragging logic (not animation, i.e. I never use setX/Y methods, I just need the getters to check).

However, I've come to realize that these are only available post-API 11.

The docs for getX() say that is it the addition of the 'left' property and the 'translationX' property. All well and good, except get/setTranslationX() is only around since API 11 as well.

I was wondering if there was any knowledge on what this method returns behind the scenes, so I could maybe put in a workaround.

Thanks for any help - Chase

© Stack Overflow or respective owner

Related posts about android

Related posts about android-view