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

Commit cf836e50 authored by Omar Miatello's avatar Omar Miatello Committed by Automerger Merge Worker
Browse files

Merge changes I7f59d2a1,I9fc39c85,I8ba8af41 into udc-dev am: 76f56a4e

parents d109a0a4 76f56a4e
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -52,7 +52,6 @@ public class LegacyNotificationShelfControllerImpl implements NotificationShelfC
        mActivatableNotificationViewController = activatableNotificationViewController;
        mActivatableNotificationViewController = activatableNotificationViewController;
        mKeyguardBypassController = keyguardBypassController;
        mKeyguardBypassController = keyguardBypassController;
        mStatusBarStateController = statusBarStateController;
        mStatusBarStateController = statusBarStateController;
        mView.useRoundnessSourceTypes(true);
        mView.setSensitiveRevealAnimEndabled(featureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM));
        mView.setSensitiveRevealAnimEndabled(featureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM));
        mOnAttachStateChangeListener = new View.OnAttachStateChangeListener() {
        mOnAttachStateChangeListener = new View.OnAttachStateChangeListener() {
            @Override
            @Override
+4 −32
Original line number Original line Diff line number Diff line
@@ -44,7 +44,6 @@ import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
import com.android.systemui.shade.transition.LargeScreenShadeInterpolator;
import com.android.systemui.shade.transition.LargeScreenShadeInterpolator;
import com.android.systemui.statusbar.notification.LegacySourceType;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.SourceType;
import com.android.systemui.statusbar.notification.SourceType;
import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;
import com.android.systemui.statusbar.notification.row.ActivatableNotificationView;
@@ -128,13 +127,6 @@ public class NotificationShelf extends ActivatableNotificationView implements St
        setClipToPadding(false);
        setClipToPadding(false);
        mShelfIcons.setIsStaticLayout(false);
        mShelfIcons.setIsStaticLayout(false);
        requestRoundness(/* top = */ 1f, /* bottom = */ 1f, BASE_VALUE, /* animate = */ 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();
        updateResources();
    }
    }


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


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

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


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


    private boolean isViewAffectedBySwipe(ExpandableView expandableView) {
    private boolean isViewAffectedBySwipe(ExpandableView expandableView) {
@@ -1100,15 +1081,6 @@ public class NotificationShelf extends ActivatableNotificationView implements St
        child.requestRoundnessReset(SHELF_SCROLL);
        child.requestRoundnessReset(SHELF_SCROLL);
    }
    }


    /**
     * This method resets the OnScroll roundness of a view to 0f
     * <p>
     * Note: This should be the only class that handles roundness {@code SourceType.OnScroll}
     */
    public static void resetLegacyOnScrollRoundness(ExpandableView expandableView) {
        expandableView.requestRoundnessReset(LegacySourceType.OnScroll);
    }

    @Override
    @Override
    public void dump(PrintWriter pwOriginal, String[] args) {
    public void dump(PrintWriter pwOriginal, String[] args) {
        IndentingPrintWriter pw = DumpUtilsKt.asIndenting(pwOriginal);
        IndentingPrintWriter pw = DumpUtilsKt.asIndenting(pwOriginal);
+0 −5
Original line number Original line Diff line number Diff line
@@ -87,13 +87,8 @@ constructor(
            bypassController.isPulseExpanding = value
            bypassController.isPulseExpanding = value
            if (changed) {
            if (changed) {
                if (value) {
                if (value) {
                    val topEntry = headsUpManager.topEntry
                    topEntry?.let {
                        roundnessManager.setTrackingHeadsUp(it.row)
                    }
                    lockscreenShadeTransitionController.onPulseExpansionStarted()
                    lockscreenShadeTransitionController.onPulseExpansionStarted()
                } else {
                } else {
                    roundnessManager.setTrackingHeadsUp(null)
                    if (!leavingLockscreen) {
                    if (!leavingLockscreen) {
                        bypassController.maybePerformPendingUnlock()
                        bypassController.maybePerformPendingUnlock()
                        pulseExpandAbortListener?.run()
                        pulseExpandAbortListener?.run()
+0 −7
Original line number Original line Diff line number Diff line
@@ -448,10 +448,3 @@ interface SourceType {
            }
            }
    }
    }
}
}

@Deprecated("Use SourceType.from() instead", ReplaceWith("SourceType.from()"))
enum class LegacySourceType : SourceType {
    DefaultValue,
    OnDismissAnimation,
    OnScroll,
}
+1 −10
Original line number Original line Diff line number Diff line
@@ -110,7 +110,6 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    protected Point mTargetPoint;
    protected Point mTargetPoint;
    private boolean mDismissed;
    private boolean mDismissed;
    private boolean mRefocusOnDismiss;
    private boolean mRefocusOnDismiss;
    protected boolean mUseRoundnessSourceTypes;


    public ActivatableNotificationView(Context context, AttributeSet attrs) {
    public ActivatableNotificationView(Context context, AttributeSet attrs) {
        super(context, attrs);
        super(context, attrs);
@@ -709,18 +708,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        mTouchHandler = touchHandler;
        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
    @Override
    protected void onDetachedFromWindow() {
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        super.onDetachedFromWindow();
        if (mUseRoundnessSourceTypes && !mOnDetachResetRoundness.isEmpty()) {
        if (!mOnDetachResetRoundness.isEmpty()) {
            for (SourceType sourceType : mOnDetachResetRoundness) {
            for (SourceType sourceType : mOnDetachResetRoundness) {
                requestRoundnessReset(sourceType);
                requestRoundnessReset(sourceType);
            }
            }
Loading