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

Commit b6e0e122 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where holes could occur in the new shade.

When a notification was never layouted before and it was the first
child, holes could occur in the shade when dragging down, because its
maximum allowed height was wrongly calculated.

Bug: 14080722
Change-Id: Ia10f9dd95f917d492411aec1da4ae0fc4d8f33d5
parent 21de56a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ public class ExpandableNotificationRow extends FrameLayout
        int oldHeight = lp.height;
        lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
        setLayoutParams(lp);
        measure(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), View.MeasureSpec.EXACTLY),
        measure(View.MeasureSpec.makeMeasureSpec(getWidth(), View.MeasureSpec.EXACTLY),
                View.MeasureSpec.makeMeasureSpec(mRowMaxHeight, View.MeasureSpec.AT_MOST));
        lp.height = oldHeight;
        setLayoutParams(lp);
+17 −1
Original line number Diff line number Diff line
@@ -533,8 +533,24 @@ public class StackScrollAlgorithm {
            } else {

                // We are expanding the shade, expand it to its full height.
                if (mFirstChildWhileExpanding.getWidth() == 0) {

                    // This child was not layouted yet, wait for a layout pass
                    mFirstChildWhileExpanding
                            .addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
                                @Override
                                public void onLayoutChange(View v, int left, int top, int right,
                                        int bottom, int oldLeft, int oldTop, int oldRight,
                                        int oldBottom) {
                                    mFirstChildMaxHeight = getMaxAllowedChildHeight(
                                            mFirstChildWhileExpanding);
                                    mFirstChildWhileExpanding.removeOnLayoutChangeListener(this);
                                }
                            });
                } else {
                    mFirstChildMaxHeight = getMaxAllowedChildHeight(mFirstChildWhileExpanding);
                }
            }
        } else {
            mFirstChildMaxHeight = 0;
        }