java.lang.Object | |
↳ | android.view.Display |
Provides information about the display size and density.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_DISPLAY | The default Display id. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the index of this display.
| |||||||||||
This method is deprecated.
Use
getSize(Point) instead.
| |||||||||||
Gets display metrics that describe the size and density of this display.
| |||||||||||
This method is deprecated.
use
getRotation() | |||||||||||
Return the native pixel format of the display.
| |||||||||||
Gets the size of the display as a rectangle, in pixels.
| |||||||||||
Return the refresh rate of this display in frames per second.
| |||||||||||
Returns the rotation of the screen from its "natural" orientation.
| |||||||||||
Gets the size of the display, in pixels.
| |||||||||||
This method is deprecated.
Use
getSize(Point) instead.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The default Display id.
Returns the index of this display. This is currently undefined; do not use.
Gets display metrics that describe the size and density of this display.
The size is adjusted based on the current rotation of the display.
The size returned by this method does not necessarily represent the actual raw size (native resolution) of the display. The returned size may be adjusted to exclude certain system decor elements that are always visible. It may also be scaled to provide compatibility with older applications that were originally designed for smaller displays.
outMetrics | A DisplayMetrics object to receive the metrics.
|
---|
Return the native pixel format of the display. The returned value
may be one of the constants int PixelFormat
.
Gets the size of the display as a rectangle, in pixels.
outSize | A Rect object to receive the size information. |
---|
Return the refresh rate of this display in frames per second.
Returns the rotation of the screen from its "natural" orientation.
The returned value may be Surface.ROTATION_0
(no rotation), Surface.ROTATION_90
,
Surface.ROTATION_180
, or
Surface.ROTATION_270
. For
example, if a device has a naturally tall screen, and the user has
turned it on its side to go into a landscape orientation, the value
returned here may be either Surface.ROTATION_90
or Surface.ROTATION_270
depending on
the direction it was turned. The angle is the rotation of the drawn
graphics on the screen, which is the opposite direction of the physical
rotation of the device. For example, if the device is rotated 90
degrees counter-clockwise, to compensate rendering will be rotated by
90 degrees clockwise and thus the returned value here will be
Surface.ROTATION_90
.
Gets the size of the display, in pixels.
Note that this value should not be used for computing layouts, since a device will typically have screen decoration (such as a status bar) along the edges of the display that reduce the amount of application space available from the size returned here. Layouts should instead use the window size.
The size is adjusted based on the current rotation of the display.
The size returned by this method does not necessarily represent the actual raw size (native resolution) of the display. The returned size may be adjusted to exclude certain system decor elements that are always visible. It may also be scaled to provide compatibility with older applications that were originally designed for smaller displays.
outSize | A Point object to receive the size information.
|
---|