I want to move a button with finger moving on and screen. but i can't found any help for this animations with finger motion. i make a fake call apps in which i want to make incoming call layout like below image. how i make a receive or decline button in android:
can i use on-touch event for this animation.
if (event.getAction()==MotionEvent.ACTION_MOVE) {
x=event.getX();
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(300, 60);
params.leftMargin = (int)x;
btnDeclinecall.setLayoutParams(params);
}
return false;
}
i use the above codes but it doesn't work for me