Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/AppTransitionAnimationSpecsFuture.java +8 −5 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.view.AppTransitionAnimationSpec; import android.view.IAppTransitionAnimationSpecsFuture; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; /** Loading @@ -31,8 +32,10 @@ import java.util.concurrent.FutureTask; public abstract class AppTransitionAnimationSpecsFuture { private final Handler mHandler; private FutureTask<List<AppTransitionAnimationSpec>> mComposeTask = new FutureTask<>(() -> { synchronized (AppTransitionAnimationSpecsFuture.this) { private FutureTask<List<AppTransitionAnimationSpec>> mComposeTask = new FutureTask<>( new Callable<List<AppTransitionAnimationSpec>>() { @Override public List<AppTransitionAnimationSpec> call() throws Exception { return composeSpecs(); } }); Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/RecentsTransition.java +21 −13 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class RecentsTransition { */ public static ActivityOptions createAspectScaleAnimation(Context context, Handler handler, boolean scaleUp, AppTransitionAnimationSpecsFuture animationSpecsFuture, OnAnimationStartedListener animationStartCallback) { final OnAnimationStartedListener animationStartCallback) { final OnAnimationStartedListener animStartedListener = new OnAnimationStartedListener() { private boolean mHandled; Loading Loading @@ -70,15 +70,20 @@ public class RecentsTransition { /** * Wraps a animation-start callback in a binder that can be called from window manager. */ public static IRemoteCallback wrapStartedListener(Handler handler, OnAnimationStartedListener listener) { public static IRemoteCallback wrapStartedListener(final Handler handler, final OnAnimationStartedListener listener) { if (listener == null) { return null; } return new IRemoteCallback.Stub() { @Override public void sendResult(Bundle data) throws RemoteException { handler.post(listener::onAnimationStarted); handler.post(new Runnable() { @Override public void run() { listener.onAnimationStarted(); } }); } }; } Loading @@ -87,9 +92,11 @@ public class RecentsTransition { * @return a {@link GraphicBuffer} with the {@param view} drawn into it. Result can be null if * we were unable to allocate a hardware bitmap. */ public static GraphicBuffer drawViewIntoGraphicBuffer(int width, int height, View view, float scale, int eraseColor) { final Bitmap hwBitmap = createHardwareBitmap(width, height, (c) -> { public static GraphicBuffer drawViewIntoGraphicBuffer(int width, int height, final View view, final float scale, final int eraseColor) { final Bitmap hwBitmap = createHardwareBitmap(width, height, new Consumer<Canvas>() { @Override public void accept(Canvas c) { c.scale(scale, scale); if (eraseColor != 0) { c.drawColor(eraseColor); Loading @@ -97,6 +104,7 @@ public class RecentsTransition { if (view != null) { view.draw(c); } } }); return hwBitmap != null ? hwBitmap.createGraphicBufferHandle() : null; } Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/AppTransitionAnimationSpecsFuture.java +8 −5 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.view.AppTransitionAnimationSpec; import android.view.IAppTransitionAnimationSpecsFuture; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; /** Loading @@ -31,8 +32,10 @@ import java.util.concurrent.FutureTask; public abstract class AppTransitionAnimationSpecsFuture { private final Handler mHandler; private FutureTask<List<AppTransitionAnimationSpec>> mComposeTask = new FutureTask<>(() -> { synchronized (AppTransitionAnimationSpecsFuture.this) { private FutureTask<List<AppTransitionAnimationSpec>> mComposeTask = new FutureTask<>( new Callable<List<AppTransitionAnimationSpec>>() { @Override public List<AppTransitionAnimationSpec> call() throws Exception { return composeSpecs(); } }); Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/view/RecentsTransition.java +21 −13 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ public class RecentsTransition { */ public static ActivityOptions createAspectScaleAnimation(Context context, Handler handler, boolean scaleUp, AppTransitionAnimationSpecsFuture animationSpecsFuture, OnAnimationStartedListener animationStartCallback) { final OnAnimationStartedListener animationStartCallback) { final OnAnimationStartedListener animStartedListener = new OnAnimationStartedListener() { private boolean mHandled; Loading Loading @@ -70,15 +70,20 @@ public class RecentsTransition { /** * Wraps a animation-start callback in a binder that can be called from window manager. */ public static IRemoteCallback wrapStartedListener(Handler handler, OnAnimationStartedListener listener) { public static IRemoteCallback wrapStartedListener(final Handler handler, final OnAnimationStartedListener listener) { if (listener == null) { return null; } return new IRemoteCallback.Stub() { @Override public void sendResult(Bundle data) throws RemoteException { handler.post(listener::onAnimationStarted); handler.post(new Runnable() { @Override public void run() { listener.onAnimationStarted(); } }); } }; } Loading @@ -87,9 +92,11 @@ public class RecentsTransition { * @return a {@link GraphicBuffer} with the {@param view} drawn into it. Result can be null if * we were unable to allocate a hardware bitmap. */ public static GraphicBuffer drawViewIntoGraphicBuffer(int width, int height, View view, float scale, int eraseColor) { final Bitmap hwBitmap = createHardwareBitmap(width, height, (c) -> { public static GraphicBuffer drawViewIntoGraphicBuffer(int width, int height, final View view, final float scale, final int eraseColor) { final Bitmap hwBitmap = createHardwareBitmap(width, height, new Consumer<Canvas>() { @Override public void accept(Canvas c) { c.scale(scale, scale); if (eraseColor != 0) { c.drawColor(eraseColor); Loading @@ -97,6 +104,7 @@ public class RecentsTransition { if (view != null) { view.draw(c); } } }); return hwBitmap != null ? hwBitmap.createGraphicBufferHandle() : null; } Loading