Fading Coder

One Final Commit for the Last Sprint

HarmonyOS ArkTS State Management: A Comprehensive Guide to Decorators

HarmonyOS ArkTS State Management: A Comprehensive Guide to Decorators
Overview ArkUI provides a variety of decorators for state management, primarily divided into three categories: managing component-owned state, managing application-owned state, and other state management features. The following diagram illustrates the main decorators: Managing Component-Owned State...

Implementing Multi-Level Navigation in HarmonyOS with Navbar and TabBar

In HarmonyOS application development, routing and view switching are typically managed through state-decorated propertise and lifecycle-aware components. The following example demonstrates how to implement a tab-based interface using TabBar while isolating route state. @Entry @Component struct MainR...

Implementing QR Code Scanning with Camera, Media Library, and Image Processing in HarmonyOS

Overview This implemantation demonstrates QR code scanning using camera capture and media library integration. It supports real-time decoding from the camera feed and parsing QR codes from images selected from the device’s photo gallery. Key Features Real-time QR code detection via camera stream Man...

Implementing Immersive Windows and Picture-in-Picture Features in HarmonyOS

Demonstrates creation and control of primary and secondary windows, immersive mode, picture-in-picture playback, system bar queries, and configurable touch regions using HarmonyOS window management APIs. Functional Scenarios Video Window Playback Launch app and navigate to video screen. Tap video ar...

Implementing Event-Driven Shopping Features with Custom Emitter and Custom Dialogs in HarmonyOS

Project Structure Overview entry/src/main/ets/ |---ui-components | |---TabNav.ets // Bottom tab navigation panel | |---SpecSelector.ets // Product specification selection | |---PromoDialog.ets // Promotional overlay | |---ProductInfo.ets // Detailed product specs block | |---PriceTag.ets // Price di...

Building a Distributed Restaurant Ordering App with HarmonyOS

This example demonstrates a multi-user restaurant ordreing application leveraging HarmonyOS’s distributed data capabilities. Users on different devices within the same network can collaboratively view and update an order in real time without requiring QR codes or external services. Project Structure...

Implementing Page Routing and Navigation in HarmonyOS with ArkUI

Navigate to a Details Page Here is a DetailsPage component that displays an image and allows its width to be adjusted. The page provides a way to navigate back to the home screen. import { router } from '@ohos.router'; @Entry @Component struct DetailsPage { @State currentImageWidth: number = 150; bu...

Implementing Asynchronous Tasks with Node-API Using napi_create_async_work

The Node-API functon napi_create_async_work facilitates the execution of tasks in background threads, allowing long-running operations to avoid blocking the main thread. This approach involves defining two callback functions: one for background execution and another for completion handling on the ma...

Applying Declarative UI Concepts in ArkUI for HarmonyOS Development

In ArkUI's declarative paradigm, UIs are constructed by composing reusable components with clearly defined state and appearance. Below is an illustration using a minimal custom component. @Entry @Component struct MainView { @State labelTxt: string = "Initial Text" build() { Row() { Column(...

Handling Compound Gestures in ArkUI for HarmonyOS

1. Sequantial Recognition Sequential cmopound gestures require gestures to trigger in a specific order; subsequent gestures activate only after the previous one completes successfully. // xxx.ets @Entry @Component struct MyGestureDemo { @State moveX: number = 0; @State moveY: number = 0; @State pres...