Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java +11 −5 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ import com.android.systemui.statusbar.phone.CollapsedStatusBarFragment; import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; import java.util.concurrent.Executor; /** * A class that allows activities to be launched in a seamless way where the notification * transforms nicely into the starting window. Loading @@ -59,6 +61,7 @@ public class ActivityLaunchAnimator { private final float mWindowCornerRadius; private final NotificationShadeWindowViewController mNotificationShadeWindowViewController; private final NotificationShadeDepthController mDepthController; private final Executor mMainExecutor; private Callback mCallback; private final Runnable mTimeoutRunnable = () -> { setAnimationPending(false); Loading @@ -73,12 +76,14 @@ public class ActivityLaunchAnimator { Callback callback, NotificationPanelViewController notificationPanel, NotificationShadeDepthController depthController, NotificationListContainer container) { NotificationListContainer container, Executor mainExecutor) { mNotificationPanel = notificationPanel; mNotificationContainer = container; mDepthController = depthController; mNotificationShadeWindowViewController = notificationShadeWindowViewController; mCallback = callback; mMainExecutor = mainExecutor; mWindowCornerRadius = ScreenDecorationsUtils .getWindowCornerRadius(mNotificationShadeWindowViewController.getView() .getResources()); Loading Loading @@ -155,7 +160,7 @@ public class ActivityLaunchAnimator { RemoteAnimationTarget[] remoteAnimationWallpaperTargets, IRemoteAnimationFinishedCallback iRemoteAnimationFinishedCallback) throws RemoteException { mSourceNotification.post(() -> { mMainExecutor.execute(() -> { RemoteAnimationTarget primary = getPrimaryRemoteAnimationTarget( remoteAnimationTargets); if (primary == null) { Loading Loading @@ -191,8 +196,9 @@ public class ActivityLaunchAnimator { } } int targetWidth = primary.sourceContainerBounds.width(); int notificationHeight = mSourceNotification.getActualHeight() - mSourceNotification.getClipBottomAmount(); // If the notification panel is collapsed, the clip may be larger than the height. int notificationHeight = Math.max(mSourceNotification.getActualHeight() - mSourceNotification.getClipBottomAmount(), 0); int notificationWidth = mSourceNotification.getWidth(); anim.setDuration(ANIMATION_DURATION); anim.setInterpolator(Interpolators.LINEAR); Loading Loading @@ -292,7 +298,7 @@ public class ActivityLaunchAnimator { @Override public void onAnimationCancelled() throws RemoteException { mSourceNotification.post(() -> { mMainExecutor.execute(() -> { setAnimationPending(false); mCallback.onLaunchAnimationCancelled(); }); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -1275,7 +1275,7 @@ public class StatusBar extends SystemUI implements DemoMode, mActivityLaunchAnimator = new ActivityLaunchAnimator( mNotificationShadeWindowViewController, this, mNotificationPanelViewController, mNotificationShadeDepthControllerLazy.get(), (NotificationListContainer) mStackScroller); (NotificationListContainer) mStackScroller, mContext.getMainExecutor()); // TODO: inject this. mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanelViewController, Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimatorTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.NotificationShadeWindowView; import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; import com.android.systemui.util.concurrency.FakeExecutor; import com.android.systemui.util.time.FakeSystemClock; import org.junit.Assert; import org.junit.Before; Loading @@ -51,6 +53,7 @@ import org.mockito.junit.MockitoRule; @TestableLooper.RunWithLooper public class ActivityLaunchAnimatorTest extends SysuiTestCase { private final FakeExecutor mExecutor = new FakeExecutor(new FakeSystemClock()); private ActivityLaunchAnimator mLaunchAnimator; @Mock private ActivityLaunchAnimator.Callback mCallback; Loading Loading @@ -80,8 +83,8 @@ public class ActivityLaunchAnimatorTest extends SysuiTestCase { mCallback, mNotificationPanelViewController, mNotificationShadeDepthController, mNotificationContainer); mNotificationContainer, mExecutor); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java +11 −5 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ import com.android.systemui.statusbar.phone.CollapsedStatusBarFragment; import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; import java.util.concurrent.Executor; /** * A class that allows activities to be launched in a seamless way where the notification * transforms nicely into the starting window. Loading @@ -59,6 +61,7 @@ public class ActivityLaunchAnimator { private final float mWindowCornerRadius; private final NotificationShadeWindowViewController mNotificationShadeWindowViewController; private final NotificationShadeDepthController mDepthController; private final Executor mMainExecutor; private Callback mCallback; private final Runnable mTimeoutRunnable = () -> { setAnimationPending(false); Loading @@ -73,12 +76,14 @@ public class ActivityLaunchAnimator { Callback callback, NotificationPanelViewController notificationPanel, NotificationShadeDepthController depthController, NotificationListContainer container) { NotificationListContainer container, Executor mainExecutor) { mNotificationPanel = notificationPanel; mNotificationContainer = container; mDepthController = depthController; mNotificationShadeWindowViewController = notificationShadeWindowViewController; mCallback = callback; mMainExecutor = mainExecutor; mWindowCornerRadius = ScreenDecorationsUtils .getWindowCornerRadius(mNotificationShadeWindowViewController.getView() .getResources()); Loading Loading @@ -155,7 +160,7 @@ public class ActivityLaunchAnimator { RemoteAnimationTarget[] remoteAnimationWallpaperTargets, IRemoteAnimationFinishedCallback iRemoteAnimationFinishedCallback) throws RemoteException { mSourceNotification.post(() -> { mMainExecutor.execute(() -> { RemoteAnimationTarget primary = getPrimaryRemoteAnimationTarget( remoteAnimationTargets); if (primary == null) { Loading Loading @@ -191,8 +196,9 @@ public class ActivityLaunchAnimator { } } int targetWidth = primary.sourceContainerBounds.width(); int notificationHeight = mSourceNotification.getActualHeight() - mSourceNotification.getClipBottomAmount(); // If the notification panel is collapsed, the clip may be larger than the height. int notificationHeight = Math.max(mSourceNotification.getActualHeight() - mSourceNotification.getClipBottomAmount(), 0); int notificationWidth = mSourceNotification.getWidth(); anim.setDuration(ANIMATION_DURATION); anim.setInterpolator(Interpolators.LINEAR); Loading Loading @@ -292,7 +298,7 @@ public class ActivityLaunchAnimator { @Override public void onAnimationCancelled() throws RemoteException { mSourceNotification.post(() -> { mMainExecutor.execute(() -> { setAnimationPending(false); mCallback.onLaunchAnimationCancelled(); }); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −1 Original line number Diff line number Diff line Loading @@ -1275,7 +1275,7 @@ public class StatusBar extends SystemUI implements DemoMode, mActivityLaunchAnimator = new ActivityLaunchAnimator( mNotificationShadeWindowViewController, this, mNotificationPanelViewController, mNotificationShadeDepthControllerLazy.get(), (NotificationListContainer) mStackScroller); (NotificationListContainer) mStackScroller, mContext.getMainExecutor()); // TODO: inject this. mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanelViewController, Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimatorTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain import com.android.systemui.statusbar.phone.NotificationPanelViewController; import com.android.systemui.statusbar.phone.NotificationShadeWindowView; import com.android.systemui.statusbar.phone.NotificationShadeWindowViewController; import com.android.systemui.util.concurrency.FakeExecutor; import com.android.systemui.util.time.FakeSystemClock; import org.junit.Assert; import org.junit.Before; Loading @@ -51,6 +53,7 @@ import org.mockito.junit.MockitoRule; @TestableLooper.RunWithLooper public class ActivityLaunchAnimatorTest extends SysuiTestCase { private final FakeExecutor mExecutor = new FakeExecutor(new FakeSystemClock()); private ActivityLaunchAnimator mLaunchAnimator; @Mock private ActivityLaunchAnimator.Callback mCallback; Loading Loading @@ -80,8 +83,8 @@ public class ActivityLaunchAnimatorTest extends SysuiTestCase { mCallback, mNotificationPanelViewController, mNotificationShadeDepthController, mNotificationContainer); mNotificationContainer, mExecutor); } @Test Loading