mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Fix TaskView cropping for transient taskbar
TaskView clipping is not necessary anymore because task in Overview will always be the same aspect ratio as the app when in fullscreen. Fix: 268211636 Test: manual trigger of Overview (landscape, portrait, split screen) Change-Id: Ib4faeda6f0cccef3b23fcbacb89c6d2832c0df59 Merged-In: Ib4faeda6f0cccef3b23fcbacb89c6d2832c0df59
This commit is contained in:
@@ -82,7 +82,6 @@ import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.util.ActivityOptionsWrapper;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.RunnableList;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
|
||||
@@ -559,9 +558,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
}
|
||||
mModalness = modalness;
|
||||
mIconView.setAlpha(1 - modalness);
|
||||
mDigitalWellBeingToast.updateBannerOffset(modalness,
|
||||
mCurrentFullscreenParams.mCurrentDrawnInsets.top
|
||||
+ mCurrentFullscreenParams.mCurrentDrawnInsets.bottom);
|
||||
mDigitalWellBeingToast.updateBannerOffset(modalness);
|
||||
}
|
||||
|
||||
public DigitalWellBeingToast getDigitalWellBeingToast() {
|
||||
@@ -1120,9 +1117,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
float scale = Interpolators.clampToProgress(FAST_OUT_SLOW_IN, lowerClamp, upperClamp)
|
||||
.getInterpolation(progress);
|
||||
mIconView.setAlpha(scale);
|
||||
mDigitalWellBeingToast.updateBannerOffset(1f - scale,
|
||||
mCurrentFullscreenParams.mCurrentDrawnInsets.top
|
||||
+ mCurrentFullscreenParams.mCurrentDrawnInsets.bottom);
|
||||
mDigitalWellBeingToast.updateBannerOffset(1f - scale);
|
||||
}
|
||||
|
||||
public void setIconScaleAnimStartProgress(float startProgress) {
|
||||
@@ -1735,17 +1730,11 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
private final float mCornerRadius;
|
||||
private final float mWindowCornerRadius;
|
||||
|
||||
public RectF mCurrentDrawnInsets = new RectF();
|
||||
public float mCurrentDrawnCornerRadius;
|
||||
/** The current scale we apply to the thumbnail to adjust for new left/right insets. */
|
||||
public float mScale = 1;
|
||||
|
||||
private boolean mIsTaskbarTransient;
|
||||
|
||||
public FullscreenDrawParams(Context context) {
|
||||
mCornerRadius = TaskCornerRadius.get(context);
|
||||
mWindowCornerRadius = QuickStepContract.getWindowCornerRadius(context);
|
||||
mIsTaskbarTransient = DisplayController.isTransientTaskbar(context);
|
||||
|
||||
mCurrentDrawnCornerRadius = mCornerRadius;
|
||||
}
|
||||
@@ -1755,36 +1744,9 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
*/
|
||||
public void setProgress(float fullscreenProgress, float parentScale, float taskViewScale,
|
||||
int previewWidth, DeviceProfile dp, PreviewPositionHelper pph) {
|
||||
RectF insets = getInsetsToDrawInFullscreen(pph, dp, mIsTaskbarTransient);
|
||||
|
||||
float currentInsetsLeft = insets.left * fullscreenProgress;
|
||||
float currentInsetsTop = insets.top * fullscreenProgress;
|
||||
float currentInsetsRight = insets.right * fullscreenProgress;
|
||||
float currentInsetsBottom = insets.bottom * fullscreenProgress;
|
||||
mCurrentDrawnInsets.set(
|
||||
currentInsetsLeft, currentInsetsTop, currentInsetsRight, currentInsetsBottom);
|
||||
|
||||
mCurrentDrawnCornerRadius =
|
||||
Utilities.mapRange(fullscreenProgress, mCornerRadius, mWindowCornerRadius)
|
||||
/ parentScale / taskViewScale;
|
||||
|
||||
// We scaled the thumbnail to fit the content (excluding insets) within task view width.
|
||||
// Now that we are drawing left/right insets again, we need to scale down to fit them.
|
||||
if (previewWidth > 0) {
|
||||
mScale = previewWidth / (previewWidth + currentInsetsLeft + currentInsetsRight);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insets to used for clipping the thumbnail (in case it is drawing outside its own space)
|
||||
*/
|
||||
private static RectF getInsetsToDrawInFullscreen(PreviewPositionHelper pph,
|
||||
DeviceProfile dp, boolean isTaskbarTransient) {
|
||||
if (dp.isTaskbarPresent && isTaskbarTransient) {
|
||||
return pph.getClippedInsets();
|
||||
}
|
||||
return dp.isTaskbarPresent && !dp.isTaskbarPresentInApps
|
||||
? pph.getClippedInsets() : EMPTY_RECT_F;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user