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

Commit

Permalink
Merge pull request #14 from cketti/reset_list_item_height
Browse files Browse the repository at this point in the history
Properly reset list item height after animation
  • Loading branch information
timroes committed Dec 22, 2013
2 parents 0c4386d + a12885f commit b08dcbe
Showing 1 changed file with 4 additions and 3 deletions.
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) {
}

}
}
}

0 comments on commit b08dcbe

Please sign in to comment.