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

Commit 567501e6 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge changes I29ce7659,I2d6310a2,Ic4b29409,I6c5c970f into nyc-dev am: 3952c3a2

am: 628c371c

Change-Id: I023b9d3b38be524f2e6af277a577fb1047faf790
parents 293fd9dc 628c371c
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
                }
    };
    private OnClickListener mOnClickListener;
    private boolean mHeadsupDisappearRunning;
    private View mChildAfterViewWhenDismissed;
    private View mGroupParentWhenDismissed;
    private boolean mRefocusOnDismiss;
@@ -759,15 +760,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        mRemoved = true;

        mPrivateLayout.setRemoved();
        if (mChildrenContainer != null) {
            mChildrenContainer.setRemoved();
        }
    }

    public NotificationChildrenContainer getChildrenContainer() {
        return mChildrenContainer;
    }

    public void setHeadsupDisappearRunning(boolean running) {
        mHeadsupDisappearRunning = running;
        mPrivateLayout.setHeadsupDisappearRunning(running);
    }

    public View getChildAfterViewWhenDismissed() {
        return mChildAfterViewWhenDismissed;
    }
@@ -1173,8 +1176,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            return getMinHeight();
        } else if (mIsSummaryWithChildren && !mOnKeyguard) {
            return mChildrenContainer.getIntrinsicHeight();
        } else if (mIsHeadsUp) {
            if (isPinned()) {
        } else if (mIsHeadsUp || mHeadsupDisappearRunning) {
            if (isPinned() || mHeadsupDisappearRunning) {
                return getPinnedHeadsUpHeight(true /* atLeastMinHeight */);
            } else if (isExpanded()) {
                return Math.max(getMaxExpandHeight(), mHeadsUpHeight);
@@ -1300,6 +1303,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        if (!animated) {
            mPublicLayout.animate().cancel();
            mPrivateLayout.animate().cancel();
            if (mChildrenContainer != null) {
                mChildrenContainer.animate().cancel();
                mChildrenContainer.setAlpha(1f);
            }
            mPublicLayout.setAlpha(1f);
            mPrivateLayout.setAlpha(1f);
            mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE);
+9 −2
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ public class NotificationContentView extends FrameLayout {

    private int mContentHeightAtAnimationStart = UNDEFINED;
    private boolean mFocusOnVisibilityChange;
    private boolean mHeadsupDisappearRunning;


    public NotificationContentView(Context context, AttributeSet attrs) {
@@ -446,7 +447,8 @@ public class NotificationContentView extends FrameLayout {
            boolean transitioningBetweenHunAndExpanded =
                    isTransitioningFromTo(VISIBLE_TYPE_HEADSUP, VISIBLE_TYPE_EXPANDED) ||
                    isTransitioningFromTo(VISIBLE_TYPE_EXPANDED, VISIBLE_TYPE_HEADSUP);
            boolean pinned = !isVisibleOrTransitioning(VISIBLE_TYPE_CONTRACTED) && mIsHeadsUp;
            boolean pinned = !isVisibleOrTransitioning(VISIBLE_TYPE_CONTRACTED)
                    && (mIsHeadsUp || mHeadsupDisappearRunning);
            if (transitioningBetweenHunAndExpanded || pinned) {
                return Math.min(mHeadsUpChild.getHeight(), mExpandedChild.getHeight());
            }
@@ -830,7 +832,7 @@ public class NotificationContentView extends FrameLayout {
            return VISIBLE_TYPE_SINGLELINE;
        }

        if (mIsHeadsUp && mHeadsUpChild != null) {
        if ((mIsHeadsUp || mHeadsupDisappearRunning) && mHeadsUpChild != null) {
            if (viewHeight <= mHeadsUpChild.getHeight() || noExpandedChild) {
                return VISIBLE_TYPE_HEADSUP;
            } else {
@@ -1153,6 +1155,11 @@ public class NotificationContentView extends FrameLayout {
        }
    }

    public void setHeadsupDisappearRunning(boolean headsupDisappearRunning) {
        mHeadsupDisappearRunning = headsupDisappearRunning;
        selectLayout(false /* animate */, true /* force */);
    }

    public void setFocusOnVisibilityChange() {
        mFocusOnVisibilityChange = true;
    }
+6 −6
Original line number Diff line number Diff line
@@ -213,18 +213,18 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged
        return isGroupSuppressed(getGroupKey(sbn)) && sbn.getNotification().isGroupSummary();
    }

    public boolean isOnlyChildInSuppressedGroup(StatusBarNotification sbn) {
        return isGroupSuppressed(sbn.getGroupKey())
                && isOnlyChild(sbn);
    }

    private boolean isOnlyChild(StatusBarNotification sbn) {
        return !sbn.getNotification().isGroupSummary()
                && getTotalNumberOfChildren(sbn) == 1;
    }

    public boolean isOnlyChildInGroup(StatusBarNotification sbn) {
        return isOnlyChild(sbn) && getLogicalGroupSummary(sbn) != null;
        if (!isOnlyChild(sbn)) {
            return false;
        }
        ExpandableNotificationRow logicalGroupSummary = getLogicalGroupSummary(sbn);
        return logicalGroupSummary != null
                && !logicalGroupSummary.getStatusBarNotification().equals(sbn);
    }

    private int getTotalNumberOfChildren(StatusBarNotification sbn) {
+0 −8
Original line number Diff line number Diff line
@@ -856,14 +856,6 @@ public class NotificationChildrenContainer extends ViewGroup {
                mNotificationParent.getNotificationColor());
    }

    public void setRemoved() {
        int childCount = mChildren.size();
        for (int i = 0; i < childCount; i++) {
            ExpandableNotificationRow child = mChildren.get(i);
            child.setRemoved();
        }
    }

    public int getPositionInLinearLayout(View childInGroup) {
        int position = mNotificationHeaderMargin + mNotificatonTopPadding;

+3 −0
Original line number Diff line number Diff line
@@ -3689,6 +3689,9 @@ public class NotificationStackScrollLayout extends ViewGroup
        if (mAnimationsEnabled) {
            mHeadsUpChangeAnimations.add(new Pair<>(row, isHeadsUp));
            mNeedsAnimation = true;
            if (!mIsExpanded && !isHeadsUp) {
                row.setHeadsupDisappearRunning(true);
            }
            requestChildrenUpdate();
        }
    }
Loading