diff options
| author | Adam Cohen <adamcohen@google.com> | 2011-01-09 13:49:40 -0800 |
|---|---|---|
| committer | Adam Cohen <adamcohen@google.com> | 2011-01-10 10:04:01 -0800 |
| commit | 488672148c30b17c0ea7fa0f4af3897ad51c566c (patch) | |
| tree | 6ce860b9144a76844174e963cd43a1cb64b0cf08 /core/java/android/widget/StackView.java | |
| parent | ae34a7cd2d65fb89f1d4bffd6316d8b817a45da5 (diff) | |
Fixing bug where StackView doesn't clip it's children correctly
Change-Id: Icb051fa355c5c1b92f81d56f04efd4f8699c65a4
Diffstat (limited to 'core/java/android/widget/StackView.java')
| -rw-r--r-- | core/java/android/widget/StackView.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java index ed06deda3d65..0476d28fffdf 100644 --- a/core/java/android/widget/StackView.java +++ b/core/java/android/widget/StackView.java @@ -784,6 +784,18 @@ public class StackView extends AdapterViewAnimator { int stackDirection = (mStackMode == ITEMS_SLIDE_UP) ? 1 : -1; + // We need to prevent any clipping issues which may arise by setting a layer type. + // This doesn't come for free however, so we only want to enable it when required. + if (Float.compare(0f, mYProgress) != 0 && Float.compare(1.0f, mYProgress) != 0) { + if (mView.getLayerType() == LAYER_TYPE_NONE) { + mView.setLayerType(LAYER_TYPE_HARDWARE, null); + } + } else { + if (mView.getLayerType() != LAYER_TYPE_NONE) { + mView.setLayerType(LAYER_TYPE_NONE, null); + } + } + switch (mMode) { case NORMAL_MODE: viewLp.setVerticalOffset(Math.round(-r * stackDirection * mSlideAmount)); |
