I am adding animation to the button, use .SetFillAfter (true) to save the last view on the screen. But I canโt name the function of the touch event by touching the Button on the screen more (but you can call it by touching the original position).
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:id ="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Move"
/>
</AbsoluteLayout>
anim = AnimationUtils.loadAnimation(this, R.anim.move);
anim.setInterpolator(this, android.R.anim.accelerate_decelerate_interpolator);
Lenny source
share