diff --git a/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/DeviceDialog.ets b/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/DeviceDialog.ets index 8d8e623d7..328954d2c 100644 --- a/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/DeviceDialog.ets +++ b/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/DeviceDialog.ets @@ -29,25 +29,25 @@ export struct DeviceDialog { build() { Column() { Text($r('app.string.choiceDevice')) - .fontSize(px2vp(30)) + .fontSize(24) .width('100%') - .height('20%') .fontColor(Color.Black) .textAlign(TextAlign.Start) + .fontWeight(600) List() { ForEach(this.deviceList, (item: deviceManager.DeviceBasicInfo, index: number | undefined) => { ListItem() { Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { Text(item.deviceName) - .fontSize(px2vp(30)) - .width('80%') + .fontSize(18) + .width('86%') .fontColor(Color.Black) + .textAlign(TextAlign.Start) Radio({ value: '', group: 'radioGroup' }) .radioStyle({ checkedBackgroundColor: '#ff0d64fb' }) - .align(Alignment.Top) - .width('3%') + .width('7%') .checked(index === this.selectedIndex ? true : false) } .margin({ top: 17 }) @@ -91,8 +91,8 @@ export struct DeviceDialog { this.deviceDialogWidth = (newArea.width > newArea.height ? newArea.height : newArea.width) as number * 0.1 //percentage }) .width('80%') - .height(px2vp(240)) - .padding({ left: 18, right: 32 }) + .height(300) + .padding(16) .backgroundColor(Color.White) .border({ color: Color.White, radius: 20 }) } diff --git a/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/TitleBarComponent.ets b/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/TitleBarComponent.ets index da14faa61..fb4fd2b2f 100644 --- a/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/TitleBarComponent.ets +++ b/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/common/TitleBarComponent.ets @@ -174,8 +174,9 @@ export struct TitleBarComponent { }) Text($r('app.string.distributed_calculator')) .height('60%') - .fontSize('28px') + .fontSize(24) .margin({ left: 12 }) + .fontWeight(600) Blank().layoutWeight(1) if (!this.isShow) { Image($r("app.media.ic_hop_normal1")) diff --git a/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/model/KvStoreModel.ets b/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/model/KvStoreModel.ets index 63393c7be..012dfd6dd 100644 --- a/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/model/KvStoreModel.ets +++ b/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc/entry/src/main/ets/model/KvStoreModel.ets @@ -76,14 +76,14 @@ export class KvStoreModel { put(key: string, value: string) { if (this.kvStore) { - Logger.debug(TAG, `kvStore.put ${key} = ${value}`) - this.kvStore.put( + Logger.debug(TAG, `kvStore?.put ${key} = ${value}`) + this.kvStore?.put( key, value ).then((data) => { - Logger.debug(TAG, `kvStore.put ${key} finished, data= ${JSON.stringify(data)}`) + Logger.debug(TAG, `kvStore?.put ${key} finished, data= ${JSON.stringify(data)}`) }).catch((err: object) => { - Logger.debug(TAG, `kvStore.put ${key} failed, ${JSON.stringify(err)}`) + Logger.debug(TAG, `kvStore?.put ${key} failed, ${JSON.stringify(err)}`) }) } } @@ -91,10 +91,10 @@ export class KvStoreModel { setOnMessageReceivedListener(context: common.UIAbilityContext, msg: string, callback: Callback) { Logger.info(TAG, `setOnMessageReceivedListener: ${msg}`); this.createKvStore(context, () => { - Logger.info(TAG, `kvStore.on(dataChange) begin`); + Logger.info(TAG, `kvStore?.on(dataChange) begin`); if (this.kvStore !== undefined && this.kvStore !== null) { try { - this.kvStore!.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => { + this.kvStore?.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => { Logger.debug(TAG, `dataChange, ${JSON.stringify(data)}`); let entries = data.insertEntries.length > 0 ? data.insertEntries : data.updateEntries; for (let i = 0; i < entries.length; i++) { @@ -107,10 +107,10 @@ export class KvStoreModel { } }) } catch (err) { - Logger.error(TAG, `kvStore.on(dataChange) err :` + err); + Logger.error(TAG, `kvStore?.on(dataChange) err :` + err); } } - Logger.info(TAG, `kvStore.on(dataChange) end`); + Logger.info(TAG, `kvStore?.on(dataChange) end`); }) } } \ No newline at end of file