Merge "Fixing quickswitch window not properly aligned in split-screen" into sc-dev
This commit is contained in:
commit
c3f56d7628
|
@ -266,20 +266,32 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
|||
Gravity.apply(Gravity.CENTER, outWidth, outHeight, potentialTaskRect, outRect);
|
||||
}
|
||||
|
||||
private PointF getTaskDimension(Context context, DeviceProfile dp) {
|
||||
private static PointF getTaskDimension(Context context, DeviceProfile dp) {
|
||||
PointF dimension = new PointF();
|
||||
getTaskDimension(context, dp, dimension);
|
||||
return dimension;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the dimension of the task in the current system state.
|
||||
*/
|
||||
public static void getTaskDimension(Context context, DeviceProfile dp, PointF out) {
|
||||
if (dp.isMultiWindowMode) {
|
||||
WindowBounds bounds = SplitScreenBounds.INSTANCE.getSecondaryWindowBounds(context);
|
||||
dimension.x = bounds.availableSize.x;
|
||||
dimension.y = bounds.availableSize.y;
|
||||
if (TaskView.CLIP_STATUS_AND_NAV_BARS) {
|
||||
out.x = bounds.availableSize.x;
|
||||
out.y = bounds.availableSize.y;
|
||||
} else {
|
||||
out.x = bounds.availableSize.x + bounds.insets.left + bounds.insets.right;
|
||||
out.y = bounds.availableSize.y + bounds.insets.top + bounds.insets.bottom;
|
||||
}
|
||||
} else if (TaskView.CLIP_STATUS_AND_NAV_BARS) {
|
||||
dimension.x = dp.availableWidthPx;
|
||||
dimension.y = dp.availableHeightPx;
|
||||
out.x = dp.availableWidthPx;
|
||||
out.y = dp.availableHeightPx;
|
||||
} else {
|
||||
dimension.x = dp.widthPx;
|
||||
dimension.y = dp.heightPx;
|
||||
out.x = dp.widthPx;
|
||||
out.y = dp.heightPx;
|
||||
}
|
||||
return dimension;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,6 +25,7 @@ import static android.view.Surface.ROTATION_90;
|
|||
import static com.android.launcher3.states.RotationHelper.ALLOW_ROTATION_PREFERENCE_KEY;
|
||||
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
||||
import static com.android.launcher3.util.SettingsCache.ROTATION_SETTING_URI;
|
||||
import static com.android.quickstep.BaseActivityInterface.getTaskDimension;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||
|
||||
|
@ -49,7 +50,6 @@ import com.android.launcher3.testing.TestProtocol;
|
|||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.SettingsCache;
|
||||
import com.android.launcher3.util.WindowBounds;
|
||||
import com.android.quickstep.BaseActivityInterface;
|
||||
import com.android.quickstep.SystemUiProxy;
|
||||
import com.android.quickstep.views.TaskView;
|
||||
|
@ -401,12 +401,7 @@ public class RecentsOrientedState implements
|
|||
fullHeight -= insets.top + insets.bottom;
|
||||
}
|
||||
|
||||
if (dp.isMultiWindowMode) {
|
||||
WindowBounds bounds = SplitScreenBounds.INSTANCE.getSecondaryWindowBounds(mContext);
|
||||
outPivot.set(bounds.availableSize.x, bounds.availableSize.y);
|
||||
} else {
|
||||
outPivot.set(fullWidth, fullHeight);
|
||||
}
|
||||
getTaskDimension(mContext, dp, outPivot);
|
||||
float scale = Math.min(outPivot.x / taskView.width(), outPivot.y / taskView.height());
|
||||
// We also scale the preview as part of fullScreenParams, so account for that as well.
|
||||
if (fullWidth > 0) {
|
||||
|
|
Loading…
Reference in New Issue