Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

fix the bug of list item height changing. #16

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
}

Expand Down