abstract Display
|
getDefaultDisplay()
Returns the Display upon which this WindowManager instance will create new windows.
|
abstract void
|
removeViewImmediate(View view)
Special variation of removeView(View) that immediately invokes the given view hierarchy's View.onDetachedFromWindow() methods before returning.
|
long
|
getAppVsyncOffsetNanos()
Gets the app VSYNC offset, in nanoseconds.
|
void
|
getCurrentSizeRange(Point outSmallestSize, Point outLargestSize)
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.
|
int
|
getDisplayId()
Gets the display id.
|
int
|
getFlags()
Returns a combination of flags that describe the capabilities of the display.
|
int
|
getHeight()
This method was deprecated in API level 13. Use getSize(Point) instead.
|
void
|
getMetrics(DisplayMetrics outMetrics)
Gets display metrics that describe the size and density of this display.
|
String
|
getName()
Gets the name of the display.
|
int
|
getOrientation()
This method was deprecated in API level 8. use getRotation()
|
int
|
getPixelFormat()
This method was deprecated in API level 17. This method is no longer supported. The result is always RGBA_8888 .
|
long
|
getPresentationDeadlineNanos()
This is how far in advance a buffer must be queued for presentation at a given time.
|
void
|
getRealMetrics(DisplayMetrics outMetrics)
Gets display metrics based on the real size of this display.
|
void
|
getRealSize(Point outSize)
Gets the real size of the display without subtracting any window decor or applying any compatibility scale factors.
|
void
|
getRectSize(Rect outSize)
Gets the size of the display as a rectangle, in pixels.
|
float
|
getRefreshRate()
Gets the refresh rate of this display in frames per second.
|
int
|
getRotation()
Returns the rotation of the screen from its "natural" orientation.
|
void
|
getSize(Point outSize)
Gets the size of the display, in pixels.
|
int
|
getState()
Gets the state of the display, such as whether it is on or off.
|
float[]
|
getSupportedRefreshRates()
Get the supported refresh rates of this display in frames per second.
|
int
|
getWidth()
This method was deprecated in API level 13. Use getSize(Point) instead.
|
boolean
|
isValid()
Returns true if this display is still valid, false if the display has been removed.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this object.
|
DisplayMetrics metrics = new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(metrics);//即相当于:WindowManager windowManager=getWindowManager(); //获取窗口管理器Display display= windowManager.getDefaultDisplay(); //显示窗口并返回Display对象
DisplayMetrics metrics = new DisplayMetrics(); //通过DisplayMetrics多包含的信息,获取屏幕的宽和高
display. getMetrics(metrics);
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
|
boolean
|
equals(DisplayMetrics other)
Returns true if these display metrics equal the other display metrics.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
void
|
setTo(DisplayMetrics o)
|
void
|
setToDefaults()
|
String
|
toString()
Returns a string containing a concise, human-readable description of this object.
|