Loading api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -55767,8 +55767,8 @@ package android.view { } public final class WindowMetrics { ctor public WindowMetrics(@NonNull android.util.Size, @NonNull android.view.WindowInsets); method @NonNull public android.util.Size getSize(); ctor public WindowMetrics(@NonNull android.graphics.Rect, @NonNull android.view.WindowInsets); method @NonNull public android.graphics.Rect getBounds(); method @NonNull public android.view.WindowInsets getWindowInsets(); } core/java/android/inputmethodservice/InputMethodService.java +2 −3 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ import android.text.method.MovementMethod; import android.util.Log; import android.util.PrintWriterPrinter; import android.util.Printer; import android.util.Size; import android.view.Gravity; import android.view.KeyCharacterMap; import android.view.KeyEvent; Loading Loading @@ -1480,8 +1479,8 @@ public class InputMethodService extends AbstractInputMethodService { */ public int getMaxWidth() { final WindowManager windowManager = getSystemService(WindowManager.class); final Size windowSize = windowManager.getCurrentWindowMetrics().getSize(); return windowSize.getWidth(); final Rect windowBounds = windowManager.getCurrentWindowMetrics().getBounds(); return windowBounds.width(); } /** Loading core/java/android/view/Display.java +7 −7 Original line number Diff line number Diff line Loading @@ -57,8 +57,8 @@ import java.util.List; * <li>The application display area specifies the part of the display that may contain * an application window, excluding the system decorations. The application display area may * be smaller than the real display area because the system subtracts the space needed * for decor elements such as the status bar. Use {@link WindowMetrics#getSize()} to query the * application window size.</li> * for decor elements such as the status bar. Use {@link WindowMetrics#getBounds()} to query the * application window bounds.</li> * <li>The real display area specifies the part of the display that contains content * including the system decorations. Even so, the real display area may be smaller than the * physical size of the display if the window manager is emulating a smaller display Loading Loading @@ -673,7 +673,7 @@ public final class Display { * * @param outSize A {@link Point} object to receive the size information. * @deprecated Use {@link WindowManager#getCurrentWindowMetrics()} to obtain an instance of * {@link WindowMetrics} and use {@link WindowMetrics#getSize()} instead. * {@link WindowMetrics} and use {@link WindowMetrics#getBounds()} instead. */ @Deprecated public void getSize(Point outSize) { Loading @@ -689,7 +689,7 @@ public final class Display { * Gets the size of the display as a rectangle, in pixels. * * @param outSize A {@link Rect} object to receive the size information. * @deprecated Use {@link WindowMetrics#getSize()} to get the dimensions of the application * @deprecated Use {@link WindowMetrics#getBounds()} to get the dimensions of the application * window area. */ @Deprecated Loading Loading @@ -755,7 +755,7 @@ public final class Display { } /** * @deprecated Use {@link WindowMetrics#getSize()} instead. * @deprecated Use {@link WindowMetrics#getBounds#width()} instead. */ @Deprecated public int getWidth() { Loading @@ -766,7 +766,7 @@ public final class Display { } /** * @deprecated Use {@link WindowMetrics#getSize()} instead. * @deprecated Use {@link WindowMetrics#getBounds()#height()} instead. */ @Deprecated public int getHeight() { Loading Loading @@ -1105,7 +1105,7 @@ public final class Display { * </p> * * @param outMetrics A {@link DisplayMetrics} object to receive the metrics. * @deprecated Use {@link WindowMetrics#getSize()} to get the dimensions of the application * @deprecated Use {@link WindowMetrics#getBounds()} to get the dimensions of the application * window area, and {@link Configuration#densityDpi} to get the current density. */ @Deprecated Loading core/java/android/view/ViewConfiguration.java +3 −3 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.os.Build; import android.os.RemoteException; import android.provider.Settings; import android.util.DisplayMetrics; import android.util.Size; import android.util.SparseArray; import android.util.TypedValue; Loading Loading @@ -410,8 +410,8 @@ public class ViewConfiguration { // Size of the screen in bytes, in ARGB_8888 format final WindowManager windowManager = context.getSystemService(WindowManager.class); final Size maxWindowSize = windowManager.getMaximumWindowMetrics().getSize(); mMaximumDrawingCacheSize = 4 * maxWindowSize.getWidth() * maxWindowSize.getHeight(); final Rect maxWindowBounds = windowManager.getMaximumWindowMetrics().getBounds(); mMaximumDrawingCacheSize = 4 * maxWindowBounds.width() * maxWindowBounds.height(); mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f); mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f); Loading core/java/android/view/WindowManagerImpl.java +2 −7 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ import android.graphics.Region; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.util.Size; import com.android.internal.os.IResultReceiver; Loading Loading @@ -220,7 +219,7 @@ public final class WindowManagerImpl implements WindowManager { final Context context = mParentWindow != null ? mParentWindow.getContext() : mContext; final Rect bounds = getCurrentBounds(context); return new WindowMetrics(toSize(bounds), computeWindowInsets(bounds)); return new WindowMetrics(bounds, computeWindowInsets(bounds)); } private static Rect getCurrentBounds(Context context) { Loading @@ -232,11 +231,7 @@ public final class WindowManagerImpl implements WindowManager { @Override public WindowMetrics getMaximumWindowMetrics() { final Rect maxBounds = getMaximumBounds(); return new WindowMetrics(toSize(maxBounds), computeWindowInsets(maxBounds)); } private Size toSize(Rect frame) { return new Size(frame.width(), frame.height()); return new WindowMetrics(maxBounds, computeWindowInsets(maxBounds)); } private Rect getMaximumBounds() { Loading Loading
api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -55767,8 +55767,8 @@ package android.view { } public final class WindowMetrics { ctor public WindowMetrics(@NonNull android.util.Size, @NonNull android.view.WindowInsets); method @NonNull public android.util.Size getSize(); ctor public WindowMetrics(@NonNull android.graphics.Rect, @NonNull android.view.WindowInsets); method @NonNull public android.graphics.Rect getBounds(); method @NonNull public android.view.WindowInsets getWindowInsets(); }
core/java/android/inputmethodservice/InputMethodService.java +2 −3 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ import android.text.method.MovementMethod; import android.util.Log; import android.util.PrintWriterPrinter; import android.util.Printer; import android.util.Size; import android.view.Gravity; import android.view.KeyCharacterMap; import android.view.KeyEvent; Loading Loading @@ -1480,8 +1479,8 @@ public class InputMethodService extends AbstractInputMethodService { */ public int getMaxWidth() { final WindowManager windowManager = getSystemService(WindowManager.class); final Size windowSize = windowManager.getCurrentWindowMetrics().getSize(); return windowSize.getWidth(); final Rect windowBounds = windowManager.getCurrentWindowMetrics().getBounds(); return windowBounds.width(); } /** Loading
core/java/android/view/Display.java +7 −7 Original line number Diff line number Diff line Loading @@ -57,8 +57,8 @@ import java.util.List; * <li>The application display area specifies the part of the display that may contain * an application window, excluding the system decorations. The application display area may * be smaller than the real display area because the system subtracts the space needed * for decor elements such as the status bar. Use {@link WindowMetrics#getSize()} to query the * application window size.</li> * for decor elements such as the status bar. Use {@link WindowMetrics#getBounds()} to query the * application window bounds.</li> * <li>The real display area specifies the part of the display that contains content * including the system decorations. Even so, the real display area may be smaller than the * physical size of the display if the window manager is emulating a smaller display Loading Loading @@ -673,7 +673,7 @@ public final class Display { * * @param outSize A {@link Point} object to receive the size information. * @deprecated Use {@link WindowManager#getCurrentWindowMetrics()} to obtain an instance of * {@link WindowMetrics} and use {@link WindowMetrics#getSize()} instead. * {@link WindowMetrics} and use {@link WindowMetrics#getBounds()} instead. */ @Deprecated public void getSize(Point outSize) { Loading @@ -689,7 +689,7 @@ public final class Display { * Gets the size of the display as a rectangle, in pixels. * * @param outSize A {@link Rect} object to receive the size information. * @deprecated Use {@link WindowMetrics#getSize()} to get the dimensions of the application * @deprecated Use {@link WindowMetrics#getBounds()} to get the dimensions of the application * window area. */ @Deprecated Loading Loading @@ -755,7 +755,7 @@ public final class Display { } /** * @deprecated Use {@link WindowMetrics#getSize()} instead. * @deprecated Use {@link WindowMetrics#getBounds#width()} instead. */ @Deprecated public int getWidth() { Loading @@ -766,7 +766,7 @@ public final class Display { } /** * @deprecated Use {@link WindowMetrics#getSize()} instead. * @deprecated Use {@link WindowMetrics#getBounds()#height()} instead. */ @Deprecated public int getHeight() { Loading Loading @@ -1105,7 +1105,7 @@ public final class Display { * </p> * * @param outMetrics A {@link DisplayMetrics} object to receive the metrics. * @deprecated Use {@link WindowMetrics#getSize()} to get the dimensions of the application * @deprecated Use {@link WindowMetrics#getBounds()} to get the dimensions of the application * window area, and {@link Configuration#densityDpi} to get the current density. */ @Deprecated Loading
core/java/android/view/ViewConfiguration.java +3 −3 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.os.Build; import android.os.RemoteException; import android.provider.Settings; import android.util.DisplayMetrics; import android.util.Size; import android.util.SparseArray; import android.util.TypedValue; Loading Loading @@ -410,8 +410,8 @@ public class ViewConfiguration { // Size of the screen in bytes, in ARGB_8888 format final WindowManager windowManager = context.getSystemService(WindowManager.class); final Size maxWindowSize = windowManager.getMaximumWindowMetrics().getSize(); mMaximumDrawingCacheSize = 4 * maxWindowSize.getWidth() * maxWindowSize.getHeight(); final Rect maxWindowBounds = windowManager.getMaximumWindowMetrics().getBounds(); mMaximumDrawingCacheSize = 4 * maxWindowBounds.width() * maxWindowBounds.height(); mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f); mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f); Loading
core/java/android/view/WindowManagerImpl.java +2 −7 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ import android.graphics.Region; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.util.Size; import com.android.internal.os.IResultReceiver; Loading Loading @@ -220,7 +219,7 @@ public final class WindowManagerImpl implements WindowManager { final Context context = mParentWindow != null ? mParentWindow.getContext() : mContext; final Rect bounds = getCurrentBounds(context); return new WindowMetrics(toSize(bounds), computeWindowInsets(bounds)); return new WindowMetrics(bounds, computeWindowInsets(bounds)); } private static Rect getCurrentBounds(Context context) { Loading @@ -232,11 +231,7 @@ public final class WindowManagerImpl implements WindowManager { @Override public WindowMetrics getMaximumWindowMetrics() { final Rect maxBounds = getMaximumBounds(); return new WindowMetrics(toSize(maxBounds), computeWindowInsets(maxBounds)); } private Size toSize(Rect frame) { return new Size(frame.width(), frame.height()); return new WindowMetrics(maxBounds, computeWindowInsets(maxBounds)); } private Rect getMaximumBounds() { Loading