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

Properly reset list item height after animation #14

Merged
merged 1 commit into from
Dec 22, 2013
Merged
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 @@ -746,8 +746,9 @@ && velocityY < velocityX && mSwiping && isSwipeDirectionValid(mVelocityTracker.g
private void performDismiss(final View dismissView, final View listItemView, final int dismissPosition) {

final ViewGroup.LayoutParams lp = listItemView.getLayoutParams();
final int originalHeight = listItemView.getHeight();
final int originalLayoutHeight = lp.height;

int originalHeight = listItemView.getHeight();
ValueAnimator animator = ValueAnimator.ofInt(originalHeight, 1).setDuration(mAnimationTime);

animator.addListener(new AnimatorListenerAdapter() {
Expand Down Expand Up @@ -802,7 +803,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 = originalLayoutHeight;
pendingDismiss.childView.setLayoutParams(lp);
}

Expand Down Expand Up @@ -900,4 +901,4 @@ private boolean isSwipeDirectionValid(float deltaX) {
}

}
}
}