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

Commit f8fcda56 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge changes from topic "revert-13271843-fade-whole-notifications-PISGWIOZNU"

* changes:
  Revert "Fade in notifications one by one"
  Revert "Clip view before shelf and leave the rest unclipped"
parents bbb9b5b5 ab7b2936
Loading
Loading
Loading
Loading
+2 −29
Original line number Diff line number Diff line
@@ -204,30 +204,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
        }
    }

    /**
     * @return whether to clip bottom of given view
     */
    private boolean shouldClipBottom(ExpandableView view) {
        final boolean showShelf = ((ShelfState) getViewState()).hasItemsInStableShelf;
        if (showShelf) {
            if (mAmbientState.isShadeOpening()) {
                final float viewEnd = view.getTranslationY()
                        + view.getActualHeight()
                        + mPaddingBetweenElements;
                final float finalShelfStart = mMaxLayoutHeight - getIntrinsicHeight();
                // While the shade is opening, only clip view if it overlaps with shelf;
                // otherwise leave view unclipped.
                if (viewEnd < finalShelfStart) {
                    return false;
                }
            }
            // Clip for scrolling.
            return true;
        }
        // Don't clip since we have enough space to show all views.
        return false;
    }

    /**
     * Update the shelf appearance based on the other notifications around it. This transforms
     * the icons from the notification area into the shelf.
@@ -369,9 +345,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
        clipTransientViews();

        setClipTopAmount(clipTopAmount);
        boolean isHidden = getViewState().hidden
                || clipTopAmount >= getIntrinsicHeight()
                || mAmbientState.isShadeOpening();
        boolean isHidden = getViewState().hidden || clipTopAmount >= getIntrinsicHeight();
        if (mShowNotificationShelf) {
            setVisibility(isHidden ? View.INVISIBLE : View.VISIBLE);
        }
@@ -494,8 +468,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
        } else {
            shouldClipOwnTop = view.showingPulsing();
        }
        if (shouldClipBottom(view)
                && viewEnd > notificationClipEnd && !shouldClipOwnTop
        if (viewEnd > notificationClipEnd && !shouldClipOwnTop
                && (mAmbientState.isShadeExpanded() || !isPinned)) {
            int clipBottomAmount = (int) (viewEnd - notificationClipEnd);
            if (isPinned) {
+0 −6
Original line number Diff line number Diff line
@@ -614,12 +614,6 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable {
        }
    }

    public void setShouldFadeForShadeOpen(boolean shouldFade) {
        if (!mViewState.gone) {
            mViewState.setShouldFadeForShadeOpen(shouldFade);
        }
    }

    /**
     * @return whether the current view doesn't add height to the overall content. This means that
     * if it is added to a list of items, its content will still have the same height.
+0 −10
Original line number Diff line number Diff line
@@ -88,12 +88,6 @@ public class ExpandableViewState extends ViewState {
    public boolean hideSensitive;
    public boolean belowSpeedBump;
    public boolean inShelf;
    public boolean shouldFadeForShadeOpen;

    @Override
    boolean shouldAnimateAlpha() {
        return shouldFadeForShadeOpen;
    }

    /**
     * A state indicating whether a headsup is currently fully visible, even when not scrolled.
@@ -177,10 +171,6 @@ public class ExpandableViewState extends ViewState {
        }
    }

    public void setShouldFadeForShadeOpen(boolean shouldFade) {
        shouldFadeForShadeOpen = shouldFade;
    }

    @Override
    public void animateTo(View child, AnimationProperties properties) {
        super.animateTo(child, properties);
+0 −1
Original line number Diff line number Diff line
@@ -3947,7 +3947,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        int numChildren = getChildCount();
        for (int i = 0; i < numChildren; i++) {
            ExpandableView child = (ExpandableView) getChildAt(i);
            child.setShouldFadeForShadeOpen(mAmbientState.isShadeOpening());
            child.applyViewState();
        }

+5 −8
Original line number Diff line number Diff line
@@ -568,14 +568,11 @@ public class StackScrollAlgorithm {
            // Add padding before sections for overscroll effect.
            childViewState.yTranslation += ambientState.getSectionPadding();
        }
        boolean show = childViewState.yTranslation < shelfStart
                && !ambientState.isAppearing();
        childViewState.hidden = !show
                && !child.isExpandAnimationRunning()
                && !child.hasExpandingChild();
        childViewState.inShelf = !show;
        childViewState.headsUpIsVisible = show;
        childViewState.alpha = show ? 1f : 0f;
        if (childViewState.yTranslation >= shelfStart) {
            childViewState.hidden = !child.isExpandAnimationRunning() && !child.hasExpandingChild();
            childViewState.inShelf = true;
            childViewState.headsUpIsVisible = false;
        }
    }

    protected int getMaxAllowedChildHeight(View child) {
Loading