Merge "Properly apply launch animation params" into tm-dev
This commit is contained in:
@@ -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,
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ import com.android.systemui.statusbar.EmptyShadeView;
|
||||
import com.android.systemui.statusbar.NotificationShelf;
|
||||
import com.android.systemui.statusbar.NotificationShelfController;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.notification.ExpandAnimationParameters;
|
||||
import com.android.systemui.statusbar.notification.LaunchAnimationParameters;
|
||||
import com.android.systemui.statusbar.notification.FakeShadowView;
|
||||
import com.android.systemui.statusbar.notification.NotificationLaunchAnimatorController;
|
||||
import com.android.systemui.statusbar.notification.NotificationUtils;
|
||||
@@ -515,7 +515,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
||||
/**
|
||||
* The current launch animation params when launching a notification
|
||||
*/
|
||||
private ExpandAnimationParameters mLaunchAnimationParams;
|
||||
private LaunchAnimationParameters mLaunchAnimationParams;
|
||||
|
||||
/**
|
||||
* Corner radii of the launched notification if it's clipped
|
||||
@@ -3016,7 +3016,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
||||
}
|
||||
|
||||
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
|
||||
public void applyExpandAnimationParams(ExpandAnimationParameters params) {
|
||||
public void applyLaunchAnimationParams(LaunchAnimationParameters params) {
|
||||
// Modify the clipping for launching notifications
|
||||
mLaunchAnimationParams = params;
|
||||
setLaunchingNotification(params != null);
|
||||
|
||||
@@ -83,7 +83,7 @@ import com.android.systemui.statusbar.RemoteInputController;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.ExpandAnimationParameters;
|
||||
import com.android.systemui.statusbar.notification.LaunchAnimationParameters;
|
||||
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
|
||||
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryListener;
|
||||
@@ -1733,8 +1733,8 @@ public class NotificationStackScrollLayoutController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyExpandAnimationParams(ExpandAnimationParameters params) {
|
||||
mView.applyExpandAnimationParams(params);
|
||||
public void applyLaunchAnimationParams(LaunchAnimationParameters params) {
|
||||
mView.applyLaunchAnimationParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user