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

Commit 5d1a924d authored by Yining Liu's avatar Yining Liu Committed by Android (Google) Code Review
Browse files

Merge changes I770bf2f4,I0c97afeb,I30b36920 into main

* changes:
  Rename low-priority named parameters with notification view inflation
  Rename group header parameter
  Add minimized status setting for async group header and rename parameters
parents 388c2f42 cc08829a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -863,7 +863,7 @@ public class NotificationShelf extends ActivatableNotificationView {
        boolean isAppearing = row.isDrawingAppearAnimation() && !row.isInShelf();
        iconState.hidden = isAppearing
                || (view instanceof ExpandableNotificationRow
                && ((ExpandableNotificationRow) view).isLowPriority()
                && ((ExpandableNotificationRow) view).isMinimized()
                && mShelfIcons.areIconsOverflowing())
                || (transitionAmount == 0.0f && !iconState.isAnimating(icon))
                || row.isAboveShelf()
+1 −1
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ public class PreparationCoordinator implements Coordinator {

    NotifInflater.Params getInflaterParams(NotifUiAdjustment adjustment, String reason) {
        return new NotifInflater.Params(
                /* isLowPriority = */ adjustment.isMinimized(),
                /* isMinimized = */ adjustment.isMinimized(),
                /* reason = */ reason,
                /* showSnooze = */ adjustment.isSnoozeEnabled(),
                /* isChildInGroup = */ adjustment.isChildInGroup(),
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ interface NotifInflater {

    /** A class holding parameters used when inflating the notification row */
    class Params(
        val isLowPriority: Boolean,
        val isMinimized: Boolean,
        val reason: String,
        val showSnooze: Boolean,
        val isChildInGroup: Boolean = false,
+4 −4
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
            @Nullable NotificationRowContentBinder.InflationCallback inflationCallback) {
        final boolean useIncreasedCollapsedHeight =
                mMessagingUtil.isImportantMessaging(entry.getSbn(), entry.getImportance());
        final boolean isLowPriority = inflaterParams.isLowPriority();
        final boolean isMinimized = inflaterParams.isMinimized();

        // Set show snooze action
        row.setShowSnooze(inflaterParams.getShowSnooze());
@@ -252,7 +252,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
        params.requireContentViews(FLAG_CONTENT_VIEW_CONTRACTED);
        params.requireContentViews(FLAG_CONTENT_VIEW_EXPANDED);
        params.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight);
        params.setUseLowPriority(isLowPriority);
        params.setUseMinimized(isMinimized);

        if (screenshareNotificationHiding()
                ? inflaterParams.getNeedsRedaction()
@@ -275,7 +275,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
        if (AsyncGroupHeaderViewInflation.isEnabled()) {
            if (inflaterParams.isGroupSummary()) {
                params.requireContentViews(FLAG_GROUP_SUMMARY_HEADER);
                if (isLowPriority) {
                if (isMinimized) {
                    params.requireContentViews(FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER);
                }
            } else {
@@ -288,7 +288,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
        mRowContentBindStage.requestRebind(entry, en -> {
            mLogger.logRebindComplete(entry);
            row.setUsesIncreasedCollapsedHeight(useIncreasedCollapsedHeight);
            row.setIsLowPriority(isLowPriority);
            row.setIsMinimized(isMinimized);
            if (inflationCallback != null) {
                inflationCallback.onAsyncInflationFinished(en);
            }
+18 −14
Original line number Diff line number Diff line
@@ -327,7 +327,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private OnClickListener mExpandClickListener = new OnClickListener() {
        @Override
        public void onClick(View v) {
            if (!shouldShowPublic() && (!mIsLowPriority || isExpanded())
            if (!shouldShowPublic() && (!mIsMinimized || isExpanded())
                    && mGroupMembershipManager.isGroupSummary(mEntry)) {
                mGroupExpansionChanging = true;
                final boolean wasExpanded = mGroupExpansionManager.isGroupExpanded(mEntry);
@@ -382,7 +382,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private boolean mAboveShelf;
    private OnUserInteractionCallback mOnUserInteractionCallback;
    private NotificationGutsManager mNotificationGutsManager;
    private boolean mIsLowPriority;
    private boolean mIsMinimized;
    private boolean mUseIncreasedCollapsedHeight;
    private boolean mUseIncreasedHeadsUpHeight;
    private float mTranslationWhenRemoved;
@@ -467,7 +467,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            if (viewWrapper != null) {
                setIconAnimationRunningForChild(running, viewWrapper.getIcon());
            }
            NotificationViewWrapper lowPriWrapper = mChildrenContainer.getLowPriorityViewWrapper();
            NotificationViewWrapper lowPriWrapper = mChildrenContainer
                    .getMinimizedGroupHeaderWrapper();
            if (lowPriWrapper != null) {
                setIconAnimationRunningForChild(running, lowPriWrapper.getIcon());
            }
@@ -680,7 +681,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        if (color != Notification.COLOR_INVALID) {
            return color;
        } else {
            return mEntry.getContrastedColor(mContext, mIsLowPriority && !isExpanded(),
            return mEntry.getContrastedColor(mContext, mIsMinimized && !isExpanded(),
                    getBackgroundColorWithoutTint());
        }
    }
@@ -1545,7 +1546,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
     * Set the low-priority group notification header view
     * @param headerView header view to set
     */
    public void setLowPriorityGroupHeader(NotificationHeaderView headerView) {
    public void setMinimizedGroupHeader(NotificationHeaderView headerView) {
        NotificationChildrenContainer childrenContainer = getChildrenContainerNonNull();
        childrenContainer.setLowPriorityGroupHeader(
                /* headerViewLowPriority= */ headerView,
@@ -1664,16 +1665,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
    }

    public void setIsLowPriority(boolean isLowPriority) {
        mIsLowPriority = isLowPriority;
        mPrivateLayout.setIsLowPriority(isLowPriority);
    /**
     * Set if the row is minimized.
     */
    public void setIsMinimized(boolean isMinimized) {
        mIsMinimized = isMinimized;
        mPrivateLayout.setIsLowPriority(isMinimized);
        if (mChildrenContainer != null) {
            mChildrenContainer.setIsLowPriority(isLowPriority);
            mChildrenContainer.setIsMinimized(isMinimized);
        }
    }

    public boolean isLowPriority() {
        return mIsLowPriority;
    public boolean isMinimized() {
        return mIsMinimized;
    }

    public void setUsesIncreasedCollapsedHeight(boolean use) {
@@ -2050,7 +2054,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        mChildrenContainerStub = findViewById(R.id.child_container_stub);
        mChildrenContainerStub.setOnInflateListener((stub, inflated) -> {
            mChildrenContainer = (NotificationChildrenContainer) inflated;
            mChildrenContainer.setIsLowPriority(mIsLowPriority);
            mChildrenContainer.setIsMinimized(mIsMinimized);
            mChildrenContainer.setContainingNotification(ExpandableNotificationRow.this);
            mChildrenContainer.onNotificationUpdated();
            mChildrenContainer.setLogger(mChildrenContainerLogger);
@@ -3435,7 +3439,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView

    private void onExpansionChanged(boolean userAction, boolean wasExpanded) {
        boolean nowExpanded = isExpanded();
        if (mIsSummaryWithChildren && (!mIsLowPriority || wasExpanded)) {
        if (mIsSummaryWithChildren && (!mIsMinimized || wasExpanded)) {
            nowExpanded = mGroupExpansionManager.isGroupExpanded(mEntry);
        }
        if (nowExpanded != wasExpanded) {
@@ -3492,7 +3496,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        if (!expandable) {
            if (mIsSummaryWithChildren) {
                expandable = true;
                if (!mIsLowPriority || isExpanded()) {
                if (!mIsMinimized || isExpanded()) {
                    isExpanded = isGroupExpanded();
                }
            } else {
Loading