Bug 1102275 - Use layout params height instead of the dismiss view's calculated height when resetting the original height. r=bnicholson, a=lsblakk
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 26 Nov 2014 15:57:25 -0800
changeset 234115 8aafebccd2abe82b7d1d78af05d7faf5c5989dd9
parent 234114 2d431a82b30da90ee2c48e74c7fc271f433e5f0d
child 234116 4ebb521ae031b2c6a52d7a8977036bbc0af750e2
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersbnicholson, lsblakk
bugs1102275
milestone35.0
Bug 1102275 - Use layout params height instead of the dismiss view's calculated height when resetting the original height. r=bnicholson, a=lsblakk
mobile/android/base/widget/SwipeDismissListViewTouchListener.java
--- a/mobile/android/base/widget/SwipeDismissListViewTouchListener.java
+++ b/mobile/android/base/widget/SwipeDismissListViewTouchListener.java
@@ -321,19 +321,19 @@ public class SwipeDismissListViewTouchLi
     /**
      * Animate the dismissed list item to zero-height and fire the dismiss callback when it finishes.
      *
      * @param dismissView     ListView item to dismiss
      * @param dismissPosition Position of dismissed item
      */
     private void performDismiss(final View dismissView, final int dismissPosition) {
         final ViewGroup.LayoutParams lp = dismissView.getLayoutParams();
-        final int originalHeight = dismissView.getHeight();
+        final int originalHeight = lp.height;
 
-        ValueAnimator animator = ValueAnimator.ofInt(originalHeight, 1).setDuration(mAnimationTime);
+        ValueAnimator animator = ValueAnimator.ofInt(dismissView.getHeight(), 1).setDuration(mAnimationTime);
 
         animator.addListener(new AnimatorListenerAdapter() {
             @Override
             public void onAnimationEnd(Animator animation) {
                 // Since the view is still a part of the ListView, we can't reset the animated
                 // properties yet; otherwise, the view would briefly reappear. Store the original
                 // height in the view's tag to flag it for the recycler. This is racy since the user
                 // could scroll the dismissed view off the screen, then back on the screen, before