“af7f407ecf468c0b28d5969e2a26d01511f09af2”上不存在“git@gitcode.net:s920243400/PaddleDetection.git”
提交 104c718b 编写于 作者: E ester.zhou

update docs

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 a4c444db
# Wallpaper # Wallpaper
> **NOTE**<br>The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > **NOTE**
>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -465,7 +467,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses an a ...@@ -465,7 +467,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses an a
}).catch((error) => { }).catch((error) => {
console.error(`failed to createPixelMap because: ` + JSON.stringify(error)); console.error(`failed to createPixelMap because: ` + JSON.stringify(error));
}); });
``` ```
## wallpaper.setWallpaper ## wallpaper.setWallpaper
...@@ -520,7 +522,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses a pr ...@@ -520,7 +522,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses a pr
}).catch((error) => { }).catch((error) => {
console.error(`failed to createPixelMap because: ` + JSON.stringify(error)); console.error(`failed to createPixelMap because: ` + JSON.stringify(error));
}); });
``` ```
## wallpaper.getFile<sup>8+</sup> ## wallpaper.getFile<sup>8+</sup>
...@@ -636,7 +638,7 @@ Obtains the pixel image for the wallpaper of the specified type. This API uses a ...@@ -636,7 +638,7 @@ Obtains the pixel image for the wallpaper of the specified type. This API uses a
**Example** **Example**
```js ```js
wallpaper.getPixelMap(WALLPAPER_SYSTEM).then((data) => { wallpaper.getPixelMap(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then((data) => {
console.info('wallpaperXTS ===> testGetPixelMapPromiseSystem data : ' + data); console.info('wallpaperXTS ===> testGetPixelMapPromiseSystem data : ' + data);
console.info('wallpaperXTS ===> testGetPixelMapPromiseSystem data : ' + JSON.stringify(data)); console.info('wallpaperXTS ===> testGetPixelMapPromiseSystem data : ' + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
...@@ -697,7 +699,7 @@ Unsubscribes from the wallpaper color change event. ...@@ -697,7 +699,7 @@ Unsubscribes from the wallpaper color change event.
wallpaper.off('colorChange', listener); wallpaper.off('colorChange', listener);
//Unsubscribe from all subscriptions of the colorChange type. //Unsubscribe from all subscriptions of the colorChange type.
wallpaper.off('colorChange'); wallpaper.off('colorChange');
``` ```
## RgbaColor ## RgbaColor
......
# marquee # marquee
The **\<marquee>** component displays single-line scrolling text. > **NOTE**
>
> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version.
> Since API version 6, the text scrolls only when its width exceeds the width of the **\<marquee>** component.
The **\<marquee>** component is used to display a scrolling piece of text.
## Required Permissions ## Required Permissions
None None
## Child Component
## Child Components
Not supported Not supported
## Attributes
In addition to the attributes in [Universal Attributes](js-components-common-attributes.md), the following attributes are supported. ## Attributes
In addition to the [universal attributes](../arkui-js/js-components-common-attributes.md), the following attributes are supported.
| Name | Type | Default Value | Mandatory | Description |
| ------------ | ------ | ---- | ---- | ---------------------------------------- |
| scrollamount | number | 6 | No | Maximum length of each scroll. |
| loop | number | -1 | No | Number of rolling times. If this parameter is not set, the default value **-1** is used. When the value is less than or equal to **0**, the marquee scrolls continuously.|
| direction | string | left | No | Direction in which the marquee scrolls, which can be **left** or **right**. |
| Name | Type | Default Value | Mandatory | Description |
| ------------ | ------ | ------------- | --------- | ------------------------------------------------------------ |
| scrollamount | number | 6 | No | Maximum length of each scroll. |
| loop | number | -1 | No | Number of rolling times. If this parameter is not set, the default value **-1** is used. When the value is less than or equal to **0**, the marquee scrolls continuously. |
| direction | string | left | No | Direction in which the marquee scrolls, which can be **left** or **right**. |
## Styles ## Styles
In addition to the styles in [Universal Styles](js-components-common-styles.md), the following styles are supported. In addition to the [universal styles](../arkui-js/js-components-common-styles.md), the following styles are supported.
| Name | Type | Default Value | Mandatory | Description |
| ----------- | -------------------------- | ---------- | ---- | ---------------------------------------- |
| color | &lt;color&gt; | \#e5000000 | No | Font color of the scrolling text. |
| font-size | &lt;length&gt; | 37.5 | No | Font size of the scrolling text. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.<br>If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart.|
| font-weight | number&nbsp;\|&nbsp;string | normal | No | Font weight of the scrolling text. For details, see **font-weight** of the **[\<text> component](../arkui-js/js-components-basic-text.md#styles)**.|
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified [custom font](../arkui-js/js-components-common-customizing-font.md) is used for the text.|
| Name | Type | Default Value | Mandatory | Description |
| ----------- | ---------------- | ------------- | --------- | ------------------------------------------------------------ |
| color | \<color> | #e5000000 | No | Font color of the scrolling text. |
| font-size | \<length> | 37.5 | No | Font size of the scrolling text. |
| allow-scale | boolean | true | No | Whether the font size changes with the system's font size settings.NOTE:If the **config-changes** tag of **fontSize** is configured for abilities in the **config.json** file, the setting takes effect without application restart. |
| font-weight | number \| string | normal | No | Font weight of the scrolling text. For details, see [font-weight](js-components-basic-text.md#section5775351116) of the **text** component. |
| font-family | string | sans-serif | No | Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font that exists in the system or the font specified by [Custom Font Styles](js-components-common-customizing-font.md) in the family is selected as the font for the text. |
## Events ## Events
In addition to the events in [Universal Events](js-components-common-events.md), the following events are supported. In addition to the [universal events](../arkui-js/js-components-common-events.md), the following events are supported.
| Name | Parameter | Description | | Name | Parameter | Description |
| ------------ | --------- | ------------------------------------------------------------ | | ------------ | ---- | ---------------------------------------- |
| bounce(Rich) | - | Triggered when the marquee scrolls to the end. | | bounce(Rich) | - | Triggered when the marquee scrolls to the end. |
| finish(Rich) | - | Triggered when the marquee finishes the specified number of scrollings (value of the **loop** attribute). It can be triggered only when the **loop** attribute is set to a number greater than 0. | | finish(Rich) | - | Triggered when the marquee finishes the specified number of scrollings (value of the **loop** attribute). It can be triggered only when the **loop** attribute is set to a number greater than 0.|
| start(Rich) | - | Triggered when the marquee starts to scroll. | | start(Rich) | - | Triggered when the marquee starts to scroll. |
## Methods ## Methods
In addition to the methods in [Universal Methods](js-components-common-methods.md), the following events are supported. In addition to the [universal methods](../arkui-js/js-components-common-methods.md), the following methods are supported.
| Name | Parameter | Description |
| ----- | ---- | ----- |
| start | - | Starts scrolling.|
| stop | - | Stops scrolling.|
| Name | Parameter | Description | ## Example
| ----- | --------- | ----------------- |
| start | - | Starts scrolling. |
| stop | - | Stops scrolling. |
## Example Code ```html
```
<!-- xxx.hml --> <!-- xxx.hml -->
<div class="container"> <div class="container">
<marquee id="customMarquee" class="customMarquee" scrollamount="{{scrollAmount}}" loop="{{loop}}"direction="{{marqueeDir}}" <marquee id="customMarquee" class="customMarquee" scrollamount="{{scrollAmount}}" loop="{{loop}}"direction="{{marqueeDir}}"
...@@ -71,6 +73,9 @@ In addition to the methods in [Universal Methods](js-components-common-methods.m ...@@ -71,6 +73,9 @@ In addition to the methods in [Universal Methods](js-components-common-methods.m
<button class="controlButton" onclick="onStopClick">Stop</button> <button class="controlButton" onclick="onStopClick">Stop</button>
</div> </div>
</div> </div>
```
```css
/* xxx.css */ /* xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -99,6 +104,9 @@ In addition to the methods in [Universal Methods](js-components-common-methods.m ...@@ -99,6 +104,9 @@ In addition to the methods in [Universal Methods](js-components-common-methods.m
background-color: #F2F2F2; background-color: #F2F2F2;
text-color: #0D81F2; text-color: #0D81F2;
} }
```
```js
// xxx.js // xxx.js
export default { export default {
data: { data: {
...@@ -125,4 +133,4 @@ export default { ...@@ -125,4 +133,4 @@ export default {
} }
``` ```
![img](figures/lite_bar.gif) ![lite_bar](figures/lite_bar.gif)
\ No newline at end of file
# Marquee # Marquee
> **NOTE**<br> > **NOTE**
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. >
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **\<Marquee>** component is used to display a scrolling piece of text. The **\<Marquee>** component is used to display a scrolling piece of text. The text is scrolled only when its width exceeds the width of the **\<Marquee>** component.
## Required Permissions ## Required Permissions
...@@ -44,7 +45,8 @@ Marquee(value: { start: boolean, step?: number, loop?: number, fromStart?: boole ...@@ -44,7 +45,8 @@ Marquee(value: { start: boolean, step?: number, loop?: number, fromStart?: boole
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct MarqueeExample { struct MarqueeExample {
...@@ -63,6 +65,7 @@ struct MarqueeExample { ...@@ -63,6 +65,7 @@ struct MarqueeExample {
fromStart: this.fromStart, fromStart: this.fromStart,
src: this.src src: this.src
}) })
.width(400)
.fontColor(Color.White) .fontColor(Color.White)
.fontSize(50) .fontSize(50)
.allowScale(false) .allowScale(false)
......
# Video # Video
> **NOTE**<br> > **NOTE**
>
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **\<Video>** component provides a video player. The **\<Video>** component provides a video player.
...@@ -19,12 +20,10 @@ To use online videos, you need to add the **ohos.permission.INTERNET** permissio ...@@ -19,12 +20,10 @@ To use online videos, you need to add the **ohos.permission.INTERNET** permissio
] ]
``` ```
## Child Components ## Child Components
Not supported Not supported
## APIs ## APIs
Video(value: VideoOptions) Video(value: VideoOptions)
...@@ -33,30 +32,29 @@ Video(value: VideoOptions) ...@@ -33,30 +32,29 @@ Video(value: VideoOptions)
| Name| Type| Mandatory| Default Value| Description| | Name| Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| src | string \| [Resource](../../ui/ts-types.md) | No| - | Path of the video source, which can be a local path or a URL.<br>The video resources can be stored in the **video** or **rawfile** folder under **resources**.<br>The path can include a **dataability://** prefix, which is used to access the video path provided by a Data ability. For details about the path, see [Data Ability Development](../../ability/fa-dataability.md).| | src | string \| [Resource](../../ui/ts-types.md) | No| - | Path of the video source, which can be a local path or a URL.<br>The video resources can be stored in the **video** or **rawfile** folder under **resources**.<br>The path can include a **dataability://** prefix, which is used to access the video path provided by a Data ability. For details about the path, see [Data Ability Development](../../ability/fa-dataability.md).|
| currentProgressRate | number \| PlaybackSpeed<sup>8+</sup> | No| 1.0 \| PlaybackSpeed.<br>Speed_Forward_1_00_X | Video playback speed.<br>> **NOTE**<br>> The value of the number type can only be **0.75**, **1.0**, **1.25**, **1.75**, or **2.0**.<br>| | currentProgressRate | number \| PlaybackSpeed<sup>8+</sup> | No| 1.0 \| PlaybackSpeed.<br>Speed_Forward_1_00_X | Video playback speed.<br>**NOTE**<br>The value of the number type can only be **0.75**, **1.0**, **1.25**, **1.75**, or **2.0**. |
| previewUri | string \| PixelMap<sup>8+</sup> \| [Resource](../../ui/ts-types.md) | No| - | Path of the preview image.| | previewUri | string \| PixelMap<sup>8+</sup> \| [Resource](../../ui/ts-types.md) | No| - | Path of the preview image.|
| controller | [VideoController](#videocontroller) | No| - | Controller.| | controller | [VideoController](#videocontroller) | No| - | Controller.|
- PlaybackSpeed<sup>8+</sup> - PlaybackSpeed<sup>8+</sup>
| Name| Description| | Name | Description |
| -------- | -------- | | -------------------- | --------------------- |
| Speed_Forward_0_75_X | 0.75x playback speed.| | Speed_Forward_0_75_X | 0.75x playback speed. |
| Speed_Forward_1_00_X | 1x playback speed.| | Speed_Forward_1_00_X | 1x playback speed. |
| Speed_Forward_1_25_X | 1.25x playback speed.| | Speed_Forward_1_25_X | 1.25x playback speed. |
| Speed_Forward_1_75_X | 1.75x playback speed.| | Speed_Forward_1_75_X | 1.75x playback speed. |
| Speed_Forward_2_00_X | 2x playback speed.| | Speed_Forward_2_00_X | 2x playback speed. |
## Attributes ## Attributes
| Name| Type| Default Value| Description| | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | --------- | ---------------------------------------- | ------------- | -------------------------------------------------- |
| muted | boolean | false | Whether the video is muted.| | muted | boolean | false | Whether the video is muted. |
| autoPlay | boolean | false | Whether to enable auto play.| | autoPlay | boolean | false | Whether to enable auto play. |
| controls | boolean | true | Whether to display the video playback control bar.| | controls | boolean | true | Whether to display the video playback control bar. |
| objectFit | [ImageFit](ts-basic-components-image.md) | Cover | Video scale type. | | objectFit | [ImageFit](ts-basic-components-image.md) | Cover | Video scale type. |
| loop | boolean | false | Whether to repeat the video.| | loop | boolean | false | Whether to repeat the video. |
## Events ## Events
...@@ -110,9 +108,10 @@ setCurrentTime(value: number) ...@@ -110,9 +108,10 @@ setCurrentTime(value: number)
Sets the video playback position. Sets the video playback position.
- Parameters - Parameters
| Name| Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- | | Name | Type | Mandatory | Default Value | Description |
| value | number | Yes| - | Video playback position.| | ----- | ------ | --------- | ------------- | ------------------------ |
| value | number | Yes | - | Video playback position. |
### requestFullscreen ### requestFullscreen
...@@ -121,9 +120,10 @@ requestFullscreen(value: boolean) ...@@ -121,9 +120,10 @@ requestFullscreen(value: boolean)
Requests full-screen mode. Requests full-screen mode.
- Parameters - Parameters
| Name| Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- | | Name | Type | Mandatory | Default Value | Description |
| value | number | Yes| false | Whether the playback is in full-screen mode.| | ----- | ------ | --------- | ------------- | -------------------------------------------- |
| value | boolean | Yes | false | Whether the playback is in full-screen mode. |
### exitFullscreen ### exitFullscreen
...@@ -138,20 +138,20 @@ setCurrentTime(value: number, seekMode: SeekMode) ...@@ -138,20 +138,20 @@ setCurrentTime(value: number, seekMode: SeekMode)
Sets the video playback position with the specified seek mode. Sets the video playback position with the specified seek mode.
- Parameters - Parameters
| Name| Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- |
| value | number | Yes| - | Video playback position.|
| seekMode | SeekMode | Yes| - | Seek mode.|
- SeekMode<sup>8+</sup> | Name | Type | Mandatory | Default Value | Description |
| Name| Description| | -------- | -------- | --------- | ------------- | ----------------------- |
| -------- | -------- | | value | number | Yes | - | Video playback position. |
| PreviousKeyframe | Seeks to the nearest previous keyframe.| | seekMode | SeekMode | Yes | - | Seek mode. |
| NextKeyframe | Seeks to the nearest next keyframe.|
| ClosestKeyframe | Seeks to the nearest keyframe.|
| Accurate | Seeks to a specific frame, regardless of whether the frame is a keyframe.|
- SeekMode<sup>8+</sup>
| Name | Description |
| ---------------- | ------------------------------------------------------------------------- |
| PreviousKeyframe | Seeks to the nearest previous keyframe. |
| NextKeyframe | Seeks to the nearest next keyframe. |
| ClosestKeyframe | Seeks to the nearest keyframe. |
| Accurate | Seeks to a specific frame, regardless of whether the frame is a keyframe. |
## Example ## Example
...@@ -232,4 +232,4 @@ struct VideoCreateComponent { ...@@ -232,4 +232,4 @@ struct VideoCreateComponent {
} }
} }
} }
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册