How can I programmatically translate an arbitrary view without using an animation (android.view.animation.*)?
android.view.animation.*
API 11 introduced setTranslationX
setTranslationX
Yes, you can use TranslateAnimation. With fillAfter set to true your view will stay translated even after the animation ends. Here is an example:
TranslateAnimation anim=new TranslateAnimation(0, 0, 20, 20); anim.setFillAfter(true); anim.setDuration(0); yourView.startAnimation(anim);