Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48867214 authored by Adam Cohen's avatar Adam Cohen
Browse files

Fixing bug where StackView doesn't clip it's children correctly

Change-Id: Icb051fa355c5c1b92f81d56f04efd4f8699c65a4
parent ae34a7cd
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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));