diff --git a/README.en.md b/README.en.md index 815516b4fe5ba687a537d1b4aa9203971089f787..d3dc6af6d22d91571dcafa965cca73bbce46e226 100644 --- a/README.en.md +++ b/README.en.md @@ -1,36 +1,73 @@ -# MutilDeviceCamera +# Camera Capabilities Across Devices -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} +## Overview +This sample shows how to apply the open camera capabilities of HarmonyOS across multiple devices, including Camera Kit for preview and photographing, photoAccessHelper for saving photos, and breakpoints for implementing different layouts and functionalities on multiple devices. By running this sample, you can implement features such as preview rotation, photo rotation, and camera switch on devices (smartphones, large-screen foldable phones, widescreen foldable phones, triple-screen foldable phones, and tablets) in either unfolded state or folded state. -#### Software Architecture -Software architecture description +## Effect -#### Installation +Running effect on smartphones -1. xxxx -2. xxxx -3. xxxx +![](screenshots/device/mate60pro-en.png) -#### Instructions +Running effect on widescreen foldable phones -1. xxxx -2. xxxx -3. xxxx +![](screenshots/device/purax-en.png) -#### Contribution +Running effect on large-screen foldable phones -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request +![](screenshots/device/matex5-en.png) +Running effect on triple-screen foldable phones -#### Gitee Feature +![](screenshots/device/matext-en.png) + +Running effect on tablets + +![](screenshots/device/matepadpro-en.png) + +## How to Use + +Tap the button at the bottom to take photos and preview. In this process, you can set camera rotation angles, switch between the front and rear camera, and adjust the fold state. + +## Project Directory + +``` +├──entry/src/main/ets/ +│ ├──entryability +│ │ └──EntryAbility.ets +│ ├──entrybackupability +│ │ └──EntryBackupAbility.ets +│ ├──pages +│ │ └──Index.ets // Home page +│ ├──utils +│ │ ├──BreakpointType.ets // Breakpoint utility +│ │ ├──CameraUtil.ets // Camera utility +│ │ └──WindowUtil.ets // Window utility +│ └──views +│ └──CommonView.ets // Common view +└──entry/src/main/resource // Static resources of the application +``` + +## How to Implement + +⦁ Use Camera Kit to preview and take photos. +⦁ Use photoAccessHelper to save photos. +⦁ Use breakpoints to implement different page layouts and functionalities on multiple devices. + +## Required Permissions + +⦁ Camera permission: ohos.permission.CAMERA, which is required for camera development. +⦁ Restricted permission - media library permission: ohos.permission.READ_IMAGEVIDEO, which is used to read files from Gallery. Applicable scenarios and functionalities: The application needs to clone, back up, or sync images or videos. +⦁ Restricted permission - media library permission: ohos.permission.WRITE_IMAGEVIDEO, which is used to save files to Gallery. Applicable scenarios and functionalities: The application needs to clone, back up, or sync images or videos. + +## Dependencies + +N/A + +## 约束与限制 + +1. This sample is only supported on Huawei phones with standard systems. +2. The HarmonyOS version must be HarmonyOS 5.0.2 Release or later. +3. The DevEco Studio version must be DevEco Studio 5.0.2 Release or later. +4. The HarmonyOS SDK version must be HarmonyOS 5.0.2 Release SDK or later. -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/entry/src/main/ets/views/CommonView.ets b/entry/src/main/ets/views/CommonView.ets index a03865c602bfe7b21832f11282fe9d561738f892..3bbf212f4539f0e9b66444f0a8c66da21fd6573f 100644 --- a/entry/src/main/ets/views/CommonView.ets +++ b/entry/src/main/ets/views/CommonView.ets @@ -33,7 +33,7 @@ export struct ChooseMusic { .lineHeight(21) .fontColor(Color.White) } - .width(120) + .width(140) .height(40) .backgroundColor('#1AFFFFFF') .justifyContent(FlexAlign.Center) @@ -63,7 +63,7 @@ export struct SettingButton { 12).getValue(this.widthBp)) .fontColor(Color.White) } - .width(40) + .width(52 ) .margin({ bottom: new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 16 : 8), 16, 16).getValue(this.widthBp) }) @@ -95,7 +95,7 @@ export struct ShotAreaSm { .width(6) } .height('100%') - .width(28) + .width(40) Blank() @@ -103,9 +103,10 @@ export struct ShotAreaSm { .fontSize(14) .lineHeight(20) .fontColor(Color.White) + .width(40) } .height(32) - .width(this.heightBp === HeightBreakpoint.HEIGHT_LG ? 80 : 72) + .width(this.heightBp === HeightBreakpoint.HEIGHT_LG ? 102 : 94) .alignItems(VerticalAlign.Top) } .width(this.heightBp === HeightBreakpoint.HEIGHT_LG ? 80 : 72) diff --git a/screenshots/device/mate60pro-en.png b/screenshots/device/mate60pro-en.png new file mode 100644 index 0000000000000000000000000000000000000000..8cf9ac22761c9553a7ac3ec2def957a3c4075e96 Binary files /dev/null and b/screenshots/device/mate60pro-en.png differ diff --git a/screenshots/device/matepadpro-en.png b/screenshots/device/matepadpro-en.png new file mode 100644 index 0000000000000000000000000000000000000000..fc3965b82d38d0e5d7b2fa374a06af7d3f52d2e8 Binary files /dev/null and b/screenshots/device/matepadpro-en.png differ diff --git a/screenshots/device/matex5-en.png b/screenshots/device/matex5-en.png new file mode 100644 index 0000000000000000000000000000000000000000..1dddbd18f2a9c03dca509b6ac721fbe56b8548aa Binary files /dev/null and b/screenshots/device/matex5-en.png differ diff --git a/screenshots/device/matext-en.png b/screenshots/device/matext-en.png new file mode 100644 index 0000000000000000000000000000000000000000..f21b9bf3e82e6989819fb9ec0711f3e6d36cc8bd Binary files /dev/null and b/screenshots/device/matext-en.png differ diff --git a/screenshots/device/purax-en.png b/screenshots/device/purax-en.png new file mode 100644 index 0000000000000000000000000000000000000000..338ae5d14617c028f51333d44c9fa028f1381637 Binary files /dev/null and b/screenshots/device/purax-en.png differ