From 0dd007fbb1a17473c547ae9b22ad6c8b11712c2f Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Tue, 12 Aug 2025 16:41:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liveviewlockscreensample/oh-package.json5 | 2 +- .../src/main/ets/entryability/EntryAbility.ets | 2 +- .../src/main/ets/liveview/LiveViewExtAbility.ets | 2 +- liveviewlockscreensample/src/main/ets/pages/Index.ets | 2 +- liveviewlockscreensample/src/main/ets/pages/LockScreen.ets | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/liveviewlockscreensample/oh-package.json5 b/liveviewlockscreensample/oh-package.json5 index d1077b3..31f77b1 100644 --- a/liveviewlockscreensample/oh-package.json5 +++ b/liveviewlockscreensample/oh-package.json5 @@ -6,6 +6,6 @@ "author": "", "license": "", "dependencies": { - "liveviewlockscreenlibrary": "file:../liveviewlockscreenlibrary" + "@ohos_samples/liveviewlockscreenlibrary": "file:../liveviewlockscreenlibrary" } } \ No newline at end of file diff --git a/liveviewlockscreensample/src/main/ets/entryability/EntryAbility.ets b/liveviewlockscreensample/src/main/ets/entryability/EntryAbility.ets index defc176..5b354c2 100644 --- a/liveviewlockscreensample/src/main/ets/entryability/EntryAbility.ets +++ b/liveviewlockscreensample/src/main/ets/entryability/EntryAbility.ets @@ -16,7 +16,7 @@ import { UIAbility } from '@kit.AbilityKit'; import { window } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; -import { LiveViewLockScreenController } from 'liveviewlockscreenlibrary'; +import { LiveViewLockScreenController } from '@ohos_samples/liveviewlockscreenlibrary'; const TAG: string = '[EntryAbility]'; diff --git a/liveviewlockscreensample/src/main/ets/liveview/LiveViewExtAbility.ets b/liveviewlockscreensample/src/main/ets/liveview/LiveViewExtAbility.ets index 6b94c02..bef9697 100644 --- a/liveviewlockscreensample/src/main/ets/liveview/LiveViewExtAbility.ets +++ b/liveviewlockscreensample/src/main/ets/liveview/LiveViewExtAbility.ets @@ -17,7 +17,7 @@ import { AbilityConstant, UIExtensionContentSession, Want } from '@kit.AbilityKi import { BusinessError } from '@kit.BasicServicesKit'; import { LiveViewLockScreenExtensionAbility } from '@kit.LiveViewKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; -import { LiveViewLockScreenController } from 'liveviewlockscreenlibrary'; +import { LiveViewLockScreenController } from '@ohos_samples/liveviewlockscreenlibrary'; const TAG: string = '[LiveViewExtAbility]'; diff --git a/liveviewlockscreensample/src/main/ets/pages/Index.ets b/liveviewlockscreensample/src/main/ets/pages/Index.ets index 8292b27..893b6c7 100644 --- a/liveviewlockscreensample/src/main/ets/pages/Index.ets +++ b/liveviewlockscreensample/src/main/ets/pages/Index.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { IndexComponent } from 'liveviewlockscreenlibrary' +import { IndexComponent } from '@ohos_samples/liveviewlockscreenlibrary' @Entry @Component diff --git a/liveviewlockscreensample/src/main/ets/pages/LockScreen.ets b/liveviewlockscreensample/src/main/ets/pages/LockScreen.ets index 0331471..ce7738b 100644 --- a/liveviewlockscreensample/src/main/ets/pages/LockScreen.ets +++ b/liveviewlockscreensample/src/main/ets/pages/LockScreen.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { LockScreenComponent } from 'liveviewlockscreenlibrary' +import { LockScreenComponent } from '@ohos_samples/liveviewlockscreenlibrary' @Entry struct LockScreen { -- Gitee From ae6ca4375358aae9f040afd5c15103149b0ca761 Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Tue, 12 Aug 2025 16:54:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/utils/LiveViewUtil.ets | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets index 20e7b98..b97373a 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets @@ -115,7 +115,7 @@ export class LiveViewUtil { liveView.liveViewData.primary.title = `${this.getStringSync($r('app.string.live_view_primary_title_first') .id)}${params.distance}${this.getStringSync($r('app.string.live_view_primary_title_second').id)}`; - liveView.liveViewData.primary.content = [{ text: this.getResourceStringSync(params.roadName) }]; + liveView.liveViewData.primary.content = [{ text: this.getStringSync(params.roadName.id) }]; liveView.liveViewData.primary.liveViewLockScreenAbilityName = 'LiveViewExtAbility'; liveView.liveViewData.primary.liveViewLockScreenAbilityParameters = { '': '' }; if (params.laneData.laneNum === 1) { @@ -195,15 +195,4 @@ export class LiveViewUtil { } return stringSyn; } - - private getResourceStringSync(resource: Resource): string { - let stringSyn: string = ''; - try { - stringSyn = this.context.resourceManager.getStringSync(resource); - } catch (error) { - hilog.error(0x0000, TAG, '%{public}s', - `Get string failed. code: ${(error as BusinessError).code} message is ${(error as BusinessError).message}`); - } - return stringSyn; - } } \ No newline at end of file -- Gitee