diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..9fbc57e54f3d996d8fd4c143b40de3d47768b140 --- /dev/null +++ b/README.en.md @@ -0,0 +1,37 @@ +# Developing Home Screen Shortcuts +## Overview +Home screen shortcuts enable you to rapidly access the core functions of apps, thereby enhancing operation efficiency and increasing users' dependency on apps. + +For example, you can create a navigation shortcut for frequently visited places such as your home and company. Tap to launch the map app and start navigation. +## Preview +![](/screenshots/image_en.gif) +## Project Directory +```` +├──entry/src/main/ets // Code area +│ ├──entryability +│ │ └──EntryAbility.ets // Entry ability +│ ├──entrybackupability +│ │ └──EntryBackupAbility.ets +│ └──pages +│ ├──GoCompany.ets // My Company page +│ ├──Login.ets // My Home page +│ └──Logout.ets // Home page +└──entry/src/main/resources // App resource directory +```` +## How to Use +Long pressing the app icon will display the shortcut list. Tap the icon to quickly open the desired page in the app. +## How to Implement +* Configure the **shortcuts_config.json** file in **/resources/base/profile/**. + +* In the **abilities** tag of the **module.json5** file, configure the **metadata** tag for the UIAbility component to which a shortcut needs to be added so that the shortcut configuration file takes effect for the UIAbility. + +## Permissions +N/A +## Constraints +* The sample is only supported on Huawei phones with standard systems. + +* The HarmonyOS version must be HarmonyOS 5.0.0 Release or later. + +* The DevEco Studio version must be DevEco Studio 5.0.0 Release or later. + +* The HarmonyOS SDK version must be HarmonyOS 5.0.0 Release SDK or later. \ No newline at end of file diff --git a/entry/src/main/ets/pages/GoCompany.ets b/entry/src/main/ets/pages/GoCompany.ets index 154af701431ae51b1d046e5cd6fd06b51ead0ff7..0513ab3f11a63ee66ede1e389e55debf77f30fee 100644 --- a/entry/src/main/ets/pages/GoCompany.ets +++ b/entry/src/main/ets/pages/GoCompany.ets @@ -350,7 +350,7 @@ export struct GoCompany { .width('100%') .height('100%') } - .backgroundImage($r('app.media.backgroundMap')) + .backgroundImage(this.isEnglish ? $r('app.media.backgroundMap_en') : $r('app.media.backgroundMap')) .backgroundImageSize({ width: '100%', height: '100%' }) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) .height('100%') diff --git a/entry/src/main/ets/pages/GoHouse.ets b/entry/src/main/ets/pages/GoHouse.ets index 0513f003c02a8db6f8bdc371d990ff634d31818a..cab0a10512778c85ea7a35657badbaf164df9e96 100644 --- a/entry/src/main/ets/pages/GoHouse.ets +++ b/entry/src/main/ets/pages/GoHouse.ets @@ -382,7 +382,7 @@ export struct GoHouse { .width('100%') .height('100%') } - .backgroundImage($r('app.media.backgroundMap')) + .backgroundImage(this.isEnglish ? $r('app.media.backgroundMap_en') : $r('app.media.backgroundMap')) .backgroundImageSize({ width: '100%', height: '100%' }) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) .height('100%') diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 0c771953972c06528c3b598842c1582bc5ccfa33..a303cb90182a4714357649971d24abaf3f6d6420 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -385,7 +385,7 @@ struct Index { .width('100%') .height('100%') } - .backgroundImage($r('app.media.backgroundMap')) + .backgroundImage(this.isEnglish ? $r('app.media.backgroundMap_en') : $r('app.media.backgroundMap')) .backgroundImageSize({ width: '100%', height: '100%' }) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) .mode(NavigationMode.Stack) diff --git a/entry/src/main/resources/base/media/backgroundMap_en.png b/entry/src/main/resources/base/media/backgroundMap_en.png new file mode 100644 index 0000000000000000000000000000000000000000..2426bbf149c3524acc0ffa1dcf16df9515d5d441 Binary files /dev/null and b/entry/src/main/resources/base/media/backgroundMap_en.png differ diff --git a/screenshots/image_en.gif b/screenshots/image_en.gif new file mode 100644 index 0000000000000000000000000000000000000000..385cafd43ed75deb017a08b73b16f7b20386bfc4 Binary files /dev/null and b/screenshots/image_en.gif differ