I\'m trying to make a swipeable layout so you can swipe it to dismiss like in Google now. I managed to getting it worked on a view such as button using this codes:
S
This code worked for me. I was able to Swipe-dismiss Relative and Linear Layouts. Just make sure you call the removeView() method from the correct immediate parent layout.
@Override
public void onDismiss(View view, Object token) {
ViewGroup parent=(ViewGroup)dissmissableLayout.getParent();
parent.removeView(dismissableLayout);
}