harmony 鸿蒙ArkTS Widget Related Modules

  • 2023-06-24
  • 浏览 (483)

ArkTS Widget Related Modules

Figure 1 ArkTS widget related modules

WidgetModules

  • FormExtensionAbility: provides lifecycle callbacks invoked when a widget is created, destroyed, or updated.

  • FormExtensionContext: provides context for FormExtensionAbilities. You can use the APIs of this module to start FormExtensionAbilities.

  • formProvider: provides APIs related to the widget provider. You can use the APIs to update a widget, set the next update time for a widget, obtain widget information, and request a widget release.

  • formInfo: provides types and enums related to the widget information and state.

  • formBindingData: provides APIs for widget data binding. You can use the APIs to create a FormBindingData object and obtain related information.

  • Page layout (WidgetCard.ets): provides APIs for the declarative UI paradigm.

  • Widget configuration: includes FormExtensionAbility configuration and widget configuration.

    • Configure the FormExtensionAbility information under extensionAbilities in the module.json5 file.
    • Configure the widget configuration information (WidgetCard.ets) in the form_config.json file in resources/base/profile.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Application Models

harmony 鸿蒙Using Explicit Want to Start an Application Component

harmony 鸿蒙Using Implicit Want to Open a Website

harmony 鸿蒙AbilityStage Component Container

harmony 鸿蒙Accessing a DataAbility

harmony 鸿蒙Accessing a DataShareExtensionAbility from the FA Model

harmony 鸿蒙AccessibilityExtensionAbility

harmony 鸿蒙Common action and entities Values

harmony 鸿蒙API Switching Overview

harmony 鸿蒙Switching of app and deviceConfig

0  赞