diff --git a/EnhancedListView/src/main/java/de/timroes/android/listview/EnhancedListView.java b/EnhancedListView/src/main/java/de/timroes/android/listview/EnhancedListView.java index 69e566d..5013ac1 100644 --- a/EnhancedListView/src/main/java/de/timroes/android/listview/EnhancedListView.java +++ b/EnhancedListView/src/main/java/de/timroes/android/listview/EnhancedListView.java @@ -748,6 +748,11 @@ private void performDismiss(final View dismissView, final View listItemView, fin final ViewGroup.LayoutParams lp = listItemView.getLayoutParams(); final int originalHeight = listItemView.getHeight(); + int nextChildPositionOffset = getHeaderViewsCount() + 1; + View childView = getChildAt(dismissPosition + nextChildPositionOffset - getFirstVisiblePosition()); + + final int nextChildItemHeight = (childView != null) ? childView.getMeasuredHeight(): 0; + ValueAnimator animator = ValueAnimator.ofInt(originalHeight, 1).setDuration(mAnimationTime); animator.addListener(new AnimatorListenerAdapter() { @@ -802,7 +807,7 @@ public void onAnimationEnd(Animator animation) { ViewHelper.setAlpha(pendingDismiss.view, 1f); ViewHelper.setTranslationX(pendingDismiss.view, 0); lp = pendingDismiss.childView.getLayoutParams(); - lp.height = originalHeight; + lp.height = nextChildItemHeight; pendingDismiss.childView.setLayoutParams(lp); }