image.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
layoutParams1 = (RelativeLayout.LayoutParams) image.getLayoutParams();
switch(event.getActionMasked())
{
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_UP:
x_cord = (int) event.getRawX();
if (x_cord la.getWidth()) {
x_cord= la.getWidth();
if(isCouponbuttonscroll==false){
isCouponbuttonscroll=true;
showDialog();
}
}
if (x_cord <windowwidth-la.getWidth()) {
x_cord =windowwidth-la.getWidth();
}
layoutParams1.leftMargin = x_cord -(image.getWidth()+0);
image.setLayoutParams(layoutParams1);
image.bringToFront();
image.setPadding(5, 5, 5, 5);
break;
}
return true;
}
});