Loading core/java/android/view/InsetsAnimationControlImpl.java +9 −7 Original line number Diff line number Diff line Loading @@ -127,16 +127,18 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll final Insets offset = Insets.subtract(mShownInsets, mPendingInsets); ArrayList<SurfaceParams> params = new ArrayList<>(); if (offset.left != 0) { updateLeashesForSide(INSET_SIDE_LEFT, offset.left, params, state); updateLeashesForSide(INSET_SIDE_LEFT, offset.left, mPendingInsets.left, params, state); } if (offset.top != 0) { updateLeashesForSide(INSET_SIDE_TOP, offset.top, params, state); updateLeashesForSide(INSET_SIDE_TOP, offset.top, mPendingInsets.top, params, state); } if (offset.right != 0) { updateLeashesForSide(INSET_SIDE_RIGHT, offset.right, params, state); updateLeashesForSide(INSET_SIDE_RIGHT, offset.right, mPendingInsets.right, params, state); } if (offset.bottom != 0) { updateLeashesForSide(INSET_SIDE_BOTTOM, offset.bottom, params, state); updateLeashesForSide(INSET_SIDE_BOTTOM, offset.bottom, mPendingInsets.bottom, params, state); } SyncRtSurfaceTransactionApplier applier = mTransactionApplierSupplier.get(); applier.scheduleApply(params.toArray(new SurfaceParams[params.size()])); Loading Loading @@ -171,7 +173,7 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll return Insets.max(Insets.min(insets, mShownInsets), mHiddenInsets); } private void updateLeashesForSide(@InsetSide int side, int inset, private void updateLeashesForSide(@InsetSide int side, int offset, int inset, ArrayList<SurfaceParams> surfaceParams, InsetsState state) { ArraySet<InsetsSourceConsumer> items = mSideSourceMap.get(side); // TODO: Implement behavior when inset spans over multiple types Loading @@ -182,10 +184,10 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll mTmpMatrix.setTranslate(source.getFrame().left, source.getFrame().top); mTmpFrame.set(source.getFrame()); addTranslationToMatrix(side, inset, mTmpMatrix, mTmpFrame); addTranslationToMatrix(side, offset, mTmpMatrix, mTmpFrame); state.getSource(source.getType()).setFrame(mTmpFrame); surfaceParams.add(new SurfaceParams(leash, 1f, mTmpMatrix, null, 0, 0f)); surfaceParams.add(new SurfaceParams(leash, 1f, mTmpMatrix, null, 0, 0f, inset != 0)); } } Loading core/java/android/view/InsetsController.java +7 −7 Original line number Diff line number Diff line Loading @@ -329,6 +329,11 @@ public class InsetsController implements WindowInsetsController { WindowInsetsAnimationControlListener listener = new WindowInsetsAnimationControlListener() { @Override public void onReady(WindowInsetsAnimationController controller, int types) { if (show) { showDirectly(types); } else { hideDirectly(types); } mAnimator = ObjectAnimator.ofObject( controller, new InsetsProperty(), Loading Loading @@ -356,11 +361,6 @@ public class InsetsController implements WindowInsetsController { private void onAnimationFinish() { mAnimationDirection = DIRECTION_NONE; if (show) { showOnAnimationEnd(types); } else { hideOnAnimationEnd(types); } } }; // TODO: Instead of clearing this here, properly wire up Loading @@ -369,14 +369,14 @@ public class InsetsController implements WindowInsetsController { controlWindowInsetsAnimation(types, listener); } private void hideOnAnimationEnd(@InsetType int types) { private void hideDirectly(@InsetType int types) { final ArraySet<Integer> internalTypes = InsetsState.toInternalType(types); for (int i = internalTypes.size() - 1; i >= 0; i--) { getSourceConsumer(internalTypes.valueAt(i)).hide(); } } private void showOnAnimationEnd(@InsetType int types) { private void showDirectly(@InsetType int types) { final ArraySet<Integer> internalTypes = InsetsState.toInternalType(types); for (int i = internalTypes.size() - 1; i >= 0; i--) { getSourceConsumer(internalTypes.valueAt(i)).show(); Loading core/java/android/view/InsetsSourceConsumer.java +0 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ public class InsetsSourceConsumer { return; } mVisible = visible; applyHiddenToControl(); applyLocalVisibilityOverride(); mController.notifyVisibilityChanged(); } Loading @@ -119,7 +118,6 @@ public class InsetsSourceConsumer { return; } // TODO: Animation final Transaction t = mTransactionSupplier.get(); if (mVisible) { t.show(mSourceControl.getLeash()); Loading core/java/android/view/SyncRtSurfaceTransactionApplier.java +9 −2 Original line number Diff line number Diff line Loading @@ -77,7 +77,11 @@ public class SyncRtSurfaceTransactionApplier { t.setAlpha(params.surface, params.alpha); t.setLayer(params.surface, params.layer); t.setCornerRadius(params.surface, params.cornerRadius); if (params.visible) { t.show(params.surface); } else { t.hide(params.surface); } } /** Loading Loading @@ -121,13 +125,14 @@ public class SyncRtSurfaceTransactionApplier { * @param windowCrop Crop to apply. */ public SurfaceParams(SurfaceControl surface, float alpha, Matrix matrix, Rect windowCrop, int layer, float cornerRadius) { Rect windowCrop, int layer, float cornerRadius, boolean visible) { this.surface = surface; this.alpha = alpha; this.matrix = new Matrix(matrix); this.windowCrop = new Rect(windowCrop); this.layer = layer; this.cornerRadius = cornerRadius; this.visible = visible; } @VisibleForTesting Loading @@ -147,5 +152,7 @@ public class SyncRtSurfaceTransactionApplier { @VisibleForTesting public final int layer; public final boolean visible; } } packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ public class ActivityLaunchAnimator { m.postTranslate(0, (float) (mParams.top - app.position.y)); mWindowCrop.set(mParams.left, 0, mParams.right, mParams.getHeight()); SurfaceParams params = new SurfaceParams(app.leash, 1f /* alpha */, m, mWindowCrop, app.prefixOrderIndex, mCornerRadius); app.prefixOrderIndex, mCornerRadius, true /* visible */); mSyncRtTransactionApplier.scheduleApply(params); } Loading Loading
core/java/android/view/InsetsAnimationControlImpl.java +9 −7 Original line number Diff line number Diff line Loading @@ -127,16 +127,18 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll final Insets offset = Insets.subtract(mShownInsets, mPendingInsets); ArrayList<SurfaceParams> params = new ArrayList<>(); if (offset.left != 0) { updateLeashesForSide(INSET_SIDE_LEFT, offset.left, params, state); updateLeashesForSide(INSET_SIDE_LEFT, offset.left, mPendingInsets.left, params, state); } if (offset.top != 0) { updateLeashesForSide(INSET_SIDE_TOP, offset.top, params, state); updateLeashesForSide(INSET_SIDE_TOP, offset.top, mPendingInsets.top, params, state); } if (offset.right != 0) { updateLeashesForSide(INSET_SIDE_RIGHT, offset.right, params, state); updateLeashesForSide(INSET_SIDE_RIGHT, offset.right, mPendingInsets.right, params, state); } if (offset.bottom != 0) { updateLeashesForSide(INSET_SIDE_BOTTOM, offset.bottom, params, state); updateLeashesForSide(INSET_SIDE_BOTTOM, offset.bottom, mPendingInsets.bottom, params, state); } SyncRtSurfaceTransactionApplier applier = mTransactionApplierSupplier.get(); applier.scheduleApply(params.toArray(new SurfaceParams[params.size()])); Loading Loading @@ -171,7 +173,7 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll return Insets.max(Insets.min(insets, mShownInsets), mHiddenInsets); } private void updateLeashesForSide(@InsetSide int side, int inset, private void updateLeashesForSide(@InsetSide int side, int offset, int inset, ArrayList<SurfaceParams> surfaceParams, InsetsState state) { ArraySet<InsetsSourceConsumer> items = mSideSourceMap.get(side); // TODO: Implement behavior when inset spans over multiple types Loading @@ -182,10 +184,10 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll mTmpMatrix.setTranslate(source.getFrame().left, source.getFrame().top); mTmpFrame.set(source.getFrame()); addTranslationToMatrix(side, inset, mTmpMatrix, mTmpFrame); addTranslationToMatrix(side, offset, mTmpMatrix, mTmpFrame); state.getSource(source.getType()).setFrame(mTmpFrame); surfaceParams.add(new SurfaceParams(leash, 1f, mTmpMatrix, null, 0, 0f)); surfaceParams.add(new SurfaceParams(leash, 1f, mTmpMatrix, null, 0, 0f, inset != 0)); } } Loading
core/java/android/view/InsetsController.java +7 −7 Original line number Diff line number Diff line Loading @@ -329,6 +329,11 @@ public class InsetsController implements WindowInsetsController { WindowInsetsAnimationControlListener listener = new WindowInsetsAnimationControlListener() { @Override public void onReady(WindowInsetsAnimationController controller, int types) { if (show) { showDirectly(types); } else { hideDirectly(types); } mAnimator = ObjectAnimator.ofObject( controller, new InsetsProperty(), Loading Loading @@ -356,11 +361,6 @@ public class InsetsController implements WindowInsetsController { private void onAnimationFinish() { mAnimationDirection = DIRECTION_NONE; if (show) { showOnAnimationEnd(types); } else { hideOnAnimationEnd(types); } } }; // TODO: Instead of clearing this here, properly wire up Loading @@ -369,14 +369,14 @@ public class InsetsController implements WindowInsetsController { controlWindowInsetsAnimation(types, listener); } private void hideOnAnimationEnd(@InsetType int types) { private void hideDirectly(@InsetType int types) { final ArraySet<Integer> internalTypes = InsetsState.toInternalType(types); for (int i = internalTypes.size() - 1; i >= 0; i--) { getSourceConsumer(internalTypes.valueAt(i)).hide(); } } private void showOnAnimationEnd(@InsetType int types) { private void showDirectly(@InsetType int types) { final ArraySet<Integer> internalTypes = InsetsState.toInternalType(types); for (int i = internalTypes.size() - 1; i >= 0; i--) { getSourceConsumer(internalTypes.valueAt(i)).show(); Loading
core/java/android/view/InsetsSourceConsumer.java +0 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ public class InsetsSourceConsumer { return; } mVisible = visible; applyHiddenToControl(); applyLocalVisibilityOverride(); mController.notifyVisibilityChanged(); } Loading @@ -119,7 +118,6 @@ public class InsetsSourceConsumer { return; } // TODO: Animation final Transaction t = mTransactionSupplier.get(); if (mVisible) { t.show(mSourceControl.getLeash()); Loading
core/java/android/view/SyncRtSurfaceTransactionApplier.java +9 −2 Original line number Diff line number Diff line Loading @@ -77,7 +77,11 @@ public class SyncRtSurfaceTransactionApplier { t.setAlpha(params.surface, params.alpha); t.setLayer(params.surface, params.layer); t.setCornerRadius(params.surface, params.cornerRadius); if (params.visible) { t.show(params.surface); } else { t.hide(params.surface); } } /** Loading Loading @@ -121,13 +125,14 @@ public class SyncRtSurfaceTransactionApplier { * @param windowCrop Crop to apply. */ public SurfaceParams(SurfaceControl surface, float alpha, Matrix matrix, Rect windowCrop, int layer, float cornerRadius) { Rect windowCrop, int layer, float cornerRadius, boolean visible) { this.surface = surface; this.alpha = alpha; this.matrix = new Matrix(matrix); this.windowCrop = new Rect(windowCrop); this.layer = layer; this.cornerRadius = cornerRadius; this.visible = visible; } @VisibleForTesting Loading @@ -147,5 +152,7 @@ public class SyncRtSurfaceTransactionApplier { @VisibleForTesting public final int layer; public final boolean visible; } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ public class ActivityLaunchAnimator { m.postTranslate(0, (float) (mParams.top - app.position.y)); mWindowCrop.set(mParams.left, 0, mParams.right, mParams.getHeight()); SurfaceParams params = new SurfaceParams(app.leash, 1f /* alpha */, m, mWindowCrop, app.prefixOrderIndex, mCornerRadius); app.prefixOrderIndex, mCornerRadius, true /* visible */); mSyncRtTransactionApplier.scheduleApply(params); } Loading