From a5c20df7b27d49117a64e37f2c0e036c2d890e51 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Mon, 6 Sep 2021 14:50:20 +0800 Subject: [PATCH] update docs Signed-off-by: ester.zhou --- UI/JSUICustomComponent/README.md | 17 +++++++++++++++++ native/NativeLayer/README.md | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 UI/JSUICustomComponent/README.md create mode 100644 native/NativeLayer/README.md diff --git a/UI/JSUICustomComponent/README.md b/UI/JSUICustomComponent/README.md new file mode 100644 index 0000000000..92be40afdc --- /dev/null +++ b/UI/JSUICustomComponent/README.md @@ -0,0 +1,17 @@ +# JSUICustomComponent + + + +### Introduction + +A custom component is one that combines existing components based on service requirements. A custom component can be invoked multiple times in a project to improve the code readability. This sample illustrates how to use custom components in JavaScript, including basic usage, custom events, props, and event parameters. + +### Usage + +1. The home screen of the sample application is a simple list of recommended e-books. The items in the list are custom components, which are introduced to the host page through **element**. When a user clicks **Collect** or **Collected** on a child component, the click event passes parameters to the parent component. After obtaining the parameters, the parent component updates the e-book status (collected or not) and passes the parameters to the child component through attributes. The text displayed in the child component then changes to **Collected** or **Collect**, depending on the e-book status. + +2. When a user clicks **Enter collected**, the system adds the e-book in **Collected** state to the **Collected** list and passes the list as a parameter to the **Collected** page. When the user accesses the **Collected** page, the e-books added to the **Collected** list are displayed. The items in the list are still custom components. + +### Constraints + +This sample can only be run on standard-system devices. diff --git a/native/NativeLayer/README.md b/native/NativeLayer/README.md new file mode 100644 index 0000000000..aa91ccd526 --- /dev/null +++ b/native/NativeLayer/README.md @@ -0,0 +1,19 @@ +# Native_layer + + + +### Introduction + +Native_layer declares the Java Native Interface (JNI) related to the native layer. This sample exemplifies how to use the JNI of Native_layer to obtain the native layer that matches the Java surface object. Besides obtaining the information about the native layer, you can also set its size and format. + +### Usage + +1. Click **Get nativelayer info** to obtain the width, height, and format of the native layer for the surface object by calling the JNI. + +2. Click **Set nativelayer width and height**. In the width and height text boxes, enter int values, and then click **OK**. The graphics and text on the surface will be drawn based on your settings. + +3. Click **Set nativelayer format**. In the format text box, enter an int value, and then click **OK** to set the format of the native layer. + +### Constraints + +This sample can only be run on large-system devices. -- Gitee