From 87b3e914a0777d9ec82b8185c95102faa5b0cbe8 Mon Sep 17 00:00:00 2001 From: EasyGuohf <163991322+EasyGuohf@users.noreply.github.com> Date: Sat, 26 Jul 2025 11:13:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/common/utils/BreakpointSystem.ets | 16 ---------------- .../main/ets/components/MusicInfoComponent.ets | 1 - .../src/main/ets/lyric/LrcUtils.ets | 2 -- 3 files changed, 19 deletions(-) diff --git a/audiointeractionlibrary/src/main/ets/common/utils/BreakpointSystem.ets b/audiointeractionlibrary/src/main/ets/common/utils/BreakpointSystem.ets index 25994c4..396a388 100644 --- a/audiointeractionlibrary/src/main/ets/common/utils/BreakpointSystem.ets +++ b/audiointeractionlibrary/src/main/ets/common/utils/BreakpointSystem.ets @@ -12,22 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { window } from '@kit.ArkUI'; import type { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; diff --git a/audiointeractionlibrary/src/main/ets/components/MusicInfoComponent.ets b/audiointeractionlibrary/src/main/ets/components/MusicInfoComponent.ets index 99e2d67..ef7e3d3 100644 --- a/audiointeractionlibrary/src/main/ets/components/MusicInfoComponent.ets +++ b/audiointeractionlibrary/src/main/ets/components/MusicInfoComponent.ets @@ -23,7 +23,6 @@ import { BreakpointTypeEnum } from '../common/utils/BreakpointSystem'; import { SongItem } from '../songdatacontroller/SongData'; import { ControlAreaComponent } from './ControlAreaComponent'; -@Preview @Component export struct MusicInfoComponent { @StorageProp(KeyConstants.KEY_BREAKPOINT) currentBreakpoint: string = BreakpointTypeEnum.SM; diff --git a/audiointeractionlibrary/src/main/ets/lyric/LrcUtils.ets b/audiointeractionlibrary/src/main/ets/lyric/LrcUtils.ets index 32ebb8f..9ba5079 100644 --- a/audiointeractionlibrary/src/main/ets/lyric/LrcUtils.ets +++ b/audiointeractionlibrary/src/main/ets/lyric/LrcUtils.ets @@ -38,8 +38,6 @@ const krcWordRegex2 = new RegExp('<(\\d+),(\\d+),(\\d+)>(.*)'); * * @param text * @returns - * @param text - * @returns */ export function parseLrcLyric(text: string): Array { if (!text) { -- Gitee From 99726a718d5100c239d11d08f9d1b5807cc8a746 Mon Sep 17 00:00:00 2001 From: EasyGuohf <163991322+EasyGuohf@users.noreply.github.com> Date: Sat, 26 Jul 2025 14:31:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- audiointeractionlibrary/src/main/module.json5 | 14 +++++++++++++- .../src/main/resources/base/element/string.json | 4 ++++ .../src/main/resources/en_US/element/string.json | 4 ++++ .../src/main/resources/zh_CN/element/string.json | 4 ++++ audiointeractionsample/src/main/module.json5 | 12 ------------ .../src/main/resources/base/element/string.json | 6 +----- .../src/main/resources/en_US/element/string.json | 4 ---- .../src/main/resources/zh_CN/element/string.json | 4 ---- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/audiointeractionlibrary/src/main/module.json5 b/audiointeractionlibrary/src/main/module.json5 index edc25d0..600faab 100644 --- a/audiointeractionlibrary/src/main/module.json5 +++ b/audiointeractionlibrary/src/main/module.json5 @@ -7,6 +7,18 @@ "tablet", "2in1" ], - "routerMap": "$profile:route_map" + "routerMap": "$profile:route_map", + "requestPermissions": [ + { + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", + "reason": "$string:reason_background", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "always" + } + } + ] } } diff --git a/audiointeractionlibrary/src/main/resources/base/element/string.json b/audiointeractionlibrary/src/main/resources/base/element/string.json index ecb6ab1..bd2a977 100644 --- a/audiointeractionlibrary/src/main/resources/base/element/string.json +++ b/audiointeractionlibrary/src/main/resources/base/element/string.json @@ -23,6 +23,10 @@ { "name": "page_show", "value": "page from package" + }, + { + "name": "reason_background", + "value": "Allow applications to run in the background of music player scenes." } ] } \ No newline at end of file diff --git a/audiointeractionlibrary/src/main/resources/en_US/element/string.json b/audiointeractionlibrary/src/main/resources/en_US/element/string.json index ecb6ab1..bd2a977 100644 --- a/audiointeractionlibrary/src/main/resources/en_US/element/string.json +++ b/audiointeractionlibrary/src/main/resources/en_US/element/string.json @@ -23,6 +23,10 @@ { "name": "page_show", "value": "page from package" + }, + { + "name": "reason_background", + "value": "Allow applications to run in the background of music player scenes." } ] } \ No newline at end of file diff --git a/audiointeractionlibrary/src/main/resources/zh_CN/element/string.json b/audiointeractionlibrary/src/main/resources/zh_CN/element/string.json index 8f2b2b2..45d1a19 100644 --- a/audiointeractionlibrary/src/main/resources/zh_CN/element/string.json +++ b/audiointeractionlibrary/src/main/resources/zh_CN/element/string.json @@ -23,6 +23,10 @@ { "name": "page_show", "value": "页面" + }, + { + "name": "reason_background", + "value": "允许应用在音乐播放器场景后台运行。" } ] } diff --git a/audiointeractionsample/src/main/module.json5 b/audiointeractionsample/src/main/module.json5 index 71128ca..b7a6e0c 100644 --- a/audiointeractionsample/src/main/module.json5 +++ b/audiointeractionsample/src/main/module.json5 @@ -12,18 +12,6 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", - "requestPermissions": [ - { - "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", - "reason": "$string:reason_background", - "usedScene": { - "abilities": [ - "EntryAbility" - ], - "when": "always" - } - } - ], "abilities": [ { "name": "AudiointeractionsampleAbility", diff --git a/audiointeractionsample/src/main/resources/base/element/string.json b/audiointeractionsample/src/main/resources/base/element/string.json index 98bd0df..519bbdb 100644 --- a/audiointeractionsample/src/main/resources/base/element/string.json +++ b/audiointeractionsample/src/main/resources/base/element/string.json @@ -10,11 +10,7 @@ }, { "name": "EntryAbility_label", - "value": "Music Sample" - }, - { - "name": "reason_background", - "value": "Allow applications to run in the background of music player scenes." + "value": "AudioInteraction" } ] } \ No newline at end of file diff --git a/audiointeractionsample/src/main/resources/en_US/element/string.json b/audiointeractionsample/src/main/resources/en_US/element/string.json index ded591d..519bbdb 100644 --- a/audiointeractionsample/src/main/resources/en_US/element/string.json +++ b/audiointeractionsample/src/main/resources/en_US/element/string.json @@ -11,10 +11,6 @@ { "name": "EntryAbility_label", "value": "AudioInteraction" - }, - { - "name": "reason_background", - "value": "Allow applications to run in the background of music player scenes." } ] } \ No newline at end of file diff --git a/audiointeractionsample/src/main/resources/zh_CN/element/string.json b/audiointeractionsample/src/main/resources/zh_CN/element/string.json index d3fcc91..6a4af4d 100644 --- a/audiointeractionsample/src/main/resources/zh_CN/element/string.json +++ b/audiointeractionsample/src/main/resources/zh_CN/element/string.json @@ -11,10 +11,6 @@ { "name": "EntryAbility_label", "value": "音频交互" - }, - { - "name": "reason_background", - "value": "允许应用在音乐播放器场景后台运行。" } ] } -- Gitee