INNER CODE UNIT · Java
cancel
cymcsg/UltimateRecyclerView · UltimateRecyclerView/ultimaterecyclerview/src/main/java/com/marshalchen/ultimaterecyclerview/DragDropTouchListener.java:222
private boolean cancel(MotionEvent event) {
reset();
return false;
}
private void reset() {
//Animate mobile view back to original position
final View view = getViewByPosition(mobileViewCurrentPos);
if (view != null && mobileView != null) {
float y = getViewRawCoords(view)[1];
mobileView.animate().y(y).setDuration(MOVE_DURATION).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setVisibility(View.VISIBLE);
if (mobileView != null) {
ViewGroup parent = (ViewGroup) mobileView.getParent();
parent.removeView(mobileView);
mobileView = null;