A movable view with removed callback.
((RemovableView) view).setOnRemoveCallback(new RemovableView.OnRemoveCallback() {
@Override
public void onRemove(View view) {
list.remove(getAdapterPosition());
notifyDataSetChanged();
}
});
//if moved distance more than 30% width of the view,it will remove automatically.
((RemovableView) view).setAutoRemoveMultiplier(0.3f);
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add the dependency:
dependencies {
compile 'com.github.YuanWenHai:MovableView:1.8'
}