Search in sources :

Example 6 with DefaultDisplay

use of com.android.launcher3.util.DefaultDisplay in project android_packages_apps_Launcher3 by crdroidandroid.

the class BaseDraggingActivity method getMultiWindowDisplaySize.

protected WindowBounds getMultiWindowDisplaySize() {
    if (Utilities.ATLEAST_R) {
        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 WindowBounds(new Rect(0, 0, mwSize.x, mwSize.y), new Rect());
}
Also used : WindowMetrics(android.view.WindowMetrics) Rect(android.graphics.Rect) Insets(android.graphics.Insets) WindowBounds(com.android.launcher3.util.WindowBounds) Point(android.graphics.Point) Display(android.view.Display)

Aggregations

Insets (android.graphics.Insets)6 Point (android.graphics.Point)6 Rect (android.graphics.Rect)6 Display (android.view.Display)6 WindowMetrics (android.view.WindowMetrics)6 WindowBounds (com.android.launcher3.util.WindowBounds)6 DefaultDisplay (com.android.launcher3.util.DefaultDisplay)1