Loading quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.VibratorWrapper; import com.android.launcher3.util.WindowBounds; import com.android.launcher3.views.FloatingIconView; import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; import com.android.quickstep.util.ActiveGestureLog; Loading Loading @@ -282,7 +283,8 @@ public abstract class BaseSwipeUpHandler<T extends StatefulActivity<?>, Q extend if (targets.minimizedHomeBounds != null && runningTaskTarget != null) { Rect overviewStackBounds = mActivityInterface .getOverviewWindowBounds(targets.minimizedHomeBounds, runningTaskTarget); dp = dp.getMultiWindowProfile(mContext, overviewStackBounds); dp = dp.getMultiWindowProfile(mContext, new WindowBounds(overviewStackBounds, targets.homeContentInsets)); } else { // If we are not in multi-window mode, home insets should be same as system insets. dp = dp.copy(mContext); Loading src/com/android/launcher3/BaseDraggingActivity.java +11 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.pm.LauncherApps; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Point; import android.graphics.Rect; import android.os.Bundle; Loading @@ -35,6 +36,8 @@ import android.view.ActionMode; import android.view.Display; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowInsets.Type; import android.view.WindowMetrics; import android.widget.Toast; import androidx.annotation.Nullable; Loading @@ -51,6 +54,7 @@ import com.android.launcher3.util.DefaultDisplay.Info; import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.Themes; import com.android.launcher3.util.TraceHelper; import com.android.launcher3.util.WindowBounds; /** * Extension of BaseActivity allowing support for drag-n-drop Loading Loading @@ -272,15 +276,19 @@ public abstract class BaseDraggingActivity extends BaseActivity protected abstract void reapplyUi(); protected Rect getMultiWindowDisplaySize() { protected WindowBounds getMultiWindowDisplaySize() { if (Utilities.ATLEAST_R) { return new Rect(getWindowManager().getCurrentWindowMetrics().getBounds()); WindowMetrics wm = getWindowManager().getCurrentWindowMetrics(); Insets insets = wm.getWindowInsets().getInsets(Type.systemBars()); return new WindowBounds(wm.getBounds(), new Rect(insets.left, insets.top, insets.right, insets.bottom)); } // Note: Calls to getSize() can't rely on our cached DefaultDisplay since it can return // the app window size Display display = getWindowManager().getDefaultDisplay(); Point mwSize = new Point(); display.getSize(mwSize); return new Rect(0, 0, mwSize.x, mwSize.y); return new WindowBounds(new Rect(0, 0, mwSize.x, mwSize.y), new Rect()); } } src/com/android/launcher3/DeviceProfile.java +7 −9 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.launcher3.graphics.IconShape; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.IconNormalizer; import com.android.launcher3.util.DefaultDisplay; import com.android.launcher3.util.WindowBounds; public class DeviceProfile { Loading Loading @@ -265,19 +266,16 @@ public class DeviceProfile { /** * TODO: Move this to the builder as part of setMultiWindowMode */ public DeviceProfile getMultiWindowProfile(Context context, Rect windowPosition) { public DeviceProfile getMultiWindowProfile(Context context, WindowBounds windowBounds) { // We take the minimum sizes of this profile and it's multi-window variant to ensure that // the system decor is always excluded. Point mwSize = new Point(Math.min(availableWidthPx, windowPosition.width()), Math.min(availableHeightPx, windowPosition.height())); Point mwSize = new Point(Math.min(availableWidthPx, windowBounds.availableSize.x), Math.min(availableHeightPx, windowBounds.availableSize.y)); // In multi-window mode, we can have widthPx = availableWidthPx // and heightPx = availableHeightPx because Launcher uses the InvariantDeviceProfiles' // widthPx and heightPx values where it's needed. DeviceProfile profile = toBuilder(context) .setSizeRange(mwSize, mwSize) .setSize(mwSize.x, mwSize.y) .setWindowPosition(windowPosition.left, windowPosition.top) .setSize(windowBounds.bounds.width(), windowBounds.bounds.height()) .setWindowPosition(windowBounds.bounds.left, windowBounds.bounds.top) .setMultiWindowMode(true) .build(); Loading @@ -299,7 +297,7 @@ public class DeviceProfile { } /** * Inverse of {@link #getMultiWindowProfile(Context, Rect)} * Inverse of {@link #getMultiWindowProfile(Context, WindowBounds)} * @return device profile corresponding to the current orientation in non multi-window mode. */ public DeviceProfile getFullScreenProfile() { Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.VibratorWrapper; import com.android.launcher3.util.WindowBounds; import com.android.launcher3.views.FloatingIconView; import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; import com.android.quickstep.util.ActiveGestureLog; Loading Loading @@ -282,7 +283,8 @@ public abstract class BaseSwipeUpHandler<T extends StatefulActivity<?>, Q extend if (targets.minimizedHomeBounds != null && runningTaskTarget != null) { Rect overviewStackBounds = mActivityInterface .getOverviewWindowBounds(targets.minimizedHomeBounds, runningTaskTarget); dp = dp.getMultiWindowProfile(mContext, overviewStackBounds); dp = dp.getMultiWindowProfile(mContext, new WindowBounds(overviewStackBounds, targets.homeContentInsets)); } else { // If we are not in multi-window mode, home insets should be same as system insets. dp = dp.copy(mContext); Loading
src/com/android/launcher3/BaseDraggingActivity.java +11 −3 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.pm.LauncherApps; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Point; import android.graphics.Rect; import android.os.Bundle; Loading @@ -35,6 +36,8 @@ import android.view.ActionMode; import android.view.Display; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowInsets.Type; import android.view.WindowMetrics; import android.widget.Toast; import androidx.annotation.Nullable; Loading @@ -51,6 +54,7 @@ import com.android.launcher3.util.DefaultDisplay.Info; import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.Themes; import com.android.launcher3.util.TraceHelper; import com.android.launcher3.util.WindowBounds; /** * Extension of BaseActivity allowing support for drag-n-drop Loading Loading @@ -272,15 +276,19 @@ public abstract class BaseDraggingActivity extends BaseActivity protected abstract void reapplyUi(); protected Rect getMultiWindowDisplaySize() { protected WindowBounds getMultiWindowDisplaySize() { if (Utilities.ATLEAST_R) { return new Rect(getWindowManager().getCurrentWindowMetrics().getBounds()); WindowMetrics wm = getWindowManager().getCurrentWindowMetrics(); Insets insets = wm.getWindowInsets().getInsets(Type.systemBars()); return new WindowBounds(wm.getBounds(), new Rect(insets.left, insets.top, insets.right, insets.bottom)); } // Note: Calls to getSize() can't rely on our cached DefaultDisplay since it can return // the app window size Display display = getWindowManager().getDefaultDisplay(); Point mwSize = new Point(); display.getSize(mwSize); return new Rect(0, 0, mwSize.x, mwSize.y); return new WindowBounds(new Rect(0, 0, mwSize.x, mwSize.y), new Rect()); } }
src/com/android/launcher3/DeviceProfile.java +7 −9 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.launcher3.graphics.IconShape; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.IconNormalizer; import com.android.launcher3.util.DefaultDisplay; import com.android.launcher3.util.WindowBounds; public class DeviceProfile { Loading Loading @@ -265,19 +266,16 @@ public class DeviceProfile { /** * TODO: Move this to the builder as part of setMultiWindowMode */ public DeviceProfile getMultiWindowProfile(Context context, Rect windowPosition) { public DeviceProfile getMultiWindowProfile(Context context, WindowBounds windowBounds) { // We take the minimum sizes of this profile and it's multi-window variant to ensure that // the system decor is always excluded. Point mwSize = new Point(Math.min(availableWidthPx, windowPosition.width()), Math.min(availableHeightPx, windowPosition.height())); Point mwSize = new Point(Math.min(availableWidthPx, windowBounds.availableSize.x), Math.min(availableHeightPx, windowBounds.availableSize.y)); // In multi-window mode, we can have widthPx = availableWidthPx // and heightPx = availableHeightPx because Launcher uses the InvariantDeviceProfiles' // widthPx and heightPx values where it's needed. DeviceProfile profile = toBuilder(context) .setSizeRange(mwSize, mwSize) .setSize(mwSize.x, mwSize.y) .setWindowPosition(windowPosition.left, windowPosition.top) .setSize(windowBounds.bounds.width(), windowBounds.bounds.height()) .setWindowPosition(windowBounds.bounds.left, windowBounds.bounds.top) .setMultiWindowMode(true) .build(); Loading @@ -299,7 +297,7 @@ public class DeviceProfile { } /** * Inverse of {@link #getMultiWindowProfile(Context, Rect)} * Inverse of {@link #getMultiWindowProfile(Context, WindowBounds)} * @return device profile corresponding to the current orientation in non multi-window mode. */ public DeviceProfile getFullScreenProfile() { Loading