summaryrefslogtreecommitdiff
path: root/src/com/android/contacts/widget
diff options
context:
space:
mode:
authorBrian Attwell <brianattwell@google.com>2015-01-21 09:50:08 -0800
committerBrian Attwell <brianattwell@google.com>2015-01-22 12:37:29 -0800
commit245d3d2000150cbb21111370f42addaeeb1b10a0 (patch)
treecbabf1b9e387f06417496232a7de0bf0bff15809 /src/com/android/contacts/widget
parent83e3a1cc848e9ea788f32e2d7ca812de106887e5 (diff)
downloadContacts-245d3d2000150cbb21111370f42addaeeb1b10a0.tar.gz
Remove call to hidden suppressLayout()
suppressLayout was previously called as a work around for using BoundsChange. BoundsChange is designed for animations without layout changes. Two changes are need to to avoid using suppressLayout 1. Don't use the BoundsChange Transition when collapsing the card. This animation involves an unavoidable layout change. 2. Don't allow user interaction during the expand animation. User interaction can cause layout changes during the animation. Discussion: The Transition API designers think that BoundsChange should never be used with layout changes (go/bounds-change-no-layout-change). Bug: 18777272 Change-Id: Ie09cc8063f81ca451c00289b5d7b5a39886b0c27
Diffstat (limited to 'src/com/android/contacts/widget')
-rw-r--r--src/com/android/contacts/widget/MultiShrinkScroller.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/com/android/contacts/widget/MultiShrinkScroller.java b/src/com/android/contacts/widget/MultiShrinkScroller.java
index 7b97643cd..7c46a86c9 100644
--- a/src/com/android/contacts/widget/MultiShrinkScroller.java
+++ b/src/com/android/contacts/widget/MultiShrinkScroller.java
@@ -17,7 +17,6 @@ import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
-import android.graphics.Rect;
import android.graphics.drawable.GradientDrawable;
import android.hardware.display.DisplayManager;
import android.os.Trace;
@@ -140,6 +139,7 @@ public class MultiShrinkScroller extends FrameLayout {
*/
private boolean mHasEverTouchedTheTop;
private boolean mIsTouchDisabledForDismissAnimation;
+ private boolean mIsTouchDisabledForSuppressLayout;
private final Scroller mScroller;
private final EdgeEffect mEdgeGlowBottom;
@@ -405,7 +405,8 @@ public class MultiShrinkScroller extends FrameLayout {
}
private boolean shouldStartDrag(MotionEvent event) {
- if (mIsTouchDisabledForDismissAnimation) return false;
+ if (mIsTouchDisabledForDismissAnimation || mIsTouchDisabledForSuppressLayout) return false;
+
if (mIsBeingDragged) {
mIsBeingDragged = false;
@@ -441,7 +442,7 @@ public class MultiShrinkScroller extends FrameLayout {
@Override
public boolean onTouchEvent(MotionEvent event) {
- if (mIsTouchDisabledForDismissAnimation) return true;
+ if (mIsTouchDisabledForDismissAnimation || mIsTouchDisabledForSuppressLayout) return true;
final int action = event.getAction();
@@ -1285,12 +1286,6 @@ public class MultiShrinkScroller extends FrameLayout {
* space at the bottom of this ViewGroup.
*/
public void prepareForShrinkingScrollChild(int heightDelta) {
- // The Transition framework may suppress layout on the scene root and its children. If
- // mScrollView has its layout suppressed, user scrolling interactions will not display
- // correctly. By turning suppress off for mScrollView, mScrollView properly adjusts its
- // graphics as the user scrolls during the transition.
- mScrollView.suppressLayout(false);
-
final int newEmptyScrollViewSpace = -getOverflowingChildViewSize() + heightDelta;
if (newEmptyScrollViewSpace > 0 && !mIsTwoPanel) {
final int newDesiredToolbarHeight = Math.min(getToolbarHeight()
@@ -1300,11 +1295,13 @@ public class MultiShrinkScroller extends FrameLayout {
}
}
- public void prepareForExpandingScrollChild() {
- // The Transition framework may suppress layout on the scene root and its children. If
- // mScrollView has its layout suppressed, user scrolling interactions will not display
- // correctly. By turning suppress off for mScrollView, mScrollView properly adjusts its
- // graphics as the user scrolls during the transition.
- mScrollView.suppressLayout(false);
+ /**
+ * If {@param areTouchesDisabled} is TRUE, ignore all of the user's touches.
+ */
+ public void setDisableTouchesForSuppressLayout(boolean areTouchesDisabled) {
+ // The card expansion animation uses the Transition framework's ChangeBounds API. This
+ // invokes suppressLayout(true) on the MultiShrinkScroller. As a result, we need to avoid
+ // all layout changes during expansion in order to avoid weird layout artifacts.
+ mIsTouchDisabledForSuppressLayout = areTouchesDisabled;
}
}