I am developing an android application with custom layout as below with a button on left hand side of the screen by default on load of the page.
When user clicks swipe button from left to right. The application will display a custom layout as shown below. The custom layout is attached with the image button. When user move the image button from left to right. The custom layout is displaying on the screen. I can write the custom layout in xml file. The problem is I have no idea how to display the custom layout when I move the button from left to right.
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_MOVE){
// To Do
}
return true;
}
Inside the if statement you can get the x position for the current touch event through motionEvent.getX() method. Then you can translate the custom layout to that position. I am not sure whether that is the best approach or not. But I think it will serve your purpose.