Merge "Prevent top app thumbnail cropping by taskbar in split overview." into tm-qpr-dev
This commit is contained in:
@@ -39,7 +39,6 @@ public class PreviewPositionHelper {
|
|||||||
private boolean mIsOrientationChanged;
|
private boolean mIsOrientationChanged;
|
||||||
private SplitBounds mSplitBounds;
|
private SplitBounds mSplitBounds;
|
||||||
private int mDesiredStagePosition;
|
private int mDesiredStagePosition;
|
||||||
private boolean mTaskbarInApp;
|
|
||||||
|
|
||||||
public Matrix getMatrix() {
|
public Matrix getMatrix() {
|
||||||
return mMatrix;
|
return mMatrix;
|
||||||
@@ -58,10 +57,6 @@ public class PreviewPositionHelper {
|
|||||||
mDesiredStagePosition = desiredStagePosition;
|
mDesiredStagePosition = desiredStagePosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTaskbarInApp(boolean taskbarInApp) {
|
|
||||||
mTaskbarInApp = taskbarInApp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the matrix based on the provided parameters
|
* Updates the matrix based on the provided parameters
|
||||||
*/
|
*/
|
||||||
@@ -79,34 +74,21 @@ public class PreviewPositionHelper {
|
|||||||
float scaledTaskbarSize;
|
float scaledTaskbarSize;
|
||||||
float canvasScreenRatio;
|
float canvasScreenRatio;
|
||||||
if (mSplitBounds != null) {
|
if (mSplitBounds != null) {
|
||||||
float fullscreenTaskWidth;
|
|
||||||
float fullscreenTaskHeight;
|
|
||||||
|
|
||||||
float taskPercent;
|
|
||||||
if (mSplitBounds.appsStackedVertically) {
|
if (mSplitBounds.appsStackedVertically) {
|
||||||
taskPercent = mDesiredStagePosition != STAGE_POSITION_TOP_OR_LEFT
|
if (mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT) {
|
||||||
? mSplitBounds.topTaskPercent
|
// Top app isn't cropped at all by taskbar
|
||||||
: (1 - (mSplitBounds.topTaskPercent + mSplitBounds.dividerHeightPercent));
|
canvasScreenRatio = 0;
|
||||||
// Scale portrait height to that of the actual screen
|
|
||||||
fullscreenTaskHeight = screenHeightPx * taskPercent;
|
|
||||||
if (mTaskbarInApp) {
|
|
||||||
canvasScreenRatio = canvasHeight / fullscreenTaskHeight;
|
|
||||||
} else {
|
} else {
|
||||||
if (mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT) {
|
// Same as fullscreen ratio
|
||||||
// Top app isn't cropped at all by taskbar
|
canvasScreenRatio = (float) canvasWidth / screenWidthPx;
|
||||||
canvasScreenRatio = 0;
|
|
||||||
} else {
|
|
||||||
// Same as fullscreen ratio
|
|
||||||
canvasScreenRatio = (float) canvasWidth / screenWidthPx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// For landscape, scale the width
|
// For landscape, scale the width
|
||||||
taskPercent = mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT
|
float taskPercent = mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT
|
||||||
? mSplitBounds.leftTaskPercent
|
? mSplitBounds.leftTaskPercent
|
||||||
: (1 - (mSplitBounds.leftTaskPercent + mSplitBounds.dividerWidthPercent));
|
: (1 - (mSplitBounds.leftTaskPercent + mSplitBounds.dividerWidthPercent));
|
||||||
// Scale landscape width to that of actual screen
|
// Scale landscape width to that of actual screen
|
||||||
fullscreenTaskWidth = screenWidthPx * taskPercent;
|
float fullscreenTaskWidth = screenWidthPx * taskPercent;
|
||||||
canvasScreenRatio = canvasWidth / fullscreenTaskWidth;
|
canvasScreenRatio = canvasWidth / fullscreenTaskWidth;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user