From 2be67ca4a01f0c99e3a74406507beea4dc0d795a Mon Sep 17 00:00:00 2001 From: hzt Date: Mon, 16 Jun 2025 17:09:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=20BestPracticeSnippe?= =?UTF-8?q?ts/=20SegmentedPhotograph=20=E5=B7=A5=E7=A8=8B=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E6=8A=A5=E9=94=99=EF=BC=9B=E6=B7=BB=E5=8A=A0=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=E6=96=87=E4=BB=B6=E4=B8=8D=E5=BD=B1=E5=93=8D=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/obfuscation-rules.txt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 SegmentedPhotograph/entry/obfuscation-rules.txt diff --git a/SegmentedPhotograph/entry/obfuscation-rules.txt b/SegmentedPhotograph/entry/obfuscation-rules.txt new file mode 100644 index 00000000..272efb6c --- /dev/null +++ b/SegmentedPhotograph/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file -- Gitee From 90586cb5b177d1f7c33792adeccd5e822c8fa715 Mon Sep 17 00:00:00 2001 From: hzt Date: Tue, 17 Jun 2025 10:02:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?improvement:=E4=BF=AE=E6=94=B9=20BestPracti?= =?UTF-8?q?ceSnippets/=20VideoPlayerSample=20=E5=B7=A5=E7=A8=8B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=EF=BC=9Bdevice=5Fwidth=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E4=BD=8D=E7=BD=AE=EF=BC=8C=E4=B8=8D=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/controller/AvPlayerController.ets | 3 --- VideoPlayerSample/entry/src/main/ets/pages/IndexPage.ets | 5 ++--- .../entry/src/main/ets/pages/IndexPageDocs.ets | 8 ++++---- VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/VideoPlayerSample/MediaService/src/main/ets/controller/AvPlayerController.ets b/VideoPlayerSample/MediaService/src/main/ets/controller/AvPlayerController.ets index c694b3e9..2895227e 100644 --- a/VideoPlayerSample/MediaService/src/main/ets/controller/AvPlayerController.ets +++ b/VideoPlayerSample/MediaService/src/main/ets/controller/AvPlayerController.ets @@ -122,8 +122,6 @@ export class AvPlayerController { this.avSessionController.getAvSession()?.on('fastForward', (time?: number) => this.sessionFastForwardCallback(time)); // Set fast forward command listening events this.avSessionController.getAvSession()?.on('rewind', (time?: number) => this.sessionRewindCallback(time)); // Set the fast back command to listen for events. this.avSessionController.getAvSession()?.on('seek', (seekTime: number) => this.sessionSeekCallback(seekTime)); // Set the jump node to listen to events. - - } // [End listener1] @@ -255,7 +253,6 @@ export class AvPlayerController { // [End pause_video] } - // [Start update_is_play] private updateIsPlay(isPlay: boolean) { if (this.curIndex !== this.curSource.index) { diff --git a/VideoPlayerSample/entry/src/main/ets/pages/IndexPage.ets b/VideoPlayerSample/entry/src/main/ets/pages/IndexPage.ets index 1efe876a..ce4df4da 100644 --- a/VideoPlayerSample/entry/src/main/ets/pages/IndexPage.ets +++ b/VideoPlayerSample/entry/src/main/ets/pages/IndexPage.ets @@ -88,7 +88,7 @@ struct IndexPage { this.isFloatWindow = false; } } - // [End device_width] + // [StartExclude device_width] onBackPress(): boolean | void { if (this.isFullScreen || this.isFullLandscapeScreen) { this.handleFullScreenExit(); @@ -107,8 +107,7 @@ struct IndexPage { } } - - // [Start device_width] + // [EndExclude device_width] build() { // [StartExclude device_width] Navigation(this.pageInfo) { diff --git a/VideoPlayerSample/entry/src/main/ets/pages/IndexPageDocs.ets b/VideoPlayerSample/entry/src/main/ets/pages/IndexPageDocs.ets index 46e6d359..6dc0fd47 100644 --- a/VideoPlayerSample/entry/src/main/ets/pages/IndexPageDocs.ets +++ b/VideoPlayerSample/entry/src/main/ets/pages/IndexPageDocs.ets @@ -39,18 +39,18 @@ struct IndexPage { private swiperController: SwiperController = new SwiperController(); private windowUtil: WindowUtil = WindowUtil.getInstance(); - // 在aboutToAppear中开启窗口尺寸监听 + // Turn on window size listening in aboutToAppear async aboutToAppear(): Promise { let context = this.getUIContext().getHostContext()!; let windowClass = await window.getLastWindow(context); await windowClass.setWindowKeepScreenOn(true); - //注册窗口尺寸监听 + // Register window size listening this.windowUtil.registerOnWindowSizeChange((size) => { if (size.width > size.height) { - //横屏逻辑 + // landscape logic this.isFullLandscapeScreen = true; } else { - //竖屏逻辑 + // Vertical screen logic this.isFullLandscapeScreen = false; } }); diff --git a/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets b/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets index 68eaf9b1..76afbbdd 100644 --- a/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets +++ b/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets @@ -289,7 +289,7 @@ export struct VideoPlayer { .height('100%') .width('50%') - // [Start screen5] + // [End screen5] } .height('100%') .width('100%') -- Gitee