diff --git a/liveviewlockscreenlibrary/src/main/ets/component/LockScreenComponent.ets b/liveviewlockscreenlibrary/src/main/ets/component/LockScreenComponent.ets index 2655cbc493046de6890598b0e0d00e95c8eb9fb3..04e2eca464f1c76ae8a34596c84af0e1dcc0ce28 100644 --- a/liveviewlockscreenlibrary/src/main/ets/component/LockScreenComponent.ets +++ b/liveviewlockscreenlibrary/src/main/ets/component/LockScreenComponent.ets @@ -22,11 +22,11 @@ import { RoadView } from '../view/RoadView'; export struct LockScreenComponent { @StorageLink(Constants.KEY_PREFIX + 'CurrentHeightBreakpoint') currentHeightBreakpoint: string = BreakpointTypeEnum.SM; - @StorageLink(Constants.KEY_PREFIX + 'LaneData') roadInfo: LaneData | undefined = undefined; + @StorageLink(Constants.KEY_PREFIX + 'LaneData') laneData: LaneData | undefined = undefined; build() { Stack({ alignContent: Alignment.Top }) { - RoadView({ laneNum: this.roadInfo?.laneNum }) + RoadView({ laneNum: this.laneData?.laneNum }) Image($rawfile('traffic_light.svg')) .objectFit(ImageFit.Contain) diff --git a/liveviewlockscreenlibrary/src/main/ets/model/RouteDataModel.ets b/liveviewlockscreenlibrary/src/main/ets/model/RouteDataModel.ets index 2f5416898231e07b897c70bd6983fb12f5ca1ee1..cb4de3210e6d8ae7155db5ba9651f4106612fc79 100644 --- a/liveviewlockscreenlibrary/src/main/ets/model/RouteDataModel.ets +++ b/liveviewlockscreenlibrary/src/main/ets/model/RouteDataModel.ets @@ -19,7 +19,7 @@ export interface LaneData { export interface RouteData { // route information - roadInfo: LaneData, + laneData: LaneData, distance: number, roadName: Resource, } \ No newline at end of file diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets index 488d5079104fa5bac05421404c99adad8e4ec38c..30eb2cec249ceaa0a91340c508ab74e9d789ffee 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets @@ -58,14 +58,14 @@ export class LiveView { hilog.info(0x0000, TAG, '%{public}s', 'Success to getRunningProcessInformation'); // Handle background state if (data[0].state === appManager.ProcessState.STATE_BACKGROUND) { - let routeInfo: RouteData = getRouteData(); - this.liveViewController.updateLiveView(routeInfo); + let routeData: RouteData = getRouteData(); + this.liveViewController.updateLiveView(routeData); // Prepare common event data let options: commonEventManager.CommonEventPublishData = { data: 'data', bundleName: AppStorage.get(Constants.KEY_PREFIX + 'BundleName'), parameters: { - 'roadData': routeInfo.roadInfo + 'laneData': routeData.laneData } }; // Publish system event for lock screen updates diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewExtAbilityUtil.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewExtAbilityUtil.ets index 487fd04e2c6f6b16f266145575322484e4ff1f5a..d50510569358a8521b0110457b8878fef15af205 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewExtAbilityUtil.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewExtAbilityUtil.ets @@ -89,7 +89,7 @@ export class LiveViewExtAbilityUtil { } hilog.info(0x0000, TAG, '%{public}s', 'Succeeded in subscribe commonEvent success.'); if (data.parameters) { - let laneData = data.parameters['roadData'] as LaneData; + let laneData = data.parameters['laneData'] as LaneData; AppStorage.setOrCreate(Constants.KEY_PREFIX + 'LaneData', laneData); hilog.info(0x0000, TAG, '%{public}s', 'Succeeded in receive commonEvent.'); } diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets index d35974350a9e2fb297fb9df0f86c34fb36aa0e0c..20e7b98b8dc4f01bdf156e949f29809c362a949c 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets @@ -118,7 +118,7 @@ export class LiveViewUtil { liveView.liveViewData.primary.content = [{ text: this.getResourceStringSync(params.roadName) }]; liveView.liveViewData.primary.liveViewLockScreenAbilityName = 'LiveViewExtAbility'; liveView.liveViewData.primary.liveViewLockScreenAbilityParameters = { '': '' }; - if (params.roadInfo.laneNum === 1) { + if (params.laneData.laneNum === 1) { liveView.liveViewData.primary.layoutData = { layoutType: liveViewManager.LayoutType.LAYOUT_TYPE_NAVIGATION, currentNavigationIcon: 'turn_straight_light_rectangle.png', diff --git a/liveviewlockscreenlibrary/src/main/ets/viewmodel/RouteDataViewModel.ets b/liveviewlockscreenlibrary/src/main/ets/viewmodel/RouteDataViewModel.ets index 920ea8d15db0ac01e6d6f8a0f52dfa23fd17f81f..0233db197e74baccaa15347b97b7b1ca3f9c9fd3 100644 --- a/liveviewlockscreenlibrary/src/main/ets/viewmodel/RouteDataViewModel.ets +++ b/liveviewlockscreenlibrary/src/main/ets/viewmodel/RouteDataViewModel.ets @@ -16,7 +16,7 @@ import { RouteData } from '../model/RouteDataModel'; const LEFT_STATE: RouteData = { - roadInfo: { + laneData: { laneNum: 1 }, distance: 800, @@ -24,7 +24,7 @@ const LEFT_STATE: RouteData = { }; const RIGHT_STATE: RouteData = { - roadInfo: { + laneData: { laneNum: 2 }, distance: 800,