From 3dd58f8ec2b7381108c8e63d15e56f4bc59c23c7 Mon Sep 17 00:00:00 2001 From: caochuan Date: Fri, 25 Oct 2024 14:59:09 +0800 Subject: [PATCH 1/2] modify medialibrary transcode sample Signed-off-by: caochuan --- code/SystemFeature/FileManagement/Photos/README_zh.md | 1 + .../entry/src/main/ets/components/TransCodingDialog.ets | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/SystemFeature/FileManagement/Photos/README_zh.md b/code/SystemFeature/FileManagement/Photos/README_zh.md index 5d92f40780..49df4078fa 100644 --- a/code/SystemFeature/FileManagement/Photos/README_zh.md +++ b/code/SystemFeature/FileManagement/Photos/README_zh.md @@ -34,6 +34,7 @@ 19. 在相册图片列表界面,长按图片,选择图片,点击更多,可以将图片加入到其他相册(可多选) 20. 在用户相册图片列表界面,长按图片,选择图片,点击更多,可以将图片从当前相册移除(可多选) 21. 在用户相册图片列表界面,长按图片,选择图片,点击更多,可以查看图片详情(可多选) +22. 点击视频,视频界面,点击转码图标,转码视频 ### 工程目录 diff --git a/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/TransCodingDialog.ets b/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/TransCodingDialog.ets index caab2c2457..84aea76602 100644 --- a/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/TransCodingDialog.ets +++ b/code/SystemFeature/FileManagement/Photos/entry/src/main/ets/components/TransCodingDialog.ets @@ -33,6 +33,7 @@ export struct TransCodingDialog { @State showProgressNum: number = 0; @State transCodingResult: boolean = false; @State fileUri: string = ''; + @State isTranscoding: Boolean = false; aboutToAppear(): void { Log.info(TAG, 'aboutToAppear'); @@ -60,7 +61,7 @@ export struct TransCodingDialog { Stack({ alignContent: Alignment.Top }) { Row() { Button() { - Text($r('app.string.no')) + Text($r('app.string.action_back')) .fontSize($r('sys.float.ohos_id_text_size_button1')) .fontColor($r('app.color.color_control_highlight')) .fontWeight(FontWeight.Medium) @@ -93,13 +94,14 @@ export struct TransCodingDialog { .width('50%') .textAlign(TextAlign.Center) } - .enabled(!this.isNull) - .opacity(this.isNull ? $r('app.float.disable_button_opacity') : 1) + .enabled(!this.isNull && !this.isTranscoding) + .opacity(this.isNull || this.isTranscoding ? $r('app.float.disable_button_opacity') : 1) .margin({ right: $r('app.float.details_dialog_button_margin_left') }) .backgroundColor($r('app.color.transparent')) .height($r('app.float.details_dialog_button_height')) .onClick((): void => { if (this.dialogCallback != null && this.dialogCallback.confirmCallback !== null) { + this.isTranscoding = true; const fileUri = (uri: string) => { this.fileUri = uri; Log.info(TAG, 'fileUri uri:' + uri); @@ -107,6 +109,7 @@ export struct TransCodingDialog { const transCodingResult = (result: boolean) => { this.transCodingResult = result; Log.info(TAG, 'Transcoding Result:' + result); + this.isTranscoding = false; }; const showProgressNum = (progress: number) => { this.showProgressNum = progress; -- Gitee From 538a5003e20edf994057eadd1b8bf7d47c8eef36 Mon Sep 17 00:00:00 2001 From: caochuan Date: Mon, 17 Feb 2025 10:43:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E7=A0=81?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B8=BA15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caochuan --- code/SystemFeature/FileManagement/Photos/build-profile.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/SystemFeature/FileManagement/Photos/build-profile.json5 b/code/SystemFeature/FileManagement/Photos/build-profile.json5 index bea45ef90a..9129463a7c 100644 --- a/code/SystemFeature/FileManagement/Photos/build-profile.json5 +++ b/code/SystemFeature/FileManagement/Photos/build-profile.json5 @@ -19,8 +19,8 @@ { "name": "default", "signingConfig": "default", - "compileSdkVersion": 14, - "compatibleSdkVersion": 14, + "compileSdkVersion": 15, + "compatibleSdkVersion": 15, "runtimeOS": "OpenHarmony" } ] -- Gitee