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

Commit fde81bf7 authored by Jay Aliomer's avatar Jay Aliomer Committed by Automerger Merge Worker
Browse files

Merge "Properly apply launch animation params" into tm-dev am: bfab1707 am:...

Merge "Properly apply launch animation params" into tm-dev am: bfab1707 am: d9355114 am: 0669161b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17776460



Change-Id: I47499e86dd3723acda2736f203503fdd15e56d6d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 95c3857c 0669161b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@ import com.android.systemui.animation.Interpolators
import com.android.systemui.animation.LaunchAnimator
import kotlin.math.min

/** Parameters for the notifications expand animations. */
class ExpandAnimationParameters(
/** Parameters for the notifications launch expanding animations. */
class LaunchAnimationParameters(
    top: Int,
    bottom: Int,
    left: Int,
+5 −5
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ class NotificationLaunchAnimatorController(
        } else {
            notification.currentBackgroundRadiusTop
        }
        val params = ExpandAnimationParameters(
        val params = LaunchAnimationParameters(
            top = windowTop,
            bottom = location[1] + height,
            left = location[0],
@@ -165,9 +165,9 @@ class NotificationLaunchAnimatorController(
        onFinishAnimationCallback?.run()
    }

    private fun applyParams(params: ExpandAnimationParameters?) {
        notification.applyExpandAnimationParams(params)
        notificationListContainer.applyExpandAnimationParams(params)
    private fun applyParams(params: LaunchAnimationParameters?) {
        notification.applyLaunchAnimationParams(params)
        notificationListContainer.applyLaunchAnimationParams(params)
    }

    override fun onLaunchAnimationProgress(
@@ -175,7 +175,7 @@ class NotificationLaunchAnimatorController(
        progress: Float,
        linearProgress: Float
    ) {
        val params = state as ExpandAnimationParameters
        val params = state as LaunchAnimationParameters
        params.progress = progress
        params.linearProgress = linearProgress

+24 −6
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.SmartReplyController;
import com.android.systemui.statusbar.StatusBarIconView;
import com.android.systemui.statusbar.notification.AboveShelfChangedListener;
import com.android.systemui.statusbar.notification.ExpandAnimationParameters;
import com.android.systemui.statusbar.notification.LaunchAnimationParameters;
import com.android.systemui.statusbar.notification.FeedbackIcon;
import com.android.systemui.statusbar.notification.NotificationFadeAware;
import com.android.systemui.statusbar.notification.NotificationLaunchAnimatorController;
@@ -367,8 +367,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    private SystemNotificationAsyncTask mSystemNotificationAsyncTask =
            new SystemNotificationAsyncTask();

    private float mTopRoundnessDuringExpandAnimation;
    private float mBottomRoundnessDuringExpandAnimation;
    private float mTopRoundnessDuringLaunchAnimation;
    private float mBottomRoundnessDuringLaunchAnimation;

    /**
     * Returns whether the given {@code statusBarNotification} is a system notification.
@@ -2130,7 +2130,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    }


    public void applyExpandAnimationParams(ExpandAnimationParameters params) {
    public void applyLaunchAnimationParams(LaunchAnimationParameters params) {
        if (params == null) {
            return;
        }
@@ -2195,13 +2195,31 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
        setTranslationY(top);

        mTopRoundnessDuringExpandAnimation = params.getTopCornerRadius() / mOutlineRadius;
        mBottomRoundnessDuringExpandAnimation = params.getBottomCornerRadius() / mOutlineRadius;
        mTopRoundnessDuringLaunchAnimation = params.getTopCornerRadius() / mOutlineRadius;
        mBottomRoundnessDuringLaunchAnimation = params.getBottomCornerRadius() / mOutlineRadius;
        invalidateOutline();

        mBackgroundNormal.setExpandAnimationSize(params.getWidth(), actualHeight);
    }

    @Override
    public float getCurrentTopRoundness() {
        if (mExpandAnimationRunning) {
            return mTopRoundnessDuringLaunchAnimation;
        }

        return super.getCurrentTopRoundness();
    }

    @Override
    public float getCurrentBottomRoundness() {
        if (mExpandAnimationRunning) {
            return mBottomRoundnessDuringLaunchAnimation;
        }

        return super.getCurrentBottomRoundness();
    }

    public void setExpandAnimationRunning(boolean expandAnimationRunning) {
        if (expandAnimationRunning) {
            setAboveShelf(true);
+0 −2
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@ import android.view.View;

import com.android.internal.util.ArrayUtils;
import com.android.systemui.R;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.notification.ExpandAnimationParameters;

/**
 * A view that can be used for both the dimmed and normal background of an notification.
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import android.view.ViewGroup;
import androidx.annotation.Nullable;

import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.statusbar.notification.ExpandAnimationParameters;
import com.android.systemui.statusbar.notification.LaunchAnimationParameters;
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
import com.android.systemui.statusbar.notification.VisibilityLocationProvider;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -175,7 +175,7 @@ public interface NotificationListContainer extends
    /**
     * Apply parameters of the expand animation to the layout
     */
    default void applyExpandAnimationParams(ExpandAnimationParameters params) {}
    default void applyLaunchAnimationParams(LaunchAnimationParameters params) {}

    default void setExpandingNotification(ExpandableNotificationRow row) {}

Loading