ts-basic-components-remotewindow.md 2.5 KB
Newer Older
E
ester.zhou 已提交
1 2 3 4 5 6 7 8
# RemoteWindow

**\<RemoteWindow>** is a component used to control the application window, providing the component animator and application window linkage animator during application startup and exit.

>  **NOTE**
>  
>  This component is supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
>
E
ester.zhou 已提交
9
>  The APIs provided by this component are system APIs.
E
ester.zhou 已提交
10 11 12 13 14 15 16 17 18 19 20

## Child Components

Not supported

## APIs

RemoteWindow(target: WindowAnimationTarget)

Creates a **\<RemoteWindow>** through a window animation object.

E
ester.zhou 已提交
21 22 23 24 25
**Parameters**

| Name| Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- |
| target | [WindowAnimationTarget](#windowanimationtarget) | Yes| - | Description of the animation window to control.|
E
ester.zhou 已提交
26 27

## WindowAnimationTarget
E
ester.zhou 已提交
28

E
ester.zhou 已提交
29 30 31 32 33 34 35
Implements a target window, which is used to remotely control the animation.

| Name     | Type    | Description|
| ------- | ------ | ----------------------- |
| bundleName  | string | Process corresponding to the animation window.|
| abilityName | string | Ability corresponding to the animation window.|
| windowBounds | [RRect](#rrect) | Actual size of the animation window.|
E
ester.zhou 已提交
36
| missionId  | number | Mission ID.|
E
ester.zhou 已提交
37 38

## RRect
E
ester.zhou 已提交
39

E
ester.zhou 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
Implements a rounded rectangle.

| Name     | Type    | Description|
| ------- | ------ | ----------------------- |
| left  | number | Horizontal coordinate of the upper left corner of the animation window relative to the screen.|
| top | number | Vertical coordinate of the upper left corner of the animation window relative to the screen.|
| width | number | Width of the animation window.|
| height | number | Height of the animation window.|
| radius | number | Radius of the rounded corner of the animation window.|

## Attributes

The [universal attributes](ts-universal-attributes-size.md) are supported.

## Events

The [universal events](ts-universal-events-click.md) are supported.

## Example

```ts
// xxx.ets
@Entry
@Component
struct RemoteWindowExample {
  @State target: WindowAnimationTarget = undefined // Obtained through windowAnimationManager

  build() {
    Column() {
      RemoteWindow(this.target)
70 71 72 73
      	.translate({ x: 100, y: 200 })
      	.scale({ x: 0.5, y: 0.5 })
        .opacity(0.8)
      	.position({ x: px2vp(this.target?.windowBounds.left), y: px2vp(this.target?.windowBounds.top) })
E
ester.zhou 已提交
74 75 76 77 78 79
      	.width(px2vp(this.target?.windowBounds.width))
      	.height(px2vp(this.target?.windowBounds.height))
     }
  }
}
```