Harmony OS 2

HarmonyOS development adds 8 new samples

HarmonyOS Samples (1)

Huawei HarmonyOS has released new information regarding the HarmonyOS Sample, it added eight super practical application examples, of which three are examples of a declarative paradigm based on TS extensible development.

Explain that “the declarative development paradigm based on TS extension” is one of the two development paradigms provided by the Ark development framework. It adopts a programming approach that is closer to natural semantics, allowing developers to intuitively describe the UI interface without having to care about how the framework implements UI drawing and rendering, achieving minimal and efficient development. The official website document has updated the development guide, and interested friends can go to the official website to learn.

Sample 1: New JS NativeDemo sample

Scenario: This example uses JS and C++ to develop, uses JS to call C++ code, and displays the running result of C++ code on the UI.

Operating environment: HarmonyOS

Source download link:

https://gitee.com/harmonyos/harmonyos_app_samples/tree/master/native/JSNativeDemo

Sample 2: New JS Panel sample

Scenario: This example displays product details and platform guarantees through a sliding panel. JS provides a lightweight content display panel, this panel can be slid, you can customize the trigger method, pop-up height and other attributes.

Operating environment: OpenHarmony

Source download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsPanel

Sample 3: New JS List sample

Scenario: This example shows the application of the list control in the product classification list. Two list items are used in the list group to show the two list forms of Group contraction and Group expansion. After clicking, the corresponding list will pop up.

Operating environment: OpenHarmony

Source download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsList

Sample 4: New JS Svg sample

Scenario: This example shows the use of the component and its sub-components in JS, including,

Operating environment: OpenHarmony

Source download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsSvg

Sample 5: New JS Dialog example

Scenario: This example completes the function of adding and deleting contacts, and uses custom pop-up windows to implement when adding and deleting contacts. JS supports user-defined pop-up windows. Components are used as container components. Users can customize the style and layout of pop-up windows.

Operating environment: OpenHarmony

Source download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsDialog

Sample 6: Add eTSBuildCommonView to create a simple view example

Scenario: This example uses a simple page constructed by Stack layout and Flex layout to display pictures and nutritional information of food tomatoes. For details, refer to the official website document: ArkUI-> Declarative Development Paradigm Based on TS Extension -> Experience Declarative UI.

Operating environment: HarmonyOS and OpenHarmony (different operating systems, the sample source code is different)

Run on HarmonyOS source download link:

https://gitee.com/harmonyos/harmonyos_app_samples/tree/master/ETSUI/eTSBuildCommonView

Run on OpenHarmony source download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/eTSBuildCommonView

Sample 7: Add eTSDefiningPageLayoutAndConnection page layout and connection example

Scenario: This example builds a food category list page and a food details page, including: List layout: create a food data model, ForEach loops to render ListItem; Grid layout: display food classification information, create Tabs tabs to display different categories of food; routing mechanism: Data transfer between router interface, Navigator and pages. For details, refer to the official website document: ArkUI-> Declarative Development Paradigm Based on TS Extension -> Page Layout and Connection.

Operating environment: HarmonyOS and OpenHarmony (different operating systems, the sample source code is different)

Run on HarmonyOS source download link:

https://gitee.com/harmonyos/harmonyos_app_samples/tree/master/ETSUI/eTSDefiningPageLayoutAndConnection

Run on OpenHarmony source download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/eTSDefiningPageLayoutAndConnection

Sample 8: Added eTSDrawingAndAnimation drawing and animation examples

Scenario: This example implements the dynamic part of the healthy diet application, including: Logo drawing: use the drawing components Shape and Path to draw the logo of the healthy diet application; splash screen and page transition dynamic effects: explicit animation animateTo realize splash screen animation, add The transition animation of shared elements from the food category list page to the food details page. For details, refer to the official website document: ArkUI-> Declarative Development Paradigm Based on TS Extension -> Drawing and Animation.

Operating environment: HarmonyOS

Source download link:

https://gitee.com/harmonyos/harmonyos_app_samples/tree/master/ETSUI/eTSDrawingAndAnimation.

HarmonyOS Samples

(Via)

 



Comments

Most Popular

To Top