ViewPropertyAnimators (http://developer.android.com/reference/android/view/ViewPropertyAnimator.html) have two types of methods to move Views around:
translateX() vs x(
x
refers to the current visual position of a view in the x-axis. So, for example, when you animate x
by calling view.animate().x(10)
, the view will be animated such that it moves to x=10
. Let's just assume that view was in a position of (100, 150) when you started the animation. By the end of the animation, the view will be in (10, 150).
Now, contrast this with translationX
. If you animate this property by calling view.animate().translationX(10)
, you are moving a view by that many pixels in the x-axis. Let's assume the same example, where the view was in a position of (100, 150) when you started the animation. By the end of the animation, the view will be in (110, 150).
Hope that clarifies the difference between x()
and translationX()
. The difference is the same for y()
and translationY()
, but in the y-axis.
In my view, xBy()
achieves the same effect as translationX()
but by using the x
property itself plus some mathematics. yBy()
and translationY()
are the equivalents in the y-axis.
Hope that clarifies...