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

Commit c062b877 authored by omarmt's avatar omarmt
Browse files

Flag roundness/2: Remove methods/properties

Remove mUseRoundnessSourceTypes, useRoundnessSourceTypes, useRoundnessSourceTypes()

Test: mp droid
Bug: 271843089
Change-Id: I8ba8af4186df499414111b78c96a8f8d212c2ad8
parent f6adbe0d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ public class LegacyNotificationShelfControllerImpl implements NotificationShelfC
        mActivatableNotificationViewController = activatableNotificationViewController;
        mKeyguardBypassController = keyguardBypassController;
        mStatusBarStateController = statusBarStateController;
        mView.useRoundnessSourceTypes(true);
        mView.setSensitiveRevealAnimEndabled(featureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM));
        mOnAttachStateChangeListener = new View.OnAttachStateChangeListener() {
            @Override
+4 −22
Original line number Diff line number Diff line
@@ -128,13 +128,6 @@ public class NotificationShelf extends ActivatableNotificationView implements St
        setClipToPadding(false);
        mShelfIcons.setIsStaticLayout(false);
        requestRoundness(/* top = */ 1f, /* bottom = */ 1f, BASE_VALUE, /* animate = */ false);

        if (!mUseRoundnessSourceTypes) {
            // Setting this to first in section to get the clipping to the top roundness correct.
            // This value determines the way we are clipping to the top roundness of the overall
            // shade
            setFirstInSection(true);
        }
        updateResources();
    }

@@ -569,17 +562,8 @@ public class NotificationShelf extends ActivatableNotificationView implements St
                * mAmbientState.getExpansionFraction();
        final float cornerAnimationTop = shelfStart - cornerAnimationDistance;

        final SourceType sourceType;
        if (mUseRoundnessSourceTypes) {
            sourceType = SHELF_SCROLL;
        } else {
            sourceType = LegacySourceType.OnScroll;
        }

        final float topValue;
        if (!mUseRoundnessSourceTypes && anv.isFirstInSection()) {
            topValue = 1f;
        } else if (viewStart >= cornerAnimationTop) {
        if (viewStart >= cornerAnimationTop) {
            // Round top corners within animation bounds
            topValue = MathUtils.saturate(
                    (viewStart - cornerAnimationTop) / cornerAnimationDistance);
@@ -588,12 +572,10 @@ public class NotificationShelf extends ActivatableNotificationView implements St
            // Reset top and bottom corners outside of animation bounds.
            topValue = 0f;
        }
        anv.requestTopRoundness(topValue, sourceType, /* animate = */ false);
        anv.requestTopRoundness(topValue, SHELF_SCROLL, /* animate = */ false);

        final float bottomValue;
        if (!mUseRoundnessSourceTypes && anv.isLastInSection()) {
            bottomValue = 1f;
        } else if (viewEnd >= cornerAnimationTop) {
        if (viewEnd >= cornerAnimationTop) {
            // Round bottom corners within animation bounds
            bottomValue = MathUtils.saturate(
                    (viewEnd - cornerAnimationTop) / cornerAnimationDistance);
@@ -602,7 +584,7 @@ public class NotificationShelf extends ActivatableNotificationView implements St
            // Reset top and bottom corners outside of animation bounds.
            bottomValue = 0f;
        }
        anv.requestBottomRoundness(bottomValue, sourceType, /* animate = */ false);
        anv.requestBottomRoundness(bottomValue, SHELF_SCROLL, /* animate = */ false);
    }

    private boolean isViewAffectedBySwipe(ExpandableView expandableView) {
+1 −10
Original line number Diff line number Diff line
@@ -110,7 +110,6 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    protected Point mTargetPoint;
    private boolean mDismissed;
    private boolean mRefocusOnDismiss;
    protected boolean mUseRoundnessSourceTypes;

    public ActivatableNotificationView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -709,18 +708,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        mTouchHandler = touchHandler;
    }

    /**
     * Enable the support for rounded corner based on the SourceType
     * @param enabled true if is supported
     */
    public void useRoundnessSourceTypes(boolean enabled) {
        mUseRoundnessSourceTypes = enabled;
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        if (mUseRoundnessSourceTypes && !mOnDetachResetRoundness.isEmpty()) {
        if (!mOnDetachResetRoundness.isEmpty()) {
            for (SourceType sourceType : mOnDetachResetRoundness) {
                requestRoundnessReset(sourceType);
            }
+14 −66
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ import com.android.systemui.statusbar.StatusBarIconView;
import com.android.systemui.statusbar.notification.AboveShelfChangedListener;
import com.android.systemui.statusbar.notification.FeedbackIcon;
import com.android.systemui.statusbar.notification.LaunchAnimationParameters;
import com.android.systemui.statusbar.notification.LegacySourceType;
import com.android.systemui.statusbar.notification.NotificationFadeAware;
import com.android.systemui.statusbar.notification.NotificationLaunchAnimatorController;
import com.android.systemui.statusbar.notification.NotificationUtils;
@@ -866,9 +865,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
        onAttachedChildrenCountChanged();
        row.setIsChildInGroup(false, null);
        if (!mUseRoundnessSourceTypes) {
            row.requestBottomRoundness(0.0f, LegacySourceType.DefaultValue, /* animate = */ false);
        }
    }

    /**
@@ -884,10 +880,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            if (child.keepInParentForDismissAnimation()) {
                mChildrenContainer.removeNotification(child);
                child.setIsChildInGroup(false, null);
                if (!mUseRoundnessSourceTypes) {
                    LegacySourceType sourceType = LegacySourceType.DefaultValue;
                    child.requestBottomRoundness(0f, sourceType, /* animate = */ false);
                }
                child.setKeepInParentForDismissAnimation(false);
                logKeepInParentChildDetached(child);
                childCountChanged = true;
@@ -942,10 +934,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            mNotificationParent.updateBackgroundForGroupState();
        }
        updateBackgroundClipping();
        if (mUseRoundnessSourceTypes) {
        updateBaseRoundness();
    }
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
@@ -1054,7 +1044,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        if (isAboveShelf() != wasAboveShelf) {
            mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf);
        }
        if (mUseRoundnessSourceTypes) {
        if (pinned) {
            // Should be animated if someone explicitly set it to 0 and the row is shown.
            boolean animated = mAnimatePinnedRoundness && isShown();
@@ -1064,7 +1053,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            mAnimatePinnedRoundness = true;
        }
    }
    }

    @Override
    public boolean isPinned() {
@@ -1879,7 +1867,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
            mChildrenContainer.setIsLowPriority(mIsLowPriority);
            mChildrenContainer.setContainingNotification(ExpandableNotificationRow.this);
            mChildrenContainer.onNotificationUpdated();
            mChildrenContainer.useRoundnessSourceTypes(mUseRoundnessSourceTypes);

            mTranslateableViews.add(mChildrenContainer);
        });
@@ -2308,24 +2295,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        mBackgroundNormal.setExpandAnimationSize(params.getWidth(), actualHeight);
    }

    @Override
    public float getTopRoundness() {
        if (!mUseRoundnessSourceTypes && mExpandAnimationRunning) {
            return mTopRoundnessDuringLaunchAnimation;
        }

        return super.getTopRoundness();
    }

    @Override
    public float getBottomRoundness() {
        if (!mUseRoundnessSourceTypes && mExpandAnimationRunning) {
            return mBottomRoundnessDuringLaunchAnimation;
        }

        return super.getBottomRoundness();
    }

    public void setExpandAnimationRunning(boolean expandAnimationRunning) {
        if (expandAnimationRunning) {
            setAboveShelf(true);
@@ -3481,18 +3450,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView

    private void applyChildrenRoundness() {
        if (mIsSummaryWithChildren) {
            if (mUseRoundnessSourceTypes) {
            mChildrenContainer.requestRoundness(
                    /* top = */ getTopRoundness(),
                    /* bottom = */ getBottomRoundness(),
                    /* sourceType = */ FROM_PARENT,
                    /* animate = */ false);
            } else {
                mChildrenContainer.requestBottomRoundness(
                        getBottomRoundness(),
                        LegacySourceType.DefaultValue,
                        /* animate = */ false);
            }
        }
    }

@@ -3709,25 +3671,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
    }

    /**
     * Enable the support for rounded corner based on the SourceType
     * @param enabled true if is supported
     */
    @Override
    public void useRoundnessSourceTypes(boolean enabled) {
        super.useRoundnessSourceTypes(enabled);
        if (mChildrenContainer != null) {
            mChildrenContainer.useRoundnessSourceTypes(mUseRoundnessSourceTypes);
        }
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (mUseRoundnessSourceTypes) {
        updateBaseRoundness();
    }
    }

    /** Set whether this notification may show a snooze action. */
    public void setShowSnooze(boolean showSnooze) {
+0 −1
Original line number Diff line number Diff line
@@ -261,7 +261,6 @@ public class ExpandableNotificationRowController implements NotifViewController
                mStatusBarStateController.removeCallback(mStatusBarStateListener);
            }
        });
        mView.useRoundnessSourceTypes(true);
    }

    private final StatusBarStateController.StateListener mStatusBarStateListener =
Loading