Loading quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskViewSimulator.java +6 −9 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static android.view.Surface.ROTATION_0; import static com.android.launcher3.states.RotationHelper.deltaRotation; import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE; import static com.android.quickstep.util.RecentsOrientedState.isFixedRotationTransformEnabled; import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN; Loading Loading @@ -67,7 +66,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { // Thumbnail view properties private final Rect mThumbnailPosition = new Rect(); private final ThumbnailData mThumbnailData = new ThumbnailData(); private final PreviewPositionHelper mPositionHelper; private final PreviewPositionHelper mPositionHelper = new PreviewPositionHelper(); private final Matrix mInversePositionMatrix = new Matrix(); // TaskView properties Loading @@ -87,7 +86,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { public TaskViewSimulator(Context context, WindowSizeStrategy sizeStrategy) { mContext = context; mSizeStrategy = sizeStrategy; mPositionHelper = new PreviewPositionHelper(context); mOrientationState = new RecentsOrientedState(context, sizeStrategy, i -> { }); // We do not need to attach listeners as the simulator is created just for the gesture Loading Loading @@ -173,12 +171,12 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mLayoutValid = true; getFullScreenScale(); mThumbnailData.rotation = isFixedRotationTransformEnabled(mContext) ? mOrientationState.getDisplayRotation() : mPositionHelper.getCurrentRotation(); mPositionHelper.updateThumbnailMatrix(mThumbnailPosition, mThumbnailData, mTaskRect.width(), mTaskRect.height(), mDp); mThumbnailData.rotation = mOrientationState.getDisplayRotation(); mPositionHelper.updateThumbnailMatrix( mThumbnailPosition, mThumbnailData, mTaskRect.width(), mTaskRect.height(), mDp, mOrientationState.getLauncherRotation()); mPositionHelper.getMatrix().invert(mInversePositionMatrix); PagedOrientationHandler poh = mOrientationState.getOrientationHandler(); Loading @@ -188,7 +186,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mScrollValid = false; } if (!mScrollValid) { mScrollValid = true; int start = mOrientationState.getOrientationHandler() Loading quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java +6 −16 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc // Contains the portion of the thumbnail that is clipped when fullscreen progress = 0. private final Rect mPreviewRect = new Rect(); private final PreviewPositionHelper mPreviewPositionHelper; private final PreviewPositionHelper mPreviewPositionHelper = new PreviewPositionHelper(); // Initialize with dummy value. It is overridden later by TaskView private TaskView.FullscreenDrawParams mFullscreenParams = TEMP_PARAMS; Loading Loading @@ -122,7 +122,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc mDimmingPaintAfterClearing.setColor(Color.BLACK); mActivity = BaseActivity.fromContext(context); mIsDarkTextTheme = Themes.getAttrBoolean(mActivity, R.attr.isWorkspaceDarkText); mPreviewPositionHelper = new PreviewPositionHelper(context); } /** Loading Loading @@ -349,8 +348,11 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc if (mBitmapShader != null && mThumbnailData != null) { mPreviewRect.set(0, 0, mThumbnailData.thumbnail.getWidth(), mThumbnailData.thumbnail.getHeight()); int currentRotation = ConfigurationCompat.getWindowConfigurationRotation( mActivity.getResources().getConfiguration()); mPreviewPositionHelper.updateThumbnailMatrix(mPreviewRect, mThumbnailData, getMeasuredWidth(), getMeasuredHeight(), mActivity.getDeviceProfile()); getMeasuredWidth(), getMeasuredHeight(), mActivity.getDeviceProfile(), currentRotation); mBitmapShader.setLocalMatrix(mPreviewPositionHelper.mMatrix); mPaint.setShader(mBitmapShader); Loading Loading @@ -417,17 +419,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc private float mClipBottom = -1; private boolean mIsOrientationChanged; private final Context mContext; public PreviewPositionHelper(Context context) { mContext = context; } public int getCurrentRotation() { return ConfigurationCompat.getWindowConfigurationRotation( mContext.getResources().getConfiguration()); } public Matrix getMatrix() { return mMatrix; } Loading @@ -436,7 +427,7 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc * Updates the matrix based on the provided parameters */ public void updateThumbnailMatrix(Rect thumbnailPosition, ThumbnailData thumbnailData, int canvasWidth, int canvasHeight, DeviceProfile dp) { int canvasWidth, int canvasHeight, DeviceProfile dp, int currentRotation) { boolean isRotated = false; boolean isOrientationDifferent; mClipBottom = -1; Loading @@ -451,7 +442,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc final float thumbnailScale; int thumbnailRotation = thumbnailData.rotation; int currentRotation = getCurrentRotation(); int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation); Rect deviceInsets = dp.getInsets(); Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskViewSimulator.java +6 −9 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static android.view.Surface.ROTATION_0; import static com.android.launcher3.states.RotationHelper.deltaRotation; import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE; import static com.android.quickstep.util.RecentsOrientedState.isFixedRotationTransformEnabled; import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN; Loading Loading @@ -67,7 +66,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { // Thumbnail view properties private final Rect mThumbnailPosition = new Rect(); private final ThumbnailData mThumbnailData = new ThumbnailData(); private final PreviewPositionHelper mPositionHelper; private final PreviewPositionHelper mPositionHelper = new PreviewPositionHelper(); private final Matrix mInversePositionMatrix = new Matrix(); // TaskView properties Loading @@ -87,7 +86,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { public TaskViewSimulator(Context context, WindowSizeStrategy sizeStrategy) { mContext = context; mSizeStrategy = sizeStrategy; mPositionHelper = new PreviewPositionHelper(context); mOrientationState = new RecentsOrientedState(context, sizeStrategy, i -> { }); // We do not need to attach listeners as the simulator is created just for the gesture Loading Loading @@ -173,12 +171,12 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mLayoutValid = true; getFullScreenScale(); mThumbnailData.rotation = isFixedRotationTransformEnabled(mContext) ? mOrientationState.getDisplayRotation() : mPositionHelper.getCurrentRotation(); mPositionHelper.updateThumbnailMatrix(mThumbnailPosition, mThumbnailData, mTaskRect.width(), mTaskRect.height(), mDp); mThumbnailData.rotation = mOrientationState.getDisplayRotation(); mPositionHelper.updateThumbnailMatrix( mThumbnailPosition, mThumbnailData, mTaskRect.width(), mTaskRect.height(), mDp, mOrientationState.getLauncherRotation()); mPositionHelper.getMatrix().invert(mInversePositionMatrix); PagedOrientationHandler poh = mOrientationState.getOrientationHandler(); Loading @@ -188,7 +186,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mScrollValid = false; } if (!mScrollValid) { mScrollValid = true; int start = mOrientationState.getOrientationHandler() Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskThumbnailView.java +6 −16 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc // Contains the portion of the thumbnail that is clipped when fullscreen progress = 0. private final Rect mPreviewRect = new Rect(); private final PreviewPositionHelper mPreviewPositionHelper; private final PreviewPositionHelper mPreviewPositionHelper = new PreviewPositionHelper(); // Initialize with dummy value. It is overridden later by TaskView private TaskView.FullscreenDrawParams mFullscreenParams = TEMP_PARAMS; Loading Loading @@ -122,7 +122,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc mDimmingPaintAfterClearing.setColor(Color.BLACK); mActivity = BaseActivity.fromContext(context); mIsDarkTextTheme = Themes.getAttrBoolean(mActivity, R.attr.isWorkspaceDarkText); mPreviewPositionHelper = new PreviewPositionHelper(context); } /** Loading Loading @@ -349,8 +348,11 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc if (mBitmapShader != null && mThumbnailData != null) { mPreviewRect.set(0, 0, mThumbnailData.thumbnail.getWidth(), mThumbnailData.thumbnail.getHeight()); int currentRotation = ConfigurationCompat.getWindowConfigurationRotation( mActivity.getResources().getConfiguration()); mPreviewPositionHelper.updateThumbnailMatrix(mPreviewRect, mThumbnailData, getMeasuredWidth(), getMeasuredHeight(), mActivity.getDeviceProfile()); getMeasuredWidth(), getMeasuredHeight(), mActivity.getDeviceProfile(), currentRotation); mBitmapShader.setLocalMatrix(mPreviewPositionHelper.mMatrix); mPaint.setShader(mBitmapShader); Loading Loading @@ -417,17 +419,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc private float mClipBottom = -1; private boolean mIsOrientationChanged; private final Context mContext; public PreviewPositionHelper(Context context) { mContext = context; } public int getCurrentRotation() { return ConfigurationCompat.getWindowConfigurationRotation( mContext.getResources().getConfiguration()); } public Matrix getMatrix() { return mMatrix; } Loading @@ -436,7 +427,7 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc * Updates the matrix based on the provided parameters */ public void updateThumbnailMatrix(Rect thumbnailPosition, ThumbnailData thumbnailData, int canvasWidth, int canvasHeight, DeviceProfile dp) { int canvasWidth, int canvasHeight, DeviceProfile dp, int currentRotation) { boolean isRotated = false; boolean isOrientationDifferent; mClipBottom = -1; Loading @@ -451,7 +442,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc final float thumbnailScale; int thumbnailRotation = thumbnailData.rotation; int currentRotation = getCurrentRotation(); int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation); Rect deviceInsets = dp.getInsets(); Loading