diff --git a/AppScope/app.json5 b/AppScope/app.json5 index d835af8bcb5ed37242286222c9aab43b7f59e6e2..b1722899dc88bc09828d41f82dbf3efc8214a989 100644 --- a/AppScope/app.json5 +++ b/AppScope/app.json5 @@ -4,7 +4,7 @@ "vendor": "example", "versionCode": 1000000, "versionName": "1.0.0", - "icon": "$media:app_icon", + "icon": "$media:layered_image", "label": "$string:app_name" } } diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/AppScope/resources/base/media/background.png b/AppScope/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/AppScope/resources/base/media/background.png differ diff --git a/AppScope/resources/base/media/foreground.png b/AppScope/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/AppScope/resources/base/media/foreground.png differ diff --git a/AppScope/resources/base/media/layered_image.json b/AppScope/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/AppScope/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/README.en.md b/README.en.md index b0273de10925df3c834f159bcb25911fde5272be..e0796075c4f809803996feedceea6955cc280146 100644 --- a/README.en.md +++ b/README.en.md @@ -24,6 +24,6 @@ Learn how to edit images based on image encoding and decoding, including croppin ### Constraints 1. The sample is only supported on Huawei phones with standard systems. -2. HarmonyOS: HarmonyOS NEXT Developer Beta1 or later. -3. DevEco Studio: DevEco Studio NEXT Developer Beta1 or later. -4. HarmonyOS SDK: HarmonyOS NEXT Developer Beta1 SDK or later. \ No newline at end of file +2. HarmonyOS: HarmonyOS 5.0.2 Release or later. +3. DevEco Studio: DevEco Studio 5.0.2 Release or later. +4. HarmonyOS SDK: HarmonyOS 5.0.2 Release SDK or later. \ No newline at end of file diff --git a/README.md b/README.md index bf8eba5371d7497ddc283941e7b06210e43d02a7..27086d79f1b42b395a33d71ce57dbb424e4d1244 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,6 @@ ### 约束与限制 1. 本示例仅支持标准系统上运行,支持设备:华为手机。 -2. HarmonyOS系统:HarmonyOS NEXT Developer Beta1及以上。 -3. DevEco Studio版本:DevEco Studio NEXT Developer Beta1及以上。 -4. HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta1 SDK及以上。 +2. HarmonyOS系统:HarmonyOS 5.0.2 Release及以上。 +3. DevEco Studio版本:DevEco Studio 5.0.2 Release及以上。 +4. HarmonyOS SDK版本:HarmonyOS 5.0.2 Release SDK及以上。 diff --git a/build-profile.json5 b/build-profile.json5 index f29ed54511fef845e7c090443e5c50d92d5246e0..7b8c01ae1bd2328bcf74106fceee1cee89bde26e 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -4,7 +4,7 @@ { "name": "default", "signingConfig": "default", - "compatibleSdkVersion": "5.0.0(12)", + "compatibleSdkVersion": "5.0.2(14)", "runtimeOS": "HarmonyOS" } ], diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 471b041318af1ea7190d1ab5961970564c767549..bf4e047dcb290ecae7308181e69d508766abe2cb 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -47,13 +47,7 @@ export default class EntryAbility extends UIAbility { }); windowStage.getMainWindow((_err, windowClass) => { - windowClass.setWindowLayoutFullScreen(false, (err) => { - if (err.code) { - hilog.error(0x0000, 'EntryAbility', 'Failed to set the window layout to no-full-screen mode. Cause:' + JSON.stringify(err)); - return; - } - hilog.info(0x0000, 'EntryAbility', 'Succeeded in setting the window layout to no-full-screen mode.'); - }); + windowClass.setWindowLayoutFullScreen(false); }); windowStage.loadContent('pages/HomePage', (err, data) => { diff --git a/entry/src/main/ets/utils/EncodeUtil.ets b/entry/src/main/ets/utils/EncodeUtil.ets index b61b26a14b1d2e6c940e9e261b7bf916a5e852b5..8473583d3bc0a930729bb75c5db034c8556487b8 100644 --- a/entry/src/main/ets/utils/EncodeUtil.ets +++ b/entry/src/main/ets/utils/EncodeUtil.ets @@ -35,7 +35,7 @@ export async function encode(component: Object, pixelMap: PixelMap) { format: CommonConstants.ENCODE_FORMAT, quality: CommonConstants.ENCODE_QUALITY } - const imageData = await imagePackerApi.packing(newPixelMap, packOptions); + const imageData = await imagePackerApi.packToData(newPixelMap, packOptions); Logger.info(TAG, `imageData's length is ${imageData.byteLength}`); // Create image asset. let photoType: photoAccessHelper.PhotoType = photoAccessHelper.PhotoType.IMAGE; diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index 0cf2dfecc0cee41449dea74fedb655e005c29c08..e62cea5cef68352aa046887a3210cc652f76c5b3 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -22,9 +22,9 @@ "srcEntry": "./ets/entryability/EntryAbility.ets", "description": "$string:EntryAbility_desc", "orientation": "portrait", - "icon": "$media:icon", + "icon": "$media:layered_image", "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:icon", + "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", "exported": true, "skills": [ diff --git a/entry/src/main/resources/base/media/background.png b/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..923f2b3f27e915d6871871deea0420eb45ce102f Binary files /dev/null and b/entry/src/main/resources/base/media/background.png differ diff --git a/entry/src/main/resources/base/media/foreground.png b/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..97014d3e10e5ff511409c378cd4255713aecd85f Binary files /dev/null and b/entry/src/main/resources/base/media/foreground.png differ diff --git a/entry/src/main/resources/base/media/icon.png b/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/entry/src/main/resources/base/media/layered_image.json b/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/startIcon.png b/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/entry/src/main/resources/base/media/startIcon.png differ