diff --git a/en/application-dev/device/figures/en-us_image_0000001180249428.png b/en/application-dev/device/figures/en-us_image_0000001180249428.png new file mode 100644 index 0000000000000000000000000000000000000000..efd258b98d9a4eb2a72767bd808eef4f49900d32 Binary files /dev/null and b/en/application-dev/device/figures/en-us_image_0000001180249428.png differ diff --git a/en/application-dev/device/vibrator-guidelines.md b/en/application-dev/device/vibrator-guidelines.md new file mode 100644 index 0000000000000000000000000000000000000000..88bdeb6884eee52e1591993ec60099d31eb77e3c --- /dev/null +++ b/en/application-dev/device/vibrator-guidelines.md @@ -0,0 +1,84 @@ +# Vibrator Development + + +## When to Use + +You can set different vibration effects as needed, for example, customizing vibration effects with different intensities and durations for buttons on the device, and customizing one-shot or periodic vibration effects with different intensities and durations for alarm clocks and incoming calls. + + +## Available APIs + + | Module | API | Description | +| -------- | -------- | -------- | +| ohos.vibrator | vibrate(duration: number): Promise<void> | Triggers vibration with the specified duration. This API uses a promise to return the result. | +| ohos.vibrator | vibrate(duration: number, callback?: AsyncCallback<void>): void | Triggers vibration with the specified duration. This API uses a callback to return the result. | +| ohos.vibrator | vibrate(effectId: EffectId): Promise<void> | Triggers vibration with the specified effect. This API uses a promise to return the result. | +| ohos.vibrator | vibrate(effectId: EffectId, callback?: AsyncCallback<void>): void | Triggers vibration with the specified effect. This API uses a callback to return the result. | +| ohos.vibrator | stop(stopMode: VibratorStopMode): Promise<void> | Stops vibration. This API uses a promise to return the result. | +| ohos.vibrator | stop(stopMode: VibratorStopMode, callback?: AsyncCallback<void>): void | Stops vibration. This API uses a callback to return the result. | + + +## How to Develop + +1. Declare the permissions required for controlling vibrators on the hardware device in the **config.json** file. + + ``` + "reqPermissions":[ + { + "name":"ohos.permission.ACCELEROMETER", + "reason"":"", + "usedScene":{ + "ability""[ + ".MainAbility" + ], + "when":"inuse" + } + }, + { + "name":"ohos.permission.VIBRATE", + "reason"":"", + "usedScene":{ + "ability""[ + ".MainAbility" + ], + "when":"inuse" + } + }, + { + "name":"ohos.permission.ACTIVITY_MOTION", + "reason"":"", + "usedScene":{ + "ability""[ + ".MainAbility" + ], + "when":"inuse" + } + }, + ] + ``` + +2. Trigger the device to vibrate. + + ``` + import vibrator from "@ohos.vibrator" + vibrator.vibrate(duration: number).then((error)=>{ + if(error){// The call fails, and error.code and error.message are printed. + console.log("Promise return failed.error.code"+error.code+"error.message"+error.message); + }else{// The call succeeded. The device starts to vibrate. + console.log("Promise returned to indicate a successful vibration.") + }; + }) + ``` + +3. Stop the vibration. + + ``` + import vibrator from "@ohos.vibrator" + vibrator.stop(stopMode: VibratorStopMode).then((error)=>{ + if(error){// The call fails, and error.code and error.message are printed. + console.log("Promise return failed. error.code"+error.code+"error.message"+error.message); + }else{// The call succeeded. The device stops vibration. + Console.log("Promise returned to indicate a successful stop."); + }; + }) + ``` diff --git a/en/application-dev/device/vibrator-overview.md b/en/application-dev/device/vibrator-overview.md new file mode 100644 index 0000000000000000000000000000000000000000..3d8f187054dd1f0da3e3099bd10e3cb28e5a9b15 --- /dev/null +++ b/en/application-dev/device/vibrator-overview.md @@ -0,0 +1,25 @@ +# Vibrator Overview + + +The vibrator service opens up the latest capabilities of the vibrator hardware to the maximum extent. By expanding the native vibrator service to implement integrated vibration and interaction design, the service delivers an exquisite integrated vibration experience and differentiated experience, and improves user interaction efficiency and usability. + + +## Working Principles + +The vibrator is a Misc device that consists of four modules: Vibrator API, Vibrator Framework, Vibrator Service, and HD_IDL. + + **Figure1** Vibrator in Misc devices + ![en-us_image_0000001180249428](figures/en-us_image_0000001180249428.png) + +- Vibrator API: provides basic vibrator APIs, including the APIs for querying the vibrator list, querying the vibrator by effect, and triggering and stopping vibration. + +- Vibrator Framework: manages the framework layer of the vibrator and communicates with the Misc Device Service. + +- Vibrator Service: manages services of vibrators. + +- HD_IDL: adapts to different devices. + + +## Constraints + +When using a vibrator, you need to declare and obtain the **ohos.permission.VIBRATE** permission first so that you can control the vibration effect. diff --git a/en/application-dev/ui/Readme-EN.md b/en/application-dev/ui/Readme-CN.md old mode 100755 new mode 100644 similarity index 73% rename from en/application-dev/ui/Readme-EN.md rename to en/application-dev/ui/Readme-CN.md index 3ab9ea92f9b73bb2ed358a7cea895dd52eb36f7e..d398aa74d8d44f8da390c879c4a9e83b094b17c4 --- a/en/application-dev/ui/Readme-EN.md +++ b/en/application-dev/ui/Readme-CN.md @@ -1,6 +1,7 @@ # UI -- JavaScript-based Web-Like Development Paradigm +- [ArkUI Overview](arkui-overview.md) +- JavaScript-based Web-like Development Paradigm - [Overview](ui-js-overview.md) - Framework - [File Organization](js-framework-file.md) @@ -25,26 +26,27 @@ - [Developing Animations](ui-js-building-ui-animation.md) - [Defining Events](ui-js-building-ui-event.md) - [Defining Page Routes](ui-js-building-ui-routes.md) - - Common Component Development Guidelines - - [Text](ui-js-components-text.md) - - [Input](ui-js-components-input.md) - - [Button](ui-js-components-button.md) - - [List](ui-js-components-list.md) - - [Picker](ui-js-components-picker.md) - - [Dialog](ui-js-components-dialog.md) - - [Form](ui-js-components-form.md) - - [Stepper](ui-js-components-stepper.md) - - [Tabs](ui-js-component-tabs.md) - - [Image](ui-js-components-images.md) + - Common Component Development Guidelines + - [<text> Development](ui-js-components-text.md) + - [<input> Development](ui-js-components-input.md) + - [<button> Development](ui-js-components-button.md) + - [<list> Development](ui-js-components-list.md) + - [<picker> Development](ui-js-components-picker.md) + - [<dialog> Development](ui-js-components-dialog.md) + - [<form> Development](ui-js-components-form.md) + - [<stepper> Development](ui-js-components-stepper.md) + - [<tabs> Development](ui-js-component-tabs.md) + - [<image> Development](ui-js-components-images.md) - Animation Development Guidelines - CSS Animation - [Defining Attribute Style Animations](ui-js-animate-attribute-style.md) - [Defining Animations with the transform Attribute](ui-js-animate-transform.md) - [Defining Animations with the background-position Attribute](ui-js-animate-background-position-style.md) + - [Defining Animations for SVG Components](ui-js-animate-svg.md) - JS Animation - [Component Animation](ui-js-animate-component.md) - Interpolator Animation - - [Animation Effect](ui-js-animate-dynamic-effects.md) + - [Animation Effect](ui-js-animate-dynamic-effects.md) - [Animation Frame](ui-js-animate-frame.md) - [Custom Components](ui-js-custom-components.md) - TypeScript-based Declarative Development Paradigm @@ -65,9 +67,9 @@ - General UI Description Specifications - [Basic Concepts](ts-general-ui-concepts.md) - Declarative UI Description Specifications - - [Parameterless Configuration](ts-parameterless-configuration.md) + - [Configuration Without Parameters](ts-parameterless-configuration.md) - [Configuration with Mandatory Parameters](ts-configuration-with-mandatory-parameters.md) - - [Attribution Configuration](ts-attribution-configuration.md) + - [Attribute Configuration](ts-attribution-configuration.md) - [Event Configuration](ts-event-configuration.md) - [Child Component Configuration](ts-child-component-configuration.md) - Componentization @@ -77,6 +79,7 @@ - [@Builder](ts-component-based-builder.md) - [@Extend](ts-component-based-extend.md) - [@CustomDialog](ts-component-based-customdialog.md) + - [@Styles](ts-component-based-styles.md) - About UI State Management - [Basic Concepts](ts-ui-state-mgmt-concepts.md) - Managing Component States @@ -88,19 +91,21 @@ - [PersistentStorage](ts-application-states-apis-persistentstorage.md) - [Environment](ts-application-states-apis-environment.md) - Managing Other States - - [@observed and @objectLink](ts-other-states-observed-objectlink.md) + - [@Observed and @ObjectLink](ts-other-states-observed-objectlink.md) - [@Consume and @Provide](ts-other-states-consume-provide.md) - [@Watch](ts-other-states-watch.md) - - About Rendering Control Syntax - - [if/else](ts-rending-control-syntax-if-else.md) - - [ForEach](ts-rending-control-syntax-foreach.md) - - [LazyForEach](ts-rending-control-syntax-lazyforeach.md) + - About Rendering Control Syntax + - [if/else](ts-rending-control-syntax-if-else.md) + - [ForEach](ts-rending-control-syntax-foreach.md) + - [LazyForEach](ts-rending-control-syntax-lazyforeach.md) - About @Component - [build Function](ts-function-build.md) - - [Custom Component Initialization](ts-custom-component-initialization.md) + - [Initialization of Custom Components' Member Variables](ts-custom-component-initialization.md) - [Custom Component Lifecycle Callbacks](ts-custom-component-lifecycle-callbacks.md) - - [Example: Component Creation and Re-Initialization](ts-component-creation-re-initialization.md) - - [Syntactic Sugar](ts-syntactic-sugar.md) + - [Component Creation and Re-initialization](ts-component-creation-re-initialization.md) + - [About Syntactic Sugar](ts-syntactic-sugar.md) + - Common Component Development Guidelines + - [<web> Development](ui-ts-components-web.md) - Experiencing the Declarative UI - [Creating a Declarative UI Project](ui-ts-creating-project.md) - [Getting to Know Components](ui-ts-components.md) @@ -110,4 +115,3 @@ - [Building a Food Category List Layout](ui-ts-building-category-list-layout.md) - [Building a Food Category Grid Layout](ui-ts-building-category-grid-layout.md) - [Implementing Page Redirection and Data Transmission](ui-ts-page-redirection-data-transmission.md) - diff --git a/en/application-dev/ui/arkui-overview.md b/en/application-dev/ui/arkui-overview.md new file mode 100644 index 0000000000000000000000000000000000000000..a5ba95916cfd3fad3e6eebe945ea6f22f6aa2aea --- /dev/null +++ b/en/application-dev/ui/arkui-overview.md @@ -0,0 +1,58 @@ +# ArkUI Overview + + +## Introduction + +ArkUI is a UI development framework that provides what you'll need to develop application UIs. + + +## Basic Concepts + +- Component: the smallest unit for UI building and display. You build a UI that meets your needs through flexible combinations of components. + +- Page: the smallest unit for ArkUI application scheduling. You can design multiple pages for your application, manage their files on a per-page basis, and schedule page redirection through routing APIs, so as to implement decoupling of application functions. + + +## Key Capabilities + +- Diverse components: In addition to a wide range of basic components, such as components for text display, image display, and keypress interaction, ArkUI provides media components that support video playback. Better yet, it also provides polymorphic components, which can adapt to styles of different devices. + +- Flexible layouts: Creating a responsive UI in ArkUI is easy, with our carefully-designed layout approaches: Besides the classic flexible layout capability, you also have access to the list, grid, and atomic layouts that auto-adapt to screen resolutions. + +- Animation: Apart from animations embedded in components, ArkUI offers additional animation features: attribute animation, transition animation, and custom animation. + +- UI interaction: ArkUI allows users to interact with your application UI properly, regardless of the system platform and input device. By default, the UI accepts input from touch gestures, remote controls, and mouse devices, with support for the event notification capability. + +- Drawing: ArkUI offers advanced drawing capabilities that allow you to draw custom shapes with a range of editors, from images to fill colors and texts. + +- Platform API channel: ArkUI provides an API extension mechanism through which platform capabilities are encapsulated to produce JavaScript APIs in a unified style. + + +## Development Paradigms + +ArkUI comes with two development paradigms: JavaScript-based web-like development paradigm (web-like development paradigm for short) and TypeScript-based declarative development paradigm (declarative development paradigm for short). You can choose whichever development paradigm that aligns with your practice. + + +### Web-like Development Paradigm + +The web-like development paradigm uses the classical three-stage programming model, in which OpenHarmony Markup Language (HML) is used for building layouts, CSS for defining styles, and JavaScript for adding processing logic. UI components are associated with data through one-way data-binding. This means that when data changes, the UI automatically updates with the new data. This development paradigm has a low learning curve for frontend web developers, allowing them to quickly transform existing web applications into ArkUI applications. It could be helpful if you are developing small- and medium-sized applications with simple UIs. + + +### Declarative Development Paradigm + +The declarative development paradigm uses the TypeScript programming language and extends the declarative UI syntax, providing UI drawing capabilities from three dimensions: component, animation, and state management. The programming mode used is closer to natural semantics. You can intuitively describe the UI without caring about how the framework implements UI drawing and rendering, leading to simplified and efficient development. With type annotations in TypeScript, you can enforce type checking at compile time. If you are developing large applications, the declarative development paradigm is more applicable. + + +### Web-like Development Paradigm vs. Declarative Development Paradigm + + | Development Paradigm | Language | UI Update Mode | Applicable To | Intended Audience | +| -------- | -------- | -------- | -------- | -------- | +| Web-like development paradigm | JavaScript | Data-driven | Applets and service widgets with simple UIs | Frontend web developers | +| Declarative development paradigm | Extended TypeScript (eTS) | Data-driven | Applications involving technological sophistication and teamwork | Mobile application and system application developers | + + +### Framework Structure + +![en-us_image_0000001267647869](figures/en-us_image_0000001267647869.png) + +As shown above, the two development paradigms share the UI backend engine and language runtime. The UI backend engine implements the six basic capabilities of the ArkUI framework. The declarative development paradigm does not require the JS Framework for managing the page DOM. As such, it has more streamlined rendering and update links and less memory usage. This makes the declarative development paradigm a better choice for building application UIs. diff --git a/en/application-dev/ui/figures/000000.png b/en/application-dev/ui/figures/000000.png deleted file mode 100644 index 58293d5e874f2aa36ecaf7282ca9e4736318092f..0000000000000000000000000000000000000000 Binary files a/en/application-dev/ui/figures/000000.png and /dev/null differ diff --git a/en/application-dev/ui/figures/01-0.png b/en/application-dev/ui/figures/01-0.png deleted file mode 100644 index ac085642762d13eddbdab4a96ad6f629057d3d8e..0000000000000000000000000000000000000000 Binary files a/en/application-dev/ui/figures/01-0.png and /dev/null differ diff --git a/en/application-dev/ui/figures/3.png b/en/application-dev/ui/figures/3.png deleted file mode 100644 index 5be6a14c5f547453bc6a9d3c4f31d2019e9f905a..0000000000000000000000000000000000000000 Binary files a/en/application-dev/ui/figures/3.png and /dev/null differ diff --git a/en/application-dev/ui/figures/en-us_image_0000001182832088.gif b/en/application-dev/ui/figures/en-us_image_0000001182832088.gif new file mode 100644 index 0000000000000000000000000000000000000000..53a8a2063ae440915a9b1710d9b184c470f26010 Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001182832088.gif differ diff --git a/en/application-dev/ui/figures/en-us_image_0000001183871404.gif b/en/application-dev/ui/figures/en-us_image_0000001183871404.gif new file mode 100644 index 0000000000000000000000000000000000000000..92bac3bec6a14037b71c86d76d4d87ac3a40171a Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001183871404.gif differ diff --git a/en/application-dev/ui/figures/en-us_image_0000001214595111.png b/en/application-dev/ui/figures/en-us_image_0000001222807756.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001214595111.png rename to en/application-dev/ui/figures/en-us_image_0000001222807756.png diff --git a/en/application-dev/ui/figures/4.gif b/en/application-dev/ui/figures/en-us_image_0000001222807760.gif similarity index 100% rename from en/application-dev/ui/figures/4.gif rename to en/application-dev/ui/figures/en-us_image_0000001222807760.gif diff --git a/en/application-dev/ui/figures/2.png b/en/application-dev/ui/figures/en-us_image_0000001222807768.png similarity index 100% rename from en/application-dev/ui/figures/2.png rename to en/application-dev/ui/figures/en-us_image_0000001222807768.png diff --git a/en/application-dev/ui/figures/32.gif b/en/application-dev/ui/figures/en-us_image_0000001222807772.gif similarity index 100% rename from en/application-dev/ui/figures/32.gif rename to en/application-dev/ui/figures/en-us_image_0000001222807772.gif diff --git a/en/application-dev/ui/figures/d2.gif b/en/application-dev/ui/figures/en-us_image_0000001222807776.gif similarity index 100% rename from en/application-dev/ui/figures/d2.gif rename to en/application-dev/ui/figures/en-us_image_0000001222807776.gif diff --git a/en/application-dev/ui/figures/01.png b/en/application-dev/ui/figures/en-us_image_0000001222807780.png similarity index 100% rename from en/application-dev/ui/figures/01.png rename to en/application-dev/ui/figures/en-us_image_0000001222807780.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001214330169.png b/en/application-dev/ui/figures/en-us_image_0000001222807784.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001214330169.png rename to en/application-dev/ui/figures/en-us_image_0000001222807784.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001215199399.png b/en/application-dev/ui/figures/en-us_image_0000001222807792.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001215199399.png rename to en/application-dev/ui/figures/en-us_image_0000001222807792.png diff --git a/en/application-dev/ui/figures/7-11.png b/en/application-dev/ui/figures/en-us_image_0000001222807796.png similarity index 100% rename from en/application-dev/ui/figures/7-11.png rename to en/application-dev/ui/figures/en-us_image_0000001222807796.png diff --git a/en/application-dev/ui/figures/video_2021-10-22_103503.gif b/en/application-dev/ui/figures/en-us_image_0000001222807800.gif similarity index 100% rename from en/application-dev/ui/figures/video_2021-10-22_103503.gif rename to en/application-dev/ui/figures/en-us_image_0000001222807800.gif diff --git a/en/application-dev/ui/figures/25.gif b/en/application-dev/ui/figures/en-us_image_0000001222807808.gif similarity index 100% rename from en/application-dev/ui/figures/25.gif rename to en/application-dev/ui/figures/en-us_image_0000001222807808.gif diff --git a/en/application-dev/ui/figures/1-14.gif b/en/application-dev/ui/figures/en-us_image_0000001222807812.gif similarity index 100% rename from en/application-dev/ui/figures/1-14.gif rename to en/application-dev/ui/figures/en-us_image_0000001222807812.gif diff --git a/en/application-dev/ui/figures/running-effect.png b/en/application-dev/ui/figures/en-us_image_0000001222807816.png old mode 100755 new mode 100644 similarity index 100% rename from en/application-dev/ui/figures/running-effect.png rename to en/application-dev/ui/figures/en-us_image_0000001222807816.png diff --git a/en/application-dev/ui/figures/21.gif b/en/application-dev/ui/figures/en-us_image_0000001222967740.gif similarity index 100% rename from en/application-dev/ui/figures/21.gif rename to en/application-dev/ui/figures/en-us_image_0000001222967740.gif diff --git a/en/application-dev/ui/figures/05-3.png b/en/application-dev/ui/figures/en-us_image_0000001222967744.png similarity index 100% rename from en/application-dev/ui/figures/05-3.png rename to en/application-dev/ui/figures/en-us_image_0000001222967744.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001251421931.png b/en/application-dev/ui/figures/en-us_image_0000001222967752.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001251421931.png rename to en/application-dev/ui/figures/en-us_image_0000001222967752.png diff --git a/en/application-dev/ui/figures/29.gif b/en/application-dev/ui/figures/en-us_image_0000001222967756.gif similarity index 100% rename from en/application-dev/ui/figures/29.gif rename to en/application-dev/ui/figures/en-us_image_0000001222967756.gif diff --git a/en/application-dev/ui/figures/q2.gif b/en/application-dev/ui/figures/en-us_image_0000001222967760.gif similarity index 100% rename from en/application-dev/ui/figures/q2.gif rename to en/application-dev/ui/figures/en-us_image_0000001222967760.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001222967764.png b/en/application-dev/ui/figures/en-us_image_0000001222967764.png new file mode 100644 index 0000000000000000000000000000000000000000..62c786d7dacd69bae17ebe4074a2d429cd7f6851 Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001222967764.png differ diff --git a/en/application-dev/ui/figures/corespec_figures_state-mgmt-overview.png b/en/application-dev/ui/figures/en-us_image_0000001222967768.png similarity index 100% rename from en/application-dev/ui/figures/corespec_figures_state-mgmt-overview.png rename to en/application-dev/ui/figures/en-us_image_0000001222967768.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001168888822.png b/en/application-dev/ui/figures/en-us_image_0000001222967772.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168888822.png rename to en/application-dev/ui/figures/en-us_image_0000001222967772.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001213968747.png b/en/application-dev/ui/figures/en-us_image_0000001222967776.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001213968747.png rename to en/application-dev/ui/figures/en-us_image_0000001222967776.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001214128687.png b/en/application-dev/ui/figures/en-us_image_0000001222967780.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001214128687.png rename to en/application-dev/ui/figures/en-us_image_0000001222967780.png diff --git a/en/application-dev/ui/figures/page-routing.png b/en/application-dev/ui/figures/en-us_image_0000001222967784.png old mode 100755 new mode 100644 similarity index 100% rename from en/application-dev/ui/figures/page-routing.png rename to en/application-dev/ui/figures/en-us_image_0000001222967784.png diff --git a/en/application-dev/ui/figures/9.gif b/en/application-dev/ui/figures/en-us_image_0000001222967788.gif similarity index 100% rename from en/application-dev/ui/figures/9.gif rename to en/application-dev/ui/figures/en-us_image_0000001222967788.gif diff --git a/en/application-dev/ui/figures/page-layout.png b/en/application-dev/ui/figures/en-us_image_0000001222967792.png old mode 100755 new mode 100644 similarity index 100% rename from en/application-dev/ui/figures/page-layout.png rename to en/application-dev/ui/figures/en-us_image_0000001222967792.png diff --git a/en/application-dev/ui/figures/3-16.gif b/en/application-dev/ui/figures/en-us_image_0000001222967796.gif similarity index 100% rename from en/application-dev/ui/figures/3-16.gif rename to en/application-dev/ui/figures/en-us_image_0000001222967796.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001195117633.png b/en/application-dev/ui/figures/en-us_image_0000001222967800.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001195117633.png rename to en/application-dev/ui/figures/en-us_image_0000001222967800.png diff --git a/en/application-dev/ui/figures/zh-cn_image_0000001077953992.png b/en/application-dev/ui/figures/en-us_image_0000001223127696.png similarity index 100% rename from en/application-dev/ui/figures/zh-cn_image_0000001077953992.png rename to en/application-dev/ui/figures/en-us_image_0000001223127696.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001213462329.png b/en/application-dev/ui/figures/en-us_image_0000001223127700.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001213462329.png rename to en/application-dev/ui/figures/en-us_image_0000001223127700.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001168059158.png b/en/application-dev/ui/figures/en-us_image_0000001223127704.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168059158.png rename to en/application-dev/ui/figures/en-us_image_0000001223127704.png diff --git a/en/application-dev/ui/figures/19.gif b/en/application-dev/ui/figures/en-us_image_0000001223127708.gif similarity index 100% rename from en/application-dev/ui/figures/19.gif rename to en/application-dev/ui/figures/en-us_image_0000001223127708.gif diff --git a/en/application-dev/ui/figures/d4.gif b/en/application-dev/ui/figures/en-us_image_0000001223127712.gif similarity index 100% rename from en/application-dev/ui/figures/d4.gif rename to en/application-dev/ui/figures/en-us_image_0000001223127712.gif diff --git a/en/application-dev/ui/figures/00.png b/en/application-dev/ui/figures/en-us_image_0000001223127716.png similarity index 100% rename from en/application-dev/ui/figures/00.png rename to en/application-dev/ui/figures/en-us_image_0000001223127716.png diff --git a/en/application-dev/ui/figures/01-1.png b/en/application-dev/ui/figures/en-us_image_0000001223127720.png similarity index 100% rename from en/application-dev/ui/figures/01-1.png rename to en/application-dev/ui/figures/en-us_image_0000001223127720.png diff --git a/en/application-dev/ui/figures/static-animation.png b/en/application-dev/ui/figures/en-us_image_0000001223127724.png old mode 100755 new mode 100644 similarity index 100% rename from en/application-dev/ui/figures/static-animation.png rename to en/application-dev/ui/figures/en-us_image_0000001223127724.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001214210217.png b/en/application-dev/ui/figures/en-us_image_0000001223127732.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001214210217.png rename to en/application-dev/ui/figures/en-us_image_0000001223127732.png diff --git a/en/application-dev/ui/figures/10-10.png b/en/application-dev/ui/figures/en-us_image_0000001223127736.png similarity index 100% rename from en/application-dev/ui/figures/10-10.png rename to en/application-dev/ui/figures/en-us_image_0000001223127736.png diff --git a/en/application-dev/ui/figures/4444.gif b/en/application-dev/ui/figures/en-us_image_0000001223127740.gif similarity index 100% rename from en/application-dev/ui/figures/4444.gif rename to en/application-dev/ui/figures/en-us_image_0000001223127740.gif diff --git a/en/application-dev/ui/figures/listrouter.gif b/en/application-dev/ui/figures/en-us_image_0000001223127744.gif similarity index 100% rename from en/application-dev/ui/figures/listrouter.gif rename to en/application-dev/ui/figures/en-us_image_0000001223127744.gif diff --git a/en/application-dev/ui/figures/26.gif b/en/application-dev/ui/figures/en-us_image_0000001223127748.gif similarity index 100% rename from en/application-dev/ui/figures/26.gif rename to en/application-dev/ui/figures/en-us_image_0000001223127748.gif diff --git a/en/application-dev/ui/figures/111-17.gif b/en/application-dev/ui/figures/en-us_image_0000001223127752.gif similarity index 100% rename from en/application-dev/ui/figures/111-17.gif rename to en/application-dev/ui/figures/en-us_image_0000001223127752.gif diff --git a/en/application-dev/ui/figures/6.gif b/en/application-dev/ui/figures/en-us_image_0000001223127756.gif similarity index 100% rename from en/application-dev/ui/figures/6.gif rename to en/application-dev/ui/figures/en-us_image_0000001223127756.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001195119619.png b/en/application-dev/ui/figures/en-us_image_0000001223127760.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001195119619.png rename to en/application-dev/ui/figures/en-us_image_0000001223127760.png diff --git a/en/application-dev/ui/figures/34.gif b/en/application-dev/ui/figures/en-us_image_0000001223287652.gif similarity index 100% rename from en/application-dev/ui/figures/34.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287652.gif diff --git a/en/application-dev/ui/figures/2-7.gif b/en/application-dev/ui/figures/en-us_image_0000001223287656.gif similarity index 100% rename from en/application-dev/ui/figures/2-7.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287656.gif diff --git a/en/application-dev/ui/figures/02.png b/en/application-dev/ui/figures/en-us_image_0000001223287668.png similarity index 100% rename from en/application-dev/ui/figures/02.png rename to en/application-dev/ui/figures/en-us_image_0000001223287668.png diff --git a/en/application-dev/ui/figures/18.gif b/en/application-dev/ui/figures/en-us_image_0000001223287672.gif similarity index 100% rename from en/application-dev/ui/figures/18.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287672.gif diff --git a/en/application-dev/ui/figures/3-9.gif b/en/application-dev/ui/figures/en-us_image_0000001223287676.gif similarity index 100% rename from en/application-dev/ui/figures/3-9.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287676.gif diff --git a/en/application-dev/ui/figures/5.png b/en/application-dev/ui/figures/en-us_image_0000001223287680.png similarity index 100% rename from en/application-dev/ui/figures/5.png rename to en/application-dev/ui/figures/en-us_image_0000001223287680.png diff --git a/en/application-dev/ui/figures/24.gif b/en/application-dev/ui/figures/en-us_image_0000001223287684.gif similarity index 100% rename from en/application-dev/ui/figures/24.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287684.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001223287688.png b/en/application-dev/ui/figures/en-us_image_0000001223287688.png new file mode 100644 index 0000000000000000000000000000000000000000..cc39aec87bb14a36eb6214a2ef39d45c631d4a2b Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001223287688.png differ diff --git a/en/application-dev/ui/figures/continuous-animation-effect.gif b/en/application-dev/ui/figures/en-us_image_0000001223287696.gif old mode 100755 new mode 100644 similarity index 100% rename from en/application-dev/ui/figures/continuous-animation-effect.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287696.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001169599582.png b/en/application-dev/ui/figures/en-us_image_0000001223287704.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001169599582.png rename to en/application-dev/ui/figures/en-us_image_0000001223287704.png diff --git a/en/application-dev/ui/figures/video_2021-10-21_105602.gif b/en/application-dev/ui/figures/en-us_image_0000001223287708.gif similarity index 100% rename from en/application-dev/ui/figures/video_2021-10-21_105602.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287708.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001169532276.png b/en/application-dev/ui/figures/en-us_image_0000001223287712.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001169532276.png rename to en/application-dev/ui/figures/en-us_image_0000001223287712.png diff --git a/en/application-dev/ui/figures/20211008-184455(welinkpc).gif b/en/application-dev/ui/figures/en-us_image_0000001223287716.gif similarity index 100% rename from en/application-dev/ui/figures/20211008-184455(welinkpc).gif rename to en/application-dev/ui/figures/en-us_image_0000001223287716.gif diff --git a/en/application-dev/ui/figures/38.gif b/en/application-dev/ui/figures/en-us_image_0000001223287720.gif similarity index 100% rename from en/application-dev/ui/figures/38.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287720.gif diff --git a/en/application-dev/ui/figures/1-18.gif b/en/application-dev/ui/figures/en-us_image_0000001223287724.gif similarity index 100% rename from en/application-dev/ui/figures/1-18.gif rename to en/application-dev/ui/figures/en-us_image_0000001223287724.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001229510983.gif b/en/application-dev/ui/figures/en-us_image_0000001229510983.gif new file mode 100644 index 0000000000000000000000000000000000000000..56ad8e92f8376a00a0e5e201e7946144acb7659a Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001229510983.gif differ diff --git a/en/application-dev/ui/figures/en-us_image_0000001168956332.png b/en/application-dev/ui/figures/en-us_image_0000001267607861.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168956332.png rename to en/application-dev/ui/figures/en-us_image_0000001267607861.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001148858818.png b/en/application-dev/ui/figures/en-us_image_0000001267607865.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001148858818.png rename to en/application-dev/ui/figures/en-us_image_0000001267607865.png diff --git a/en/application-dev/ui/figures/37.gif b/en/application-dev/ui/figures/en-us_image_0000001267607869.gif similarity index 100% rename from en/application-dev/ui/figures/37.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607869.gif diff --git a/en/application-dev/ui/figures/q8.gif b/en/application-dev/ui/figures/en-us_image_0000001267607873.gif similarity index 100% rename from en/application-dev/ui/figures/q8.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607873.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001169678922.png b/en/application-dev/ui/figures/en-us_image_0000001267607877.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001169678922.png rename to en/application-dev/ui/figures/en-us_image_0000001267607877.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001267607881.png b/en/application-dev/ui/figures/en-us_image_0000001267607881.png new file mode 100644 index 0000000000000000000000000000000000000000..13b5b576503f783a01e729e9bb1f740e0c5b03ed Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001267607881.png differ diff --git a/en/application-dev/ui/figures/33.gif b/en/application-dev/ui/figures/en-us_image_0000001267607885.gif similarity index 100% rename from en/application-dev/ui/figures/33.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607885.gif diff --git a/en/application-dev/ui/figures/sample_css.png b/en/application-dev/ui/figures/en-us_image_0000001267607889.png similarity index 100% rename from en/application-dev/ui/figures/sample_css.png rename to en/application-dev/ui/figures/en-us_image_0000001267607889.png diff --git a/en/application-dev/ui/figures/pixel-unit.gif b/en/application-dev/ui/figures/en-us_image_0000001267607893.gif similarity index 100% rename from en/application-dev/ui/figures/pixel-unit.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607893.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001215079443.png b/en/application-dev/ui/figures/en-us_image_0000001267607901.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001215079443.png rename to en/application-dev/ui/figures/en-us_image_0000001267607901.png diff --git a/en/application-dev/ui/figures/17.gif b/en/application-dev/ui/figures/en-us_image_0000001267607905.gif similarity index 100% rename from en/application-dev/ui/figures/17.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607905.gif diff --git a/en/application-dev/ui/figures/routercategory.gif b/en/application-dev/ui/figures/en-us_image_0000001267607909.gif similarity index 100% rename from en/application-dev/ui/figures/routercategory.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607909.gif diff --git a/en/application-dev/ui/figures/7.gif b/en/application-dev/ui/figures/en-us_image_0000001267607913.gif similarity index 100% rename from en/application-dev/ui/figures/7.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607913.gif diff --git a/en/application-dev/ui/figures/1111.gif b/en/application-dev/ui/figures/en-us_image_0000001267607921.gif similarity index 100% rename from en/application-dev/ui/figures/1111.gif rename to en/application-dev/ui/figures/en-us_image_0000001267607921.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001158896538.png b/en/application-dev/ui/figures/en-us_image_0000001267647841.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001158896538.png rename to en/application-dev/ui/figures/en-us_image_0000001267647841.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001167746622.png b/en/application-dev/ui/figures/en-us_image_0000001267647849.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001167746622.png rename to en/application-dev/ui/figures/en-us_image_0000001267647849.png diff --git a/en/application-dev/ui/figures/36.gif b/en/application-dev/ui/figures/en-us_image_0000001267647853.gif similarity index 100% rename from en/application-dev/ui/figures/36.gif rename to en/application-dev/ui/figures/en-us_image_0000001267647853.gif diff --git a/en/application-dev/ui/figures/30.gif b/en/application-dev/ui/figures/en-us_image_0000001267647857.gif similarity index 100% rename from en/application-dev/ui/figures/30.gif rename to en/application-dev/ui/figures/en-us_image_0000001267647857.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001267647861.png b/en/application-dev/ui/figures/en-us_image_0000001267647861.png new file mode 100644 index 0000000000000000000000000000000000000000..cd29fb73e562d56acd907ffa221d347b14cb1812 Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001267647861.png differ diff --git a/en/application-dev/ui/figures/05.png b/en/application-dev/ui/figures/en-us_image_0000001267647865.png similarity index 100% rename from en/application-dev/ui/figures/05.png rename to en/application-dev/ui/figures/en-us_image_0000001267647865.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001267647869.png b/en/application-dev/ui/figures/en-us_image_0000001267647869.png new file mode 100644 index 0000000000000000000000000000000000000000..91179e770c418c02c3751111b14bbea637b48b1c Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001267647869.png differ diff --git a/en/application-dev/ui/figures/en-us_image_0000001168728872.png b/en/application-dev/ui/figures/en-us_image_0000001267647873.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168728872.png rename to en/application-dev/ui/figures/en-us_image_0000001267647873.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001204538065.png b/en/application-dev/ui/figures/en-us_image_0000001267647881.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001204538065.png rename to en/application-dev/ui/figures/en-us_image_0000001267647881.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001215113569.png b/en/application-dev/ui/figures/en-us_image_0000001267647885.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001215113569.png rename to en/application-dev/ui/figures/en-us_image_0000001267647885.png diff --git a/en/application-dev/ui/figures/d1.gif b/en/application-dev/ui/figures/en-us_image_0000001267647889.gif similarity index 100% rename from en/application-dev/ui/figures/d1.gif rename to en/application-dev/ui/figures/en-us_image_0000001267647889.gif diff --git a/en/application-dev/ui/figures/20211217-130837(welinkpc).gif b/en/application-dev/ui/figures/en-us_image_0000001267647893.gif similarity index 100% rename from en/application-dev/ui/figures/20211217-130837(welinkpc).gif rename to en/application-dev/ui/figures/en-us_image_0000001267647893.gif diff --git a/en/application-dev/ui/figures/1-15.gif b/en/application-dev/ui/figures/en-us_image_0000001267647897.gif similarity index 100% rename from en/application-dev/ui/figures/1-15.gif rename to en/application-dev/ui/figures/en-us_image_0000001267647897.gif diff --git a/en/application-dev/ui/figures/zan.gif b/en/application-dev/ui/figures/en-us_image_0000001267647901.gif old mode 100755 new mode 100644 similarity index 100% rename from en/application-dev/ui/figures/zan.gif rename to en/application-dev/ui/figures/en-us_image_0000001267647901.gif diff --git a/en/application-dev/ui/figures/10.gif b/en/application-dev/ui/figures/en-us_image_0000001267767837.gif similarity index 100% rename from en/application-dev/ui/figures/10.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767837.gif diff --git a/en/application-dev/ui/figures/11-8.gif b/en/application-dev/ui/figures/en-us_image_0000001267767841.gif similarity index 100% rename from en/application-dev/ui/figures/11-8.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767841.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001168728272.png b/en/application-dev/ui/figures/en-us_image_0000001267767845.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168728272.png rename to en/application-dev/ui/figures/en-us_image_0000001267767845.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001204537865.png b/en/application-dev/ui/figures/en-us_image_0000001267767849.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001204537865.png rename to en/application-dev/ui/figures/en-us_image_0000001267767849.png diff --git a/en/application-dev/ui/figures/q3.gif b/en/application-dev/ui/figures/en-us_image_0000001267767853.gif similarity index 100% rename from en/application-dev/ui/figures/q3.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767853.gif diff --git a/en/application-dev/ui/figures/31.gif b/en/application-dev/ui/figures/en-us_image_0000001267767857.gif similarity index 100% rename from en/application-dev/ui/figures/31.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767857.gif diff --git a/en/application-dev/ui/figures/27.gif b/en/application-dev/ui/figures/en-us_image_0000001267767861.gif similarity index 100% rename from en/application-dev/ui/figures/27.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767861.gif diff --git a/en/application-dev/ui/figures/8.png b/en/application-dev/ui/figures/en-us_image_0000001267767865.png similarity index 100% rename from en/application-dev/ui/figures/8.png rename to en/application-dev/ui/figures/en-us_image_0000001267767865.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001169759552.png b/en/application-dev/ui/figures/en-us_image_0000001267767869.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001169759552.png rename to en/application-dev/ui/figures/en-us_image_0000001267767869.png diff --git a/en/application-dev/ui/figures/34-12.gif b/en/application-dev/ui/figures/en-us_image_0000001267767873.gif similarity index 100% rename from en/application-dev/ui/figures/34-12.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767873.gif diff --git a/en/application-dev/ui/figures/3333.gif b/en/application-dev/ui/figures/en-us_image_0000001267767877.gif similarity index 100% rename from en/application-dev/ui/figures/3333.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767877.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001214998349.png b/en/application-dev/ui/figures/en-us_image_0000001267767881.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001214998349.png rename to en/application-dev/ui/figures/en-us_image_0000001267767881.png diff --git a/en/application-dev/ui/figures/8-6.gif b/en/application-dev/ui/figures/en-us_image_0000001267767885.gif similarity index 100% rename from en/application-dev/ui/figures/8-6.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767885.gif diff --git a/en/application-dev/ui/figures/figures3.png b/en/application-dev/ui/figures/en-us_image_0000001267767889.png similarity index 100% rename from en/application-dev/ui/figures/figures3.png rename to en/application-dev/ui/figures/en-us_image_0000001267767889.png diff --git a/en/application-dev/ui/figures/5-5.gif b/en/application-dev/ui/figures/en-us_image_0000001267767893.gif similarity index 100% rename from en/application-dev/ui/figures/5-5.gif rename to en/application-dev/ui/figures/en-us_image_0000001267767893.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001215433095.png b/en/application-dev/ui/figures/en-us_image_0000001267767897.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001215433095.png rename to en/application-dev/ui/figures/en-us_image_0000001267767897.png diff --git a/en/application-dev/ui/figures/28.gif b/en/application-dev/ui/figures/en-us_image_0000001267887817.gif similarity index 100% rename from en/application-dev/ui/figures/28.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887817.gif diff --git a/en/application-dev/ui/figures/3-2.png b/en/application-dev/ui/figures/en-us_image_0000001267887821.png similarity index 100% rename from en/application-dev/ui/figures/3-2.png rename to en/application-dev/ui/figures/en-us_image_0000001267887821.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001168888224.png b/en/application-dev/ui/figures/en-us_image_0000001267887829.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168888224.png rename to en/application-dev/ui/figures/en-us_image_0000001267887829.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001204776353.png b/en/application-dev/ui/figures/en-us_image_0000001267887833.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001204776353.png rename to en/application-dev/ui/figures/en-us_image_0000001267887833.png diff --git a/en/application-dev/ui/figures/d3.gif b/en/application-dev/ui/figures/en-us_image_0000001267887837.gif similarity index 100% rename from en/application-dev/ui/figures/d3.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887837.gif diff --git a/en/application-dev/ui/figures/111-13.png b/en/application-dev/ui/figures/en-us_image_0000001267887841.png similarity index 100% rename from en/application-dev/ui/figures/111-13.png rename to en/application-dev/ui/figures/en-us_image_0000001267887841.png diff --git a/en/application-dev/ui/figures/8-4.gif b/en/application-dev/ui/figures/en-us_image_0000001267887845.gif similarity index 100% rename from en/application-dev/ui/figures/8-4.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887845.gif diff --git a/en/application-dev/ui/figures/1.gif b/en/application-dev/ui/figures/en-us_image_0000001267887849.gif similarity index 100% rename from en/application-dev/ui/figures/1.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887849.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001168570318.png b/en/application-dev/ui/figures/en-us_image_0000001267887853.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168570318.png rename to en/application-dev/ui/figures/en-us_image_0000001267887853.png diff --git a/en/application-dev/ui/figures/en-us_image_0000001168410342.png b/en/application-dev/ui/figures/en-us_image_0000001267887861.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001168410342.png rename to en/application-dev/ui/figures/en-us_image_0000001267887861.png diff --git a/en/application-dev/ui/figures/111.gif b/en/application-dev/ui/figures/en-us_image_0000001267887865.gif similarity index 100% rename from en/application-dev/ui/figures/111.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887865.gif diff --git a/en/application-dev/ui/figures/video_2021-10-21_105956.gif b/en/application-dev/ui/figures/en-us_image_0000001267887869.gif similarity index 100% rename from en/application-dev/ui/figures/video_2021-10-21_105956.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887869.gif diff --git a/en/application-dev/ui/figures/11.png b/en/application-dev/ui/figures/en-us_image_0000001267887873.png similarity index 100% rename from en/application-dev/ui/figures/11.png rename to en/application-dev/ui/figures/en-us_image_0000001267887873.png diff --git a/en/application-dev/ui/figures/qqqq.gif b/en/application-dev/ui/figures/en-us_image_0000001267887877.gif similarity index 100% rename from en/application-dev/ui/figures/qqqq.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887877.gif diff --git a/en/application-dev/ui/figures/en-us_image_0000001147417424.png b/en/application-dev/ui/figures/en-us_image_0000001267887881.png similarity index 100% rename from en/application-dev/ui/figures/en-us_image_0000001147417424.png rename to en/application-dev/ui/figures/en-us_image_0000001267887881.png diff --git a/en/application-dev/ui/figures/22.gif b/en/application-dev/ui/figures/en-us_image_0000001267887885.gif similarity index 100% rename from en/application-dev/ui/figures/22.gif rename to en/application-dev/ui/figures/en-us_image_0000001267887885.gif diff --git a/en/application-dev/ui/figures/loadingProgress.png b/en/application-dev/ui/figures/loadingProgress.png deleted file mode 100644 index afc52b1a469c858e3029282e193b684114803db0..0000000000000000000000000000000000000000 Binary files a/en/application-dev/ui/figures/loadingProgress.png and /dev/null differ diff --git a/en/application-dev/ui/js-framework-file.md b/en/application-dev/ui/js-framework-file.md index ceb42a24155318b0e174144f1e44c1c823f2f6b1..caf71cb477dc28feaa479be5b2cf0e1e1ec345a5 100644 --- a/en/application-dev/ui/js-framework-file.md +++ b/en/application-dev/ui/js-framework-file.md @@ -1,107 +1,68 @@ -# File Organization +# File Organization -## Directory Structure +## Directory Structure -The following figure shows the typical directory structure of the JavaScript module \(**entry/src/main/js/module**\) for an application with feature abilities \(FA\) using JavaScript APIs. - -**Figure 1** Directory structure +The following figure shows the typical directory structure of the JavaScript module \(entry/src/main/js/module\) for an application with feature abilities \(FA\) using JavaScript APIs. +**Figure1** Directory structure ![](figures/unnaming-(1).png) -**Figure 2** Directory structure for resource sharing 5+ +**Figure2** Directory structure for resource sharing 5+ + ![](figures/directory-structure-for-resource-sharing-5+.png "directory-structure-for-resource-sharing-5+") Functions of the files are as follows: -- **.hml** files describe the page layout. -- **.css** files describe the page style. -- **.js** files process the interactions between pages and users. +- .hml files describe the page layout. +- .css files describe the page style. +- .js files process the interactions between pages and users. Functions of the folders are as follows: -- The **app.js** file manages global JavaScript logics and application lifecycle. For details, see [app.js](js-framework-js-file.md). -- The **pages** directory stores all component pages. -- The **common** directory stores public resource files, such as media resources, custom components, and **.js** files. -- The **resources** directory stores resource configuration files, for example, for multi-resolution loading. For details, see [Resource Limitations and Access](js-framework-resource-restriction.md). -- The **share** directory5+ is used to configure resources shared by multiple instances. For example, images and JSON files in this directory can be shared by **default1** and **default2** instances. +- The app.js file manages global JavaScript logics and application lifecycle. For details, see [app.js](js-framework-js-file.md). +- The pages directory stores all component pages. +- The common directory stores public resource files, such as media resources, custom components, and .js files. +- The resources directory stores resource configuration files, for example, for multi-resolution loading. For details, see [Resource Limitations and Access](js-framework-resource-restriction.md). +- The share directory5+ is used to configure resources shared by multiple instances. For example, images and JSON files in this directory can be shared by default1 and default2 instances. ->![](../public_sys-resources/icon-note.gif) **NOTE:** ->- Reserved folders \(**i18n** and **resources**\) cannot be renamed. ->- If the same resource name and directory are used under the **share** directory and the instance \(**default**\) directory, the resource in the instance directory will be used when you reference the directory. ->- The **share** directory does not support **i18n**. +>![](public_sys-resources/icon-note.gif) **NOTE**: +>- Reserved folders \(i18n and resources\) cannot be renamed. +>- If the same resource name and directory are used under the share directory and the instance \(default\) directory, the resource in the instance directory will be used when you reference the directory. +>- The share directory does not support i18n. >- You should create the optional folders \(shown in the directory structure\) as needed after you create the project in DevEco Studio. -## File Access Rules +## File Access Rules -Application resources can be accessed via an absolute or relative path. In the JS UI framework, an absolute path starts with a slash \(/\), and a relative path starts with **./** or **../**. The rules are as follows: +Application resources can be accessed via an absolute or relative path. In the JS UI framework, an absolute path starts with a slash \(/\), and a relative path starts with ./ or ../. The rules are as follows: -- To reference a code file, use a relative path, for example, **../common/utils.js**. -- To reference a resource file, use an absolute path, for example, **/common/xxx.png**. -- Store code files and resource files in the **common** directory and access the files in a required fashion. -- In a **.css** file, use the **url\(\)** function to create a URL, for example, **url\(/common/xxx.png\)**. +- To reference a code file, use a relative path, for example, ../common/utils.js. +- To reference a resource file, use an absolute path, for example, /common/xxx.png. +- Store code files and resource files in the common directory and access the files in a required fashion. +- In a .css file, use the url\(\) function to create a URL, for example, url\(/common/xxx.png\). ->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](public_sys-resources/icon-note.gif) **NOTE**: >When code file A needs to reference code file B: +> >- If code files A and B are in the same directory, you can use either a relative or absolute path in code file B to reference resource files. >- If code files A and B are in different directories, you must use an absolute path in code file B to reference resource files because the directory of code file B changes during Webpack packaging. ->- Use an absolute path if you want to dynamically change the resource file path through data binding in a **.js** file. - -## Media File Formats - -**Table 1** Supported image formats - - - - - - - - - - - - - - - - - - - - - - -

Image Format

-

File Format

-

BMP

-

.bmp

-

GIF

-

.gif

-

JPEG

-

.jpg

-

PNG

-

.png

-

WebP

-

.webp

-
- -**Table 2** Supported video formats - - - - - - - - - - -

Video Formats

-

File Formats

-

H.264 AVC

-

Baseline Profile (BP)

-

.3gp

-

.mp4

-
+>- Use an absolute path if you want to dynamically change the resource file path through data binding in a .js file. + +## Media File Formats + +Table1 Supported image formats + +| Image Format | File Format | +| ------------ | ----------- | +| BMP | .bmp | +| GIF | .gif | +| JPEG | .jpg | +| PNG | .png | +| WebP | .webp | + +Table2 Supported video formats + +| Video Formats | File Format | +| ------------------------------- | ----------- | +| H.264 AVC Baseline Profile (BP) | .3gp .mp4 | diff --git a/en/application-dev/ui/js-framework-js-file.md b/en/application-dev/ui/js-framework-js-file.md index 9cdbf0654d84ab45ee6e1a5092e3cd9ab21b5ed5..f8fdc74c167642da160ad0f2fc0e0b09678b1266 100644 --- a/en/application-dev/ui/js-framework-js-file.md +++ b/en/application-dev/ui/js-framework-js-file.md @@ -1,8 +1,9 @@ -# app.js +# app.js -## Application Lifecycle -You can customize the [lifecycle](js-framework-lifecycle.md) implementation logic on an application-by-application basis in **app.js**. The following example only prints the corresponding logs in the **lifecycle** function: +## Application Lifecycle + + You can customize the [lifecycle](js-framework-lifecycle.md) implementation logic on an application-by-application basis in app.js. The following example only prints the corresponding logs in the lifecycle function: ``` // app.js @@ -17,29 +18,15 @@ export default { } ``` -## Application Object6+ - - - - - - - - - - - - -

Attribute

-

Data Type

-

Description

-

getApp

-

Function

-

Obtains the object exposed in the app.js file from the custom .js file.

-
+## Application Object6+ + + | Attribute | Data Type | Description | +| -------- | -------- | -------- | +| getApp | Function | Obtains the object exposed in the app.js file from the custom .js file. | The following is a sample code snippet: + ``` // app.js export default { @@ -47,16 +34,16 @@ export default { test: "by getAPP" }, onCreate() { - console.info('Application onCreate'); + console.info('AceApplication onCreate'); }, onDestroy() { - console.info('Application onDestroy'); + console.info('AceApplication onDestroy'); }, }; ``` + ``` // test.js Customize the logic code. export var appData = getApp().data; ``` - diff --git a/en/application-dev/ui/js-framework-js-tag.md b/en/application-dev/ui/js-framework-js-tag.md index 16d00b860cd0f3dedebd5745d70ffa03ca473f28..ad407559177d7a7c0cd39615341ef36a8560bd37 100644 --- a/en/application-dev/ui/js-framework-js-tag.md +++ b/en/application-dev/ui/js-framework-js-tag.md @@ -1,62 +1,24 @@ -# "js" Tag +# "js" Tag + The "js" tag contains the instance name, window style, and page route information. - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Tag

-

Data Type

-

Default Value

-

Mandatory

-

Description

-

name

-

string

-

default

-

Yes

-

Name of the JavaScript instance.

-

pages

-

Array

-

-

-

Yes

-

Route information. For details, see "pages".

-

window

-

Object

-

-

-

No

-

Window information. For details, see "window".

-
- ->![](../public_sys-resources/icon-note.gif) **NOTE:** ->The **"name"**, "window", and **"pages"** tags are configured in the **"js"** tag of the config.json file. - -## "pages" - -The **"pages"** defines the route information of each page. Each page consists of the page path and page name. The following is an example: + + | Tag | Data Type | Default Value | Mandatory | Description | +| -------- | -------- | -------- | -------- | -------- | +| name | string | default | Yes | Name of the JavaScript instance. | +| pages | Array | - | Yes | Route information. For details, see ["pages"](#pages). | +| window | Object | - | No | Window information. For details, see ["window"](#window). | + + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**: +> The "name", "window", and "pages" tags are configured in the "js" tag of the config.json file. + + +## "pages" + +The "pages" defines the route information of each page. Each page consists of the page path and page name. The following is an example: + ``` { @@ -69,59 +31,31 @@ The **"pages"** defines the route information of each page. Each page consists } ``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** ->- The first page in the **pages** list is the home page, also referred to as the entry, of the application. ->- The page name should not be a component name, for example, **text.hml** or **button.hml**. - -## window - -The **"window"** defines window-related configurations. To solve the screen adaptation problem, you can use either of the following methods: - -- Specify **designWidth**, which is the logical screen width. All size styles, such as **width** and **font-size**, are scaled at the ratio of **designWidth** to the physical screen width. For example, when **designWidth** is 720 px and if you set **width** to 100 px, the actual display width is scaled to 200 physical px on the screen whose physical width is 1440 px. -- Set **autoDesignWidth** to **true**, the **designWidth** field will be ignored, and the component and layout will be scaled automatically based on the screen density. The logical screen width is automatically calculated based on the physical screen width and screen density. The logical screen width may vary depending on the device. Use the relative layout to adapt to different devices. For example, on a device with a resolution of 466x466 and 320 DPI \(a screen density of 2x, with 160 DPI as the base\), 1 px is equivalent to 2 physical px. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >1. The default **** value in the current style is calculated based on the screen density. For example, if the screen density is x2 \(with 160 DPI as the baseline\) and the default **** value is 1 px, the actual length rendered on the device is 2 physical px. - >2. Values of **autoDesignWidth** and **designWidth** do not affect how the default **** value is calculated and the final effect. - - - - - - - - - - - - - - - - - - - - - - - -

Attribute

-

Type

-

Mandatory

-

Default Value

-

Description

-

designWidth

-

number

-

No

-

720

-

Logical screen width, which is a reference value for page design. The actual display width is scaled at the ratio of the value to the device width.

-

autoDesignWidth

-

boolean

-

No

-

false

-

Whether to automatically calculate the baseline width. If autoDesignWidth is set to true, designWidth is ignored. The baseline width is calculated based on the physical screen width and screen density.

-
+ +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**: +> +> - The first page in the pages list is the home page, also referred to as the entry, of the application. +> +> +> - The page name should not be a component name, for example, text.hml or button.hml. + +## window + +The "window" defines window-related configurations. To solve the screen adaptation problem, you can use either of the following methods: + +- Specify designWidth, which is the logical screen width. All size styles, such as width and font-size, are scaled at the ratio of designWidth to the physical screen width. For example, when designWidth is 720 px and if you set width to 100 px, the actual display width is scaled to 200 physical px on the screen whose physical width is 1440 px. + +- Set autoDesignWidth to true, the designWidth field will be ignored, and the component and layout will be scaled automatically based on the screen density. The logical screen width is automatically calculated based on the physical screen width and screen density. The logical screen width may vary depending on the device. Use the relative layout to adapt to different devices. For example, on a device with a resolution of 466x466 and 320 DPI (a screen density of 2x, with 160 DPI as the base), 1 px is equivalent to 2 physical px. + + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**: + > 1. The default <length> value in the current style is calculated based on the screen density. For example, if the screen density is x2 (with 160 DPI as the baseline) and the default <length> value is 1 px, the actual length rendered on the device is 2 physical px. + > + > 2. Values of autoDesignWidth and designWidth do not affect how the default <length> value is calculated and the final effect. +| Attribute | Type | Mandatory | Default Value | Description | +| -------- | -------- | -------- | -------- | -------- | +| | | | | | +| designWidth | number | No | 720
| Logical screen width, which is a reference value for page design. The actual display width is scaled at the ratio of the value to the device width. | +| autoDesignWidth | boolean | No | false | Whether to automatically calculate the baseline width. If autoDesignWidth is set to true, designWidth is ignored. The baseline width is calculated based on the physical screen width and screen density. | The following is a sample code snippet: @@ -136,7 +70,9 @@ The following is a sample code snippet: } ``` -## Example + +## Example + ``` { @@ -156,11 +92,7 @@ The following is a sample code snippet: "pages": [ "pages/index/index", "pages/detail/detail" - ], - "window": { - "designWidth": 720, - "autoDesignWidth": false - } + ], "window": { "designWidth": 720, "autoDesignWidth": false } } ], "abilities": [ @@ -171,4 +103,3 @@ The following is a sample code snippet: } } ``` - diff --git a/en/application-dev/ui/js-framework-lifecycle.md b/en/application-dev/ui/js-framework-lifecycle.md index 6bed2ea13a016eb77b2ab202b82cc2c58564da0f..292415ca893d6a6b90164efea54994a459a7f042 100644 --- a/en/application-dev/ui/js-framework-lifecycle.md +++ b/en/application-dev/ui/js-framework-lifecycle.md @@ -1,167 +1,45 @@ -# Lifecycle +# Lifecycle -## Application Lifecycle -You can define the following application lifecycle functions in the **app.js** file. +## Application Lifecycle - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Attribute

-

Type

-

Description

-

Called When

-

onCreate

-

() => void

-

Listens for application creation.

-

The application is created.

-

onShow6+

-

() => void

-

Listens for whether the application is running in the foreground.

-

The application is running in the foreground.

-

onHide6+

-

() => void

-

Listens for whether the application is running in the background.

-

The application is running in the background.

-

onDestroy

-

() => void

-

Listens for application uninstallation.

-

The application exits.

-
+You can define the following application lifecycle functions in the app.js file. -## Page Lifecycle + | Attribute | Type | Description | Called When | +| -------- | -------- | -------- | -------- | +| onCreate | () => void | Listens for application creation. | The application is created. | +| onShow6+ | () => void | Listens for whether the application is running in the foreground. | The application is running in the foreground. | +| onHide6+ | () => void | Listens for whether the application is running in the background. | The application is running in the background. | +| onDestroy | () => void | Listens for application uninstallation. | The application exits. | -You can define the following page lifecycle functions in the **.js** file of the page. +## Page Lifecycle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Attribute

-

Type

-

Description

-

Called When

-

onInit

-

() => void

-

Listens for page initialization.

-

Page initialization is complete. This function is called only once in the page lifecycle.

-

onReady

-

() => void

-

Listens for page creation.

-

A page is created. This function is called only once in the page lifecycle.

-

onShow

-

() => void

-

Listens for page display.

-

The page is displayed.

-

onHide

-

() => void

-

Listens for page disappearance.

-

The page disappears.

-

onDestroy

-

() => void

-

Listens for page destruction.

-

The page is destroyed.

-

onBackPress

-

() => boolean

-

Listens for the back button action.

-

The back button is touched.

-
  • true means that the page processes the return logic.
  • false means that the default return logic is used.
  • If no value is returned, the default return logic is used.
-

onActive()5+

-

() => void

-

Listens for page activation.

-

The page is activated.

-

onInactive()5+

-

() => void

-

Listens for page suspension.

-

The page is suspended.

-

onNewRequest()5+

-

() => void

-

Listens for a new FA request.

-

The FA has been started and a new request is received.

-
+You can define the following page lifecycle functions in the .js file of the page. -The lifecycle functions of page A are called in the following sequence: +| Attribute | Type | Description | Called When | +| -------- | -------- | -------- | -------- | +| onInit | () => void | Listens for page initialization. | Page initialization is complete. This function is called only once in the page lifecycle. | +| onReady | () => void | Listens for page creation. | A page is created. This function is called only once in the page lifecycle. | +| onShow | () => void | Listens for page display. | The page is displayed. | +| onHide | () => void | Listens for page disappearance. | The page disappears. | +| onDestroy | () => void | Listens for page destruction. | The page is destroyed. | +| onBackPress | () => boolean | Listens for the back button action. | The back button is touched.
- true means that the page processes the return logic.
- false means that the default return logic is used.
- If no value is returned, the default return logic is used. | +| onActive()5+ | () => void | Listens for page activation. | The page is activated. | +| onInactive()5+ | () => void | Listens for page suspension. | The page is suspended. | +| onNewRequest()5+ | () => void | Listens for a new FA request. | The FA has been started and a new request is received. | -- Open page A: onInit\(\) -\> onReady\(\) -\> onShow\(\) -- Open page B on page A: onHide\(\) -- Go back to page A from page B: onShow\(\) -- Exit page A: onBackPress\(\) -\> onHide\(\) -\> onDestroy\(\) -- Hide page A: onInactive\(\) -\> onHide\(\) -- Show background page A on the foreground: onShow\(\) -\> onActive\(\) + The lifecycle functions of page A are called in the following sequence: +- Open page A: onInit() -> onReady() -> onShow() -![](figures/en-us_image_0000001147417424.png) +- Open page B on page A: onHide() + +- Go back to page A from page B: onShow() + +- Exit page A: onBackPress() -> onHide() -> onDestroy() + +- Hide page A: onInactive() -> onHide() + +- Show background page A on the foreground: onShow() -> onActive() + +![en-us_image_0000001267887881](figures/en-us_image_0000001267887881.png) diff --git a/en/application-dev/ui/js-framework-multiple-languages.md b/en/application-dev/ui/js-framework-multiple-languages.md index 8e3a2015c59b0be47cbfdafdc92519dfae4f6e59..0405f3f9a0a22cfb83c713356af6f11e4cd33580 100644 --- a/en/application-dev/ui/js-framework-multiple-languages.md +++ b/en/application-dev/ui/js-framework-multiple-languages.md @@ -1,14 +1,18 @@ -# Multi-Language Capability +# Multi-Language Capability + Applications designed based on the JS UI framework apply to different countries and regions. With the multi-language capability, you do not need to develop application versions in different languages, and your users can switch between various locales. This also facilitates project maintenance. -You only need to perform operations in [Resource Files](#section733935013515) and [Resource Reference](#section522111116527) to use the multi-language capability of this framework. For details about how to obtain the current system language, see [Language Acquisition](#section2872192475310). -## Resource Files +You only need to perform operations in [Resource Files](#resource-files) and [Resource Reference](#resource-reference) to use the multi-language capability of this framework. For details about how to obtain the current system language, see [Language Acquisition](#language-acquisition). + + +## Resource Files + +Resource files store application content in multiple languages. This framework uses JSON files to store resource definitions. Place the resource file of each locale in the i18n directory described in [File Organization](js-framework-file.md). -Resource files store application content in multiple languages. This framework uses JSON files to store resource definitions. Place the resource file of each locale in the **i18n** directory described in [File Organization](js-framework-file.md). +Resource files should be named in _language-script-region_.json format. For example, the resource file for Hong Kong Chinese in the traditional script is named zh-Hant-HK. You can omit the region, for example, zh-CN for simplified Chinese, or omit both the script and region, for example, zh for Chinese. -Resource files should be named in _language-script-region_**.json** format. For example, the resource file for Hong Kong Chinese in the traditional script is named **zh-Hant-HK**. You can omit the region, for example, **zh-CN** for simplified Chinese, or omit both the script and region, for example, **zh** for Chinese. ``` language[-script-region].json @@ -16,41 +20,19 @@ language[-script-region].json The following table describes the requirements for the qualifiers of resource file names. -**Table 1** Requirements for qualifier values - - - - - - - - - - - - - - - - -

Qualifier Type

-

Description and Value Range

-

Language

-

Indicates the language used by the device. The value consists of two or three lowercase letters, for example, zh indicates Chinese, en indicates English, and mai indicates Maithili.

-

For details about the value range, refer to ISO 639 (codes for the representation of names of languages).

-

Script

-

Indicates the script type used by the device. The value starts with one uppercase letter followed by three lowercase letters, for example, Hans indicates simplified Chinese and Hant indicates traditional Chinese.

-

For details about the value range, refer to ISO 15924 (codes for the representation of names of scripts).

-

Country/Region

-

Indicates the country or region where a user is located. The value consists of two or three uppercase letters or three digits, for example, CN indicates China and GB indicates the United Kingdom.

-

For details about the value range, refer to ISO 3166-1 (codes for the representation of names of countries and their subdivisions).

-
- -If there is no resource file of the locale that matches the system language, content in the **en-US.json** file will be used by default. + Table1 Requirements for qualifier values + +| Qualifier Type | Description and Value Range | +| -------- | -------- | +| Language | Indicates the language used by the device. The value consists of two or three lowercase letters, for example, zh indicates Chinese, en indicates English, and mai indicates Maithili.
For details about the value range, refer to ISO 639 (codes for the representation of names of languages). | +| Script | Indicates the script type used by the device. The value starts with one uppercase letter followed by three lowercase letters, for example, Hans indicates simplified Chinese and Hant indicates traditional Chinese.
For details about the value range, refer to ISO 15924 (codes for the representation of names of scripts). | +| Country/Region | Indicates the country or region where a user is located. The value consists of two or three uppercase letters or three digits, for example, CN indicates China and GB indicates the United Kingdom.
For details about the value range, refer to ISO 3166-1 (codes for the representation of names of countries and their subdivisions). | + +If there is no resource file of the locale that matches the system language, content in the en-US.json file will be used by default. The format of the resource file content is as follows: -en-US.json + en-US.json ``` { @@ -67,12 +49,16 @@ en-US.json } ``` -Different languages have different matching rules for singular and plural forms. In the resource file, **zero**, **one**, **two**, **few**, **many**, and **other** are used to define the string content in different singular and plural forms. For example, there is only the **other** scenario in Chinese since the language does not have singular and plural forms. **one** and **other** scenarios are applicable to English. All six scenarios are needed for Arabic. -The following example takes **en-US.json** and **ar-AE.json** as examples: +Different languages have different matching rules for singular and plural forms. In the resource file, zero, one, two, few, many, and other are used to define the string content in different singular and plural forms. For example, there is only the other scenario in Chinese since the language does not have singular and plural forms. one and other scenarios are applicable to English. All six scenarios are needed for Arabic. + + +The following example takes en-US.json and ar-AE.json as examples: + en-US.json + ``` { "strings": { @@ -84,8 +70,10 @@ en-US.json } ``` + ar-AE.json + ``` { "strings": { @@ -101,211 +89,107 @@ ar-AE.json } ``` -## Resource Reference - -Multi-language syntax used on application development pages \(including simple formatting and singular-plural formatting\) can be used in **.hml** or **.js** files. - -- Simple formatting - - Use the **$t** function to reference to resources of different locales. The **$t** function is available for both **.hml** and **.js** files. The system displays content based on a resource file path specified via **$t** and the specified resource file whose locale matches the current system language. - - **Table 2** Simple formatting - - - - - - - - - - - - - - - - -

Attribute

-

Type

-

Parameter

-

Mandatory

-

Description

-

$t

-

Function

-

See Table 3.

-

Yes

-

Sets the parameters based on the system language, for example, this.$t('strings.hello').

-
- - **Table 3** $t function parameters - - - - - - - - - - - - - - - - - - - -

Parameter

-

Type

-

Mandatory

-

Description

-

path

-

string

-

Yes

-

Path of the language resource key

-

params

-

Array|Object

-

No

-

Content used to replace placeholders during runtime. There are two types of placeholders available:

-
  • Named placeholder, for example, {name}. The actual content must be of the object type, for example, $t('strings.object', { name: 'Hello world' }).
  • Digit placeholder, for example, {0}. The actual content must be of the array type, for example, $t('strings.array', ['Hello world'].
-
- -- Example code for simple formatting - - ``` - -
- - {{ $t('strings.hello') }} - - {{ $t('strings.object', { name: 'Hello world' }) }} - - {{ $t('strings.array', ['Hello world']) }} - - {{ hello }} - - {{ replaceObject }} - - {{ replaceArray }} - - - - - -
- ``` - - ``` - // xxx.js - // The following example uses the $t function in the .js file. - export default { - data: { - hello: '', - replaceObject: '', - replaceArray: '', - replaceSrc: '', - }, - onInit() { - this.hello = this.$t('strings.hello'); - this.replaceObject = this.$t('strings.object', { name: 'Hello world' }); - this.replaceArray = this.$t('strings.array', ['Hello world']); - this.replaceSrc = this.$t('files.image'); - }, - } - ``` - -- Singular-plural formatting - - **Table 4** Singular-plural formatting - - - - - - - - - - - - - - - - -

Attribute

-

Type

-

Parameter

-

Mandatory

-

Description

-

$tc

-

Function

-

See Table 5.

-

Yes

-

Converts between the singular and plural forms based on the system language, for example, this.$tc('strings.people').

-
NOTE:

The resource content is distinguished by the following JSON keys: zero, one, two, few, many, and other.

-
-
- - **Table 5** $tc function parameters - - - - - - - - - - - - - - - - - - - -

Parameter

-

Type

-

Mandatory

-

Description

-

path

-

string

-

Yes

-

Path of the language resource key

-

count

-

number

-

Yes

-

Number

-
- -- Sample code for singular-plural formatting - - ``` - -
- - {{ $tc('strings.people', 0) }} - - {{ $tc('strings.people', 1) }} - - {{ $tc('strings.people', 2) }} - - {{ $tc('strings.people', 6) }} - - {{ $tc('strings.people', 50) }} - - {{ $tc('strings.people', 100) }} -
- ``` - - -## Language Acquisition - -For details about how to obtain the language, see the [Application Configuration](../reference/apis/js-apis-basic-features-configuration.md) section. +## Resource Reference + +Multi-language syntax used on application development pages (including simple formatting and singular-plural formatting) can be used in .hml or .js files. + +- Simple formatting + Use the $t function to reference to resources of different locales. The $t function is available for both .hml and .js files. The system displays content based on a resource file path specified via $t and the specified resource file whose locale matches the current system language. + + Table2 Simple formatting + + | Attribute | Type | Parameter | Mandatory | Description | + | -------- | -------- | -------- | -------- | -------- | + | $t | Function | See Table3 | Yes | Sets the parameters based on the system language, for example, this.$t('strings.hello'). | + + Table3 $t function parameters + + | Parameter | Type | Mandatory | Description | + | -------- | -------- | -------- | -------- | + | path | string | Yes | Path of the language resource key | + | params | Array\|Object | No | Content used to replace placeholders during runtime. There are two types of placeholders available:
- Named placeholder, for example, {name}. The actual content must be of the object type, for example, $t('strings.object', { name: 'Hello world' }).
- Digit placeholder, for example, {0}. The actual content must be of the array type, for example, $t('strings.array', ['Hello world']. | + +- Example code for simple formatting + + ``` + +
+ + {{ $t('strings.hello') }} + + {{ $t('strings.object', { name: 'Hello world' }) }} + + {{ $t('strings.array', ['Hello world']) }} + + {{ hello }} + + {{ replaceObject }} + + {{ replaceArray }} + + + + + +
+ ``` + + + ``` + // xxx.js + // The following example uses the $t function in the .js file. + export default { + data: { + hello: '', + replaceObject: '', + replaceArray: '', + replaceSrc: '', + }, + onInit() { + this.hello = this.$t('strings.hello'); + this.replaceObject = this.$t('strings.object', { name: 'Hello world' }); + this.replaceArray = this.$t('strings.array', ['Hello world']); + this.replaceSrc = this.$t('files.image'); + }, + } + ``` + +- Singular-plural formatting + Table4 Singular-plural formatting + + | Attribute | Type | Parameter | Mandatory | Description | + | -------- | -------- | -------- | -------- | -------- | + | $tc | Function | See Table 5. | Yes | Converts between the singular and plural forms based on the system language, for example, this.$tc('strings.people').
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**:
> The resource content is distinguished by the following JSON keys: zero, one, two, few, many, and other. | + + Table5 $tc function parameters + + | Parameter | Type | Mandatory | Description | + | -------- | -------- | -------- | -------- | + | path | string | Yes | Path of the language resource key | + | count | number | Yes | Number | + +- Sample code for singular-plural formatting + + ``` + +
+ + {{ $tc('strings.people', 0) }} + + {{ $tc('strings.people', 1) }} + + {{ $tc('strings.people', 2) }} + + {{ $tc('strings.people', 6) }} + + {{ $tc('strings.people', 50) }} + + {{ $tc('strings.people', 100) }} +
+ ``` + + +## Language Acquisition + +For details about how to obtain the language, see the Application Configuration section. diff --git a/en/application-dev/ui/js-framework-resource-restriction.md b/en/application-dev/ui/js-framework-resource-restriction.md index 0a9abe9525e8d0c3d964df54d56c93bff302b486..8636ebfd2197cb2b1a875d522b6d7469816b01c3 100644 --- a/en/application-dev/ui/js-framework-resource-restriction.md +++ b/en/application-dev/ui/js-framework-resource-restriction.md @@ -1,76 +1,63 @@ -# Resource Limitations and Access - -## Resource Qualifiers - -The name of a resource qualifier consists of one or more qualifiers that represent the application scenarios or device characteristics, covering the screen density, and more. The qualifiers are separated using hyphens \(-\). When creating a qualifiers file under **resources**, you need to understand the file naming conventions and the rules for matching qualifiers files and the device status. - -## Naming Conventions for Resource Qualifiers - -- Qualifiers are ordered in the following sequence: screen density. You can select one or multiple qualifiers to name your file based on your application scenarios and device characteristics, while following the preceding sequence. -- The qualifiers are separated using hyphens \(-\), for example, **res-dark-ldpi.json**. -- Value range of qualifiers: The value of each qualifier must meet the requirements specified in the following table. Otherwise, the resource files in the **resources** directory cannot be matched. The qualifiers are case sensitive. -- Qualifier prefix: The name of a qualifier file in the **resources** file has the prefix **res**, for example, **res-ldpi.json**. -- Default resource qualifier file: By default, the resource qualifier file in **resources** is **res-defaults.json**. -- In the resource qualifier file, color enumeration cannot be used to set resources. - -**Table 1** Resource qualifiers - - - - - - - - - - -

Data Type

-

Description and Value Range

-

Screen density

-

Indicates the screen density of the device, in dpi. The value can be:

-
  • ldpi: low-density screen (~120 dpi) (0.75 x Reference density)
  • mdpi: medium-density screen (~160 dpi) (reference density)
  • hdpi: high-density screen (~240 dpi) (1.5 x Reference density)
  • xhdpi: extra high-density screen (~320 dpi) (2.0 x Reference density)
  • xxhdpi: extra extra high-density screen (~480 dpi) (3.0 x Reference density)
  • xxxhdpi: extra extra extra high-density screen (~640 dpi) (4.0 x Reference density)
-
- -## **Rules for Matching Qualifiers Files and Device Resources** - -- Qualifiers are matched with the device resources in the following priorities: MCC and MNC \> screen orientation \> dark mode \> device type \> screen density. If no matching resource qualifier file is found, the default resource qualifier file is used. -- If a qualifier file contains resource qualifiers, their values must be consistent with the current device status so that the file can be used for matching the device status. For example, the **res-hdpi.json** qualifier file does not match the device density **xhdpi**. - -## Referencing Resources in the JS Module - -You can use the $r syntax in the application development files **.hml** and **.js** to format the JSON resources in the **resources** directory of the JS module and obtain the corresponding resources. - - - - - - - - - - - - -

Attribute

-

Type

-

Description

-

$r

-

(key: string) => string

-

Obtains the resource content that matches the specific qualifiers, for example, this.$r('strings.hello loaded).

-

Parameter description:

-
  • key: key value defined in the resource qualifier file, for example, strings.hello.
-

Example of res-defaults.json:

-
{
-    strings: {
-        hello: 'hello world'
+# Resource Limitations and Access
+
+
+## Resource Qualifiers
+
+The name of a resource qualifier consists of one or more qualifiers that represent the application scenarios or device characteristics, covering the screen density, and more. The qualifiers are separated using hyphens (-). When creating a qualifiers file under resources, you need to understand the file naming conventions and the rules for matching qualifiers files and the device status.
+
+
+## Naming Conventions for Resource Qualifiers
+
+- Qualifiers are ordered in the following sequence: screen density. You can select one or multiple qualifiers to name your file based on your application scenarios and device characteristics, while following the preceding sequence. 
+
+- The qualifiers are separated using hyphens (-), for example, res-dark-ldpi.json.
+
+- Value range of qualifiers: The value of each qualifier must meet the requirements specified in the following table. Otherwise, the resource files in the resources directory cannot be matched. The qualifiers are case sensitive.
+
+- Qualifier prefix: The name of a qualifier file in the resources file has the prefix res, for example, res-ldpi.json.
+
+- Default resource qualifier file: By default, the resource qualifier file in resources is res-defaults.json.
+
+- In the resource qualifier file, color enumeration cannot be used to set resources.
+
+
+  Table1 Resource qualifiers
+
+| Data Type | Description and Value Range | 
+| -------- | -------- |
+| Screen density | Indicates the screen density of the device, in dpi. The value can be:
- ldpi: low-density screen (~120 dpi) (0.75 x Reference density)
- mdpi: medium-density screen (~160 dpi) (reference density)
- hdpi: high-density screen (~240 dpi) (1.5 x Reference density)
- xhdpi: extra high-density screen (~320 dpi) (2.0 x Reference density)
- xxhdpi: extra extra high-density screen (~480 dpi) (3.0 x Reference density)
- xxxhdpi: extra extra extra high-density screen (~640 dpi) (4.0 x Reference density) | + + +## Rules for Matching Qualifiers Files and Device Resources + +- Qualifiers are matched with the device resources in the following priorities: screen orientation > dark mode > screen density. If no matching resource qualifier file is found, the default resource qualifier file is used. + +- If a qualifier file contains resource qualifiers, their values must be consistent with the current device status so that the file can be used for matching the device status. For example, the res-hdpi.json qualifier file does not match the device density xhdpi. + + +## Referencing Resources in the JS Module + +You can use the $r syntax in the application development files .hml and .js to format the JSON resources in the resources directory of the JS module and obtain the corresponding resources. + +| Attribute | Type | Description | +| -------- | -------- | -------- | +| $r | (key: string) => string | Obtains the resource content that matches the specific qualifiers, for example, this.$r('strings.hello loaded).
Parameter description:
- key: key value defined in the resource qualifier file, for example, strings.hello.
| + +Example of res-defaults.json:
+ +``` +{ + strings: { + hello: 'hello world' } -}
-
+} +``` -## Example +## Example resources/res-dark.json: + ``` { "image": { @@ -84,6 +71,7 @@ resources/res-dark.json: resources/res-defaults.json: + ``` { "image": { @@ -95,6 +83,7 @@ resources/res-defaults.json: } ``` + ```
@@ -102,6 +91,5 @@ resources/res-defaults.json:
``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** ->The resource qualifier file does not support color enumeration. - +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**: +> The resource qualifier file does not support color enumeration. diff --git a/en/application-dev/ui/js-framework-syntax-css.md b/en/application-dev/ui/js-framework-syntax-css.md index f03027616e927dd64a75a3ec9216b9d99e30b010..6f4c8e3f3253e0ea9d82b84f180ad3d8d12787b2 100644 --- a/en/application-dev/ui/js-framework-syntax-css.md +++ b/en/application-dev/ui/js-framework-syntax-css.md @@ -1,110 +1,77 @@ -# CSS +# CSS -Cascading Style Sheets \(CSS\) is a language used to describe the HML page structure. All HML components have default styles. You can customize styles for these components using CSS to design various pages. -## Size Unit +Cascading Style Sheets (CSS) is a language used to describe the HML page structure. All HML components have default styles. You can customize styles for these components using CSS to design various pages. -1. Logical px set by ****: - 1. The default logical screen width is 720 px \(for details, see the **"window"** section in [config.json](js-framework-js-tag.md)\). Your page will be scaled to fit the actual width of the screen. For example, on a screen with the actual width of 1440 physical px, 100 px is displayed on 200 physical px, with all sizes doubled from 720 px to 1440 px. - 2. If you set **autoDesignWidth** to **true** \(for details, see the **"window"** section in [config.json](js-framework-js-tag.md)\), the logical px are scaled based on the screen density. For example, if the screen density is 3x, 100 px will be rendered on 300 physical px. This approach is recommended when your application needs to adapt to multiple devices. +## Size Unit -2. Percentage set by ****: The component size is represented by its percentage of the parent component size. For example, if the width **** of a component is set to **50%**, the width of the component is half of its parent component's width. +1. Logical px set by <length>: + 1. The default logical screen width is 720 px (for details, see the "window" section in [config.json](js-framework-js-tag.md)). Your page will be scaled to fit the actual width of the screen. For example, on a screen with the actual width of 1440 physical px, 100 px is displayed on 200 physical px, with all sizes doubled from 720 px to 1440 px. + 2. If you set autoDesignWidth to true (for details, see the "window" section in [config.json](js-framework-js-tag.md)), the logical px are scaled based on the screen density. For example, if the screen density is 3x, 100 px will be rendered on 300 physical px. This approach is recommended when your application needs to adapt to multiple devices. -## Style Import +2. Percentage set by <percentage>: The component size is represented by its percentage of the parent component size. For example, if the width <percentage> of a component is set to 50%, the width of the component is half of its parent component's width. -CSS files can be imported using the **@import** statement. This facilitates module management and code reuse. -## Style Declaration +## Style Import -The **.css** file with the same name as the **.hml** file in each page directory describes the styles of components on the HML page, determining how the components will be displayed. +CSS files can be imported using the @import statement. This facilitates module management and code reuse. -1. Internal style: The **style** and **class** attributes can be used to specify the component style. Example: - ``` - -
- Hello World -
- ``` +## Style Declaration - ``` - /* index.css */ - .container { - justify-content: center; - } - ``` +The .css file with the same name as the .hml file in each page directory describes the styles of components on the HML page, determining how the components will be displayed. -2. External style files: You need to import the files. For example, create a **style.css** file in the **common** directory and import the file at the beginning of **index.css**. +1. Internal style: The style and class attributes can be used to specify the component style. Example: + + ``` + +
+ Hello World +
+ ``` - ``` - /* style.css */ - .title { - font-size: 50px; - } - ``` + + ``` + /* index.css */ + .container { + justify-content: center; + } + ``` - ``` - /* index.css */ - @import '../../common/style.css'; - .container { - justify-content: center; - } - ``` +2. External style files: You need to import the files. For example, create a style.css file in the common directory and import the file at the beginning of index.css. + + ``` + /* style.css */ + .title { + font-size: 50px; + } + ``` + + ``` + /* index.css */ + @import '../../common/style.css'; + .container { + justify-content: center; + } + ``` -## Selectors + +## Selectors A CSS selector is used to select elements for which styles need to be added to. The following table lists the supported selectors. - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Selector

-

Example

-

Description

-

.class

-

.container

-

Selects all components whose class is container.

-

#id

-

#titleId

-

Selects all components whose id is titleId.

-

tag

-

text

-

Selects all <text> components.

-

,

-

.title, .content

-

Selects all components whose class is title or content.

-

#id .class tag

-

#containerId .content text

-

Selects all grandchild <text> components whose grandparent components are identified as containerId and whose parent components are of the content class. To select child components, use > to replace the space between #id and .class, for example, #containerId>.content.

-
+| Selector | Example | Description | +| -------- | -------- | -------- | +| .class | .container | Selects all components whose class is container. | +| \#id | \#titleId | Selects all components whose id is titleId. | +| tag | text | Selects all <text> components. | +| , | .title, .content | Selects all components whose class is title or content. | +| \#id .class tag | \#containerId .content text | Selects all grandchild <text> components whose grandparent components are identified as containerId and whose parent components are of the content class. To select child components, use > to replace the space between \#id and .class, for example, \#containerId>.content. | The following is an example: + ```
@@ -115,6 +82,7 @@ The following is an example:
``` + ``` /* Page style xxx.css */ /* Set the style for all
components. */ @@ -147,63 +115,34 @@ div { The above style works as follows: -![](figures/sample_css.png) - -In the preceding example, **.container text** sets title and content to blue, and **.container \> text** sets title to red. The two styles have the same priority, but **.container \> text** declares the style later and overwrites the former style. \(For details about the priority, see [Selector Specificity](#section1460102134415).\) - -## Selector Specificity - -The specificity rule of the selectors complies with the W3C rule, which is only available for inline styles, **id**, **class**, **tag**, grandchild components, and child components. \(Inline styles are those declared in the **style** attribute.\) - -When multiple selectors point to the same element, their priorities are as follows \(in descending order\): inline style \> **id** \> **class** \> **tag**. - -## Pseudo-classes - -A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element\(s\). For example, **:disabled** can be used to select the element whose **disabled** attribute is **true**. - -In addition to a single pseudo-class, a combination of pseudo-classes is supported. For example, **:focus:checked** selects the element whose **focus** and **checked** attributes are both set to **true**. The following table lists the supported single pseudo-class in descending order of priority. - - - - - - - - - - - - - - - - - - - - - - - - -

Pseudo-class

-

Available Components

-

Description

-

:disabled

-

Components that support the disabled attribute

-

Selects the element whose disabled attribute is changed to true (unavailable for animation attributes).

-

:active

-

Components that support the click event

-

Selects the element activated by a user. For example, a pressed button or a selected tab-bar (unavailable for animation attributes).

-

:waiting

-

button

-

Selects the element whose waiting attribute is true (unavailable for animation attributes).

-

:checked

-

input[type="checkbox", type="radio"], and switch

-

Selects the element whose checked attribute is true (unavailable for animation attributes).

-
- -The following is an example for you to use the **:active** pseudo-class to control the style when a user presses the button. +![en-us_image_0000001267607889](figures/en-us_image_0000001267607889.png) + +In the preceding example, .container text sets title and content to blue, and .container > text sets title to red. The two styles have the same priority, but .container > text declares the style later and overwrites the former style. (For details about the priority, see [Selector Specificity](#selector-specificity).) + +## Selector Specificity + +The specificity rule of the selectors complies with the W3C rule, which is only available for inline styles, id, class, tag, grandchild components, and child components. (Inline styles are those declared in the style attribute.) + +When multiple selectors point to the same element, their priorities are as follows (in descending order): inline style > id > class > tag. + + +## Pseudo-classes + +A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). For example, :disabled can be used to select the element whose disabled attribute is true. + +In addition to a single pseudo-class, a combination of pseudo-classes is supported. For example, :focus:checked selects the element whose focus and checked attributes are both set to true. The following table lists the supported single pseudo-class in descending order of priority. + + | Pseudo-class | Available Components | Description | +| -------- | -------- | -------- | +| :disabled | Components that support the disabled attribute | Selects the element whose disabled attribute is changed to true (unavailable for animation attributes). | +| :focus | Components that support the focusable attribute | Selects the element that takes focus (unavailable for animation attributes). | +| :active | Components that support the click event
| Selects the element activated by a user. For example, a pressed button or a selected tab-bar (unavailable for animation attributes). | +| :waiting | button | Selects the element whose waiting attribute is true (unavailable for animation attributes). | +| :checked | input[type="checkbox", type="radio"], and switch | Selects the element whose checked attribute is true (unavailable for animation attributes). | +| :hover6+ | Components that support the mouseover event | Selects the element that the cursor is on. | + +The following is an example for you to use the :active pseudo-class to control the style when a user presses the button. + ``` @@ -212,6 +151,7 @@ The following is an example for you to use the **:active** pseudo-class to con
``` + ``` /* index.css */ .button:active { @@ -219,59 +159,67 @@ The following is an example for you to use the **:active** pseudo-class to con } ``` ->![](../public_sys-resources/icon-note.gif) **NOTE:** ->Pseudo-classes are not supported for the **** component and its child components, including, ****, ****, ****, and ****. +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**: +> Pseudo-classes are not supported for the component and its child components, including, , ,