public class WindowManager extends Object
WindowManager for creating and destroying Window objects.| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
WindowManager.LayoutConfig |
Encapsulate the layout attributes, flags, and constants used with a
Window. |
static class |
WindowManager.NotchMode |
Indicates the display mode of the notch.
|
static class |
WindowManager.PermissionException |
Describe the exception thrown when creating a window.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Window |
addComponent(ComponentContainer component,
Context context,
int typeFlag) |
Create a window based on the component layout, context, and window type.
|
PixelMap |
captureScreen(Rect rectangle,
int width,
int height,
int angle) |
Take a screenshot.
|
void |
destroyWindow(Window window) |
Destroy a window.
|
static WindowManager |
getInstance() |
Obtain a singleton
WindowManager. |
Optional<Window> |
getTopWindow() |
Obtain the top window of the current application.
|
int |
getWindowCount(Context context) |
Obtain the number of all windows of the current application.
|
public static WindowManager getInstance()
WindowManager.
This is a static factory method.
WindowManager instance.public Optional<Window> getTopWindow()
NullPointerException - Throw this exception if mAGPWindowManager is null.public int getWindowCount(Context context)
context - Indicate the context of the windows.NullPointerException - Throw this exception if mAGPWindowManager is null.public Window addComponent(ComponentContainer component, Context context, int typeFlag)
component - Indicate the component layout defined by the user.context - Indicate the context to use.typeFlag - Indicate the window type.NullPointerException - Throw this exception if mAGPWindowManager is null.WindowManager.PermissionException - Throw this exception if agp window cannot show.public void destroyWindow(Window window)
window - Indicate the window to destroy.public PixelMap captureScreen(Rect rectangle, int width, int height, int angle)
rectangle - Indicate the rectangle with the specified coordinates.width - Indicate the width of the desired pixelmap.height - Indicate the height of the desired pixelmap.angle - Indicate the rotation angle. 0 indicates that no rotation is applied.NullPointerException - Throw this exception if mAGPWindowManager is null.