public class DisplayResizeController extends Object
This controller offers the following functions:
SystemCapability.Accessibility#ABILITY| 构造器 | 说明 |
|---|---|
DisplayResizeController(int connectionId,
int displayId,
Object lock) |
A constructor used to create a
DisplayResizeController instance based on the connection ID, display ID,
and lock. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addListener(DisplayResizeListener listener) |
Adds a
DisplayResizeListener instance to observe display resizing operations. |
boolean |
deleteListener(DisplayResizeListener listener) |
Removes the specified
DisplayResizeListener instance. |
float |
getCenterX() |
Obtains the X coordinate of the center in this display resizing rectangle.
|
float |
getCenterY() |
Obtains the Y coordinate of the center in this display resizing rectangle.
|
Rect |
getDisplayResizeRect() |
Obtains the display resizing rectangle.
|
float |
getScale() |
Obtains the resizing scale of this display resizing rectangle.
|
boolean |
reset(boolean isShouldAnimate) |
Resets the display to its initial size.
|
boolean |
setCenter(float centerX,
float centerY,
boolean isShouldAnimate) |
Sets the center coordinates for the display resizing rectangle.
|
boolean |
setScale(float scale,
boolean isShouldAnimate) |
Sets the display resizing scale.
|
public DisplayResizeController(int connectionId,
int displayId,
Object lock)
DisplayResizeController instance based on the connection ID, display ID,
and lock.connectionId - Indicates the connection ID used to create DisplayResizeController.displayId - Indicates the display ID used to create DisplayResizeController.lock - Indicates the lock used to create DisplayResizeController.public void addListener(DisplayResizeListener listener)
DisplayResizeListener instance to observe display resizing operations.listener - Indicates the listener to add.public boolean deleteListener(DisplayResizeListener listener)
DisplayResizeListener instance.listener - Indicates the listener to remove.true if the listener is successfully removed; returns false otherwise.public float getScale()
public float getCenterX()
public float getCenterY()
public boolean setScale(float scale,
boolean isShouldAnimate)
scale - Indicates the scale for resizing the display, ranging from 1.0f to 10.0f.isShouldAnimate - Specifies whether animation is required. The value can be true or false.true if the resizing scale is successfully set; returns false otherwise.public boolean setCenter(float centerX,
float centerY,
boolean isShouldAnimate)
centerX - Indicates the X coordinate of the center for resizing the display.centerY - Indicates the Y coordinate of the center for resizing the display.isShouldAnimate - Specifies whether animation is required. The value can be true or false.true if the center coordinates are successfully set; returns false otherwise.public Rect getDisplayResizeRect()
public boolean reset(boolean isShouldAnimate)
isShouldAnimate - Specifies whether animation is required. The value can be true or false.true if the display is successfully reset; returns false otherwise.