Display.GetCurrentSizeRange(Point, Point) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Return the range of display sizes an application can expect to encounter under normal operation, as long as there is no physical change in screen size.
[Android.Runtime.Register("getCurrentSizeRange", "(Landroid/graphics/Point;Landroid/graphics/Point;)V", "GetGetCurrentSizeRange_Landroid_graphics_Point_Landroid_graphics_Point_Handler")]
public virtual void GetCurrentSizeRange (Android.Graphics.Point? outSmallestSize, Android.Graphics.Point? outLargestSize);
[<Android.Runtime.Register("getCurrentSizeRange", "(Landroid/graphics/Point;Landroid/graphics/Point;)V", "GetGetCurrentSizeRange_Landroid_graphics_Point_Landroid_graphics_Point_Handler")>]
abstract member GetCurrentSizeRange : Android.Graphics.Point * Android.Graphics.Point -> unit
override this.GetCurrentSizeRange : Android.Graphics.Point * Android.Graphics.Point -> unit
Parameters
- outSmallestSize
- Point
Filled in with the smallest width and height
that the application will encounter, in pixels (not dp units). The x
(width) dimension here directly corresponds to
android.content.res.Configuration#smallestScreenWidthDp
Configuration.smallestScreenWidthDp
, except the value here is in raw
screen pixels rather than dp units. Your application may of course
still get smaller space yet if, for example, a soft keyboard is
being displayed.
- outLargestSize
- Point
Filled in with the largest width and height that the application will encounter, in pixels (not dp units). Your application may of course still get larger space than this if, for example, screen decorations like the status bar are being hidden.
- Attributes
Remarks
Return the range of display sizes an application can expect to encounter under normal operation, as long as there is no physical change in screen size. This is basically the sizes you will see as the orientation changes, taking into account whatever screen decoration there is in each rotation. For example, the status bar is always at the top of the screen, so it will reduce the height both in landscape and portrait, and the smallest height returned here will be the smaller of the two.
This is intended for applications to get an idea of the range of sizes they will encounter while going through device rotations, to provide a stable UI through rotation. The sizes here take into account all standard system decorations that reduce the size actually available to the application: the status bar, navigation bar, system bar, etc. It does <em>not</em> take into account more transient elements like an IME soft keyboard.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.