From 407b429806d35b6b3466bb12b15c3949abfe2bdd Mon Sep 17 00:00:00 2001 From: tangzhigang1 Date: Thu, 8 Dec 2022 20:07:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=EF=BC=9A=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E7=AE=A1=E7=90=86=E7=9A=84=E5=9B=BE=E6=A0=87=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tangzhigang1 --- .../src/main/ets/com/ohos/view/component/appLstComponent.ets | 1 + 1 file changed, 1 insertion(+) diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/appLstComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/appLstComponent.ets index 6f80cf27..a97985ef 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/appLstComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/appLstComponent.ets @@ -78,6 +78,7 @@ export default struct AppLstComponent { .border({ width: $r('app.float.border_width'), color: Color.White, radius: $r('app.float.border_radius') }) .backgroundColor(Color.White) + .clip(true) .padding({ left: $r('app.float.itemComp_padding_l'), right: $r('app.float.itemComp_padding_r') From bd04ebe7faa0a67a4f195b16fe33109aa7bedd0e Mon Sep 17 00:00:00 2001 From: tangzhigang1 Date: Fri, 6 Jan 2023 18:09:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=93=9D=E5=8C=BA=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tangzhigang1 --- .../src/main/ets/default/TintStateManager.ts | 4 +- entry/pc/src/main/module.json5 | 6 +++ entry/phone/src/main/module.json5 | 6 +++ .../com/ohos/pages/SimpleToggleComponent.ets | 49 ++++++++++--------- .../pages/SimpleToggleLayoutEditComponent.ets | 2 +- .../com/ohos/view/component/itemComponent.ets | 2 +- .../ohos/vm/noDisturbComponentViewModel.ts | 2 +- .../ets/com/ohos/model/RingModeService.ts | 4 +- .../ets/com/ohos/pages/IconItemComponent.ets | 2 +- .../ets/viewmodel/NavigationBarViewModel.ts | 18 ++++--- .../src/main/ets/pages/noDisturb.ets | 40 ++++++++------- .../ets/pages/notificationManagenment.ets | 3 +- .../src/main/ets/vm/noDisturbViewModel.ts | 1 + .../ServiceExtAbility/ServiceExtAbility.ts | 1 + .../controlpanel/src/main/ets/pages/index.ets | 2 +- .../src/main/ets/pages/index.ets | 2 +- 16 files changed, 83 insertions(+), 61 deletions(-) diff --git a/common/src/main/ets/default/TintStateManager.ts b/common/src/main/ets/default/TintStateManager.ts index fe462018..a71655b3 100644 --- a/common/src/main/ets/default/TintStateManager.ts +++ b/common/src/main/ets/default/TintStateManager.ts @@ -69,13 +69,13 @@ export default class TintStateManager { Log.showDebug(TAG, `unregistser ${windowType}, res: ${res}`); } - async onSystemBarTintChange(data): Promise { + onSystemBarTintChange(data): Promise { Log.showDebug(TAG, `onSystemBarTintChange, data: ${JSON.stringify(data)}`); if (!Array.isArray(data.regionTint)) { Log.showDebug(TAG, 'regionTint is not array.'); return; } - let dis = await display.getDefaultDisplay(); + let dis = display.getDefaultDisplaySync(); if (dis.id != data.displayId) { Log.showDebug(TAG, `Needn't change, displayId: ${data.displayId}`); return; diff --git a/entry/pc/src/main/module.json5 b/entry/pc/src/main/module.json5 index dba1a241..94a5243e 100644 --- a/entry/pc/src/main/module.json5 +++ b/entry/pc/src/main/module.json5 @@ -12,6 +12,12 @@ "installationFree": false, "uiSyntax": "ets", "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "extensionAbilities": [ { "visible": true, diff --git a/entry/phone/src/main/module.json5 b/entry/phone/src/main/module.json5 index cd0ec776..5aa8dde8 100644 --- a/entry/phone/src/main/module.json5 +++ b/entry/phone/src/main/module.json5 @@ -12,6 +12,12 @@ "installationFree": false, "uiSyntax": "ets", "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "extensionAbilities": [ { "visible": true, diff --git a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets index bf931a3a..d28177d5 100644 --- a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets +++ b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets @@ -48,31 +48,32 @@ export default struct SimpleToggleComponent { build() { Column() { - if (this.mItemData.get().pluginType == PluginType.META) { - SimpleToggleBase({ - mToggleId: this.keyId, - mIcon: $mDefaultIcon, - mIconStr: this.mItemData.get().iconUrl, - mUseIconStr: true, - mChangeSwitch: $mDefaultChangeSwitch, - mLabel: $mDefaultLabel, - mLabelStr: this.mItemData.get().label, - mUseLabelStr: true, - mEditMode: this.mEditMode, - mDragMode: this.mDragMode, - mClickEvent: () => this.onIconItemClick(), - mLongClickEvent: () => this.onIconItemLongPressGesture() - }) - } else if (this.mItemData.get().pluginType == PluginType.DATA_ABILITY) { - // TODO: - } else if (this.mItemData.get().pluginType == PluginType.PLUGIN_COMPONENT) { - PluginIconItemComponent({ - keyId: this.keyId, - mEditMode: this.mEditMode, - mDragMode: this.mDragMode - }) + if (this.keyId != ""){ + if (this.mItemData.get().pluginType == PluginType.META) { + SimpleToggleBase({ + mToggleId: this.keyId, + mIcon: $mDefaultIcon, + mIconStr: this.mItemData.get().iconUrl, + mUseIconStr: true, + mChangeSwitch: $mDefaultChangeSwitch, + mLabel: $mDefaultLabel, + mLabelStr: this.mItemData.get().label, + mUseLabelStr: true, + mEditMode: this.mEditMode, + mDragMode: this.mDragMode, + mClickEvent: () => this.onIconItemClick(), + mLongClickEvent: () => this.onIconItemLongPressGesture() + }) + } else if (this.mItemData.get().pluginType == PluginType.DATA_ABILITY) { + // TODO: + } else if (this.mItemData.get().pluginType == PluginType.PLUGIN_COMPONENT) { + PluginIconItemComponent({ + keyId: this.keyId, + mEditMode: this.mEditMode, + mDragMode: this.mDragMode + }) + } } - } .width('100%') .height('100%') diff --git a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets index 9aaea1b7..ed251f09 100644 --- a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets +++ b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets @@ -310,7 +310,7 @@ export default struct SimpleToggleLayoutEditComponent { onComponentTouch(event: TouchEvent) { Log.showDebug(TAG, `onComponentTouch`); - // event.stopPropagation(); TODO + event.stopPropagation(); } } diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets index ba84a243..185e8e24 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets @@ -17,7 +17,7 @@ import ConfigData from '../../common/constants'; @Component export default struct ItemComponent { @Link title: Resource; - @State value: string = ''; + @Link value: ResourceStr; @Link arrow: Resource; build() { diff --git a/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts b/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts index 089c1419..0709dd5c 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts +++ b/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts @@ -27,7 +27,7 @@ export default class NoDisturbComponentViewModel { startTime = ''; endTime = ''; repeatMode = 0; - repeatName: any = ''; + repeatName: Resource | string = ''; prompt = ''; isEffective = true; nextDayLabel = ''; diff --git a/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts b/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts index 3f1242d0..b77c86ae 100644 --- a/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts +++ b/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts @@ -31,14 +31,14 @@ export class RingModeService { mListeners = new Set(); mAudioManager: any; - startService(): void { + async startService(): Promise { if (this.mIsStart) { return; } Log.showInfo(TAG, 'startService'); this.mIsStart = true; - this.mAudioManager = getAudioManager(); + this.mAudioManager = await getAudioManager().getVolumeManager().getVolumeGroupManager(audio.DEFAULT_VOLUME_GROUP_ID); this.getRingerMode(); diff --git a/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets b/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets index 1cc894c2..56d761e9 100644 --- a/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets +++ b/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets @@ -133,7 +133,7 @@ export default struct IconItemComponent { onIconItemTouch(event: TouchEvent) { Log.showInfo(TAG, `onIconItemTouch, event: ${JSON.stringify(event)}`); if (this.mItemData.get()?.actionData?.clickAction || this.mItemData.get()?.actionData?.longClickAction) { - // event.stopPropagation() + event.stopPropagation() } } } \ No newline at end of file diff --git a/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts b/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts index b7ae6b05..c9b6ce0f 100644 --- a/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts +++ b/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts @@ -160,17 +160,19 @@ export default class NavigationBarViewModel { private windowSwitches(navigationBarStatusValue: string): void { this.isDisplay = navigationBarStatusValue == '1' ? true : false; - if (!this.isDisplay) { + if (!this.isDisplay || !this.mNavigationBarComponentData.isEnable) { //For gesture navigation scenarios //Systemui hides the navigation bar,and then notifies the launcher that it can start moving down the dock bar. WindowManager.hideWindow(WindowType.NAVIGATION_BAR).then(() => { - commonEvent.publish(NAVIGATIONBAR_HIDE_EVENT, (err) => { - if (err.code) { - Log.showError(TAG, `${NAVIGATIONBAR_HIDE_EVENT} PublishCallBack err: ${JSON.stringify(err)}`); - } else { - Log.showInfo(TAG, `${NAVIGATIONBAR_HIDE_EVENT} Publish sucess`); - } - }) + if(!this.isDisplay){ + commonEvent.publish(NAVIGATIONBAR_HIDE_EVENT, (err) => { + if (err.code) { + Log.showError(TAG, `${NAVIGATIONBAR_HIDE_EVENT} PublishCallBack err: ${JSON.stringify(err)}`); + } else { + Log.showInfo(TAG, `${NAVIGATIONBAR_HIDE_EVENT} Publish sucess`); + } + }) + } }).catch((err) => { Log.showError(TAG, `${NAVIGATIONBAR_HIDE_EVENT} Publish catch err: ${JSON.stringify(err)}`); }); diff --git a/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets b/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets index dfa42721..7025f50e 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets @@ -30,7 +30,7 @@ const GROUP_REPEAT_MODE = 'repeatMode'; @Entry @Component export default struct NoDisturb { - @State mViewModel: ViewModel = new ViewModel(); + @State@Watch("onChange") mViewModel: ViewModel = new ViewModel(); @State headName:Resource = $r('app.string.noDisturb'); @State repeatTitle:Resource = $r('app.string.repeat'); @State startDateTitle:Resource = $r('app.string.startDate'); @@ -38,9 +38,22 @@ export default struct NoDisturb { @State startTitle:Resource = $r('app.string.startTime'); @State endTitle:Resource = $r('app.string.endTime'); @State arrow: Resource = $r('app.media.ic_settings_arrow'); - @State mRefreshCnt: number = 0; + @State repeatName : ResourceStr = this.mViewModel.repeatName + @State startDateClue : string = this.mViewModel.startDateClue + @State startTimeClue : string = this.mViewModel.startTimeClue + @State endDateClue : string = this.mViewModel.endDateClue + @State endTimeClue : string = this.mViewModel.endTimeClue mPrevData: string = ''; + onChange() { + this.repeatName = this.mViewModel.repeatName + this.startDateClue = this.mViewModel.startDateClue + this.startTimeClue = this.mViewModel.startTimeClue + this.endDateClue = this.mViewModel.endDateClue + this.endTimeClue = this.mViewModel.endTimeClue + Log.showInfo(TAG, `mViewModel onChange repeatName: ${this.mViewModel.repeatName} startDateClue: ${this.mViewModel.startDateClue} + endDateClue: ${this.mViewModel.endDateClue} endTimeClue: ${this.mViewModel.endTimeClue}`) + } startDateDialogController: CustomDialogController = new CustomDialogController({ builder: DateDialog({ action:(data)=> this.setStartDate(data), @@ -109,11 +122,10 @@ export default struct NoDisturb { Row() { Column() { HeadComponent({ headName: $headName, isActive: true }) - if (this.mRefreshCnt > 0) { Row() { ItemComponent({ title: $repeatTitle, - value: this.mViewModel.repeatName, + value: $repeatName, arrow: $arrow }) }.onClick(() => { @@ -126,7 +138,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $startDateTitle, - value: this.mViewModel.startDateClue, + value: $startDateClue, arrow: $arrow }) }.onClick(() => { @@ -137,7 +149,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $startTitle, - value: this.mViewModel.startTimeClue, + value: $startTimeClue, arrow: $arrow }) }.onClick(() => { @@ -162,7 +174,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $endDateTitle, - value: this.mViewModel.endDateClue, + value: $endDateClue, arrow: $arrow }) }.onClick(() => { @@ -173,7 +185,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $endTitle, - value: this.mViewModel.endTimeClue, + value: $endTimeClue, arrow: $arrow }) }.onClick(() => { @@ -197,7 +209,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $startTitle, - value: this.mViewModel.startTimeClue, + value: $startTimeClue, arrow: $arrow }) }.onClick(() => { @@ -207,7 +219,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $endTitle, - value: this.mViewModel.endTimeClue, + value: $endTimeClue, arrow: $arrow }) }.onClick(() => { @@ -215,7 +227,6 @@ export default struct NoDisturb { this.endTimeDialogController.open() }).margin({ bottom: $r('app.float.itemComp_margin_b')}) } - } } .width(ConfigData.WH_100_100) .height(ConfigData.WH_100_100) @@ -241,12 +252,10 @@ export default struct NoDisturb { setRepeatMode(data: number) { this.mViewModel.onRepeatModeAccect(data); - this.mRefreshCnt++; } setStartDate(data: string) { let dataSource = this.mViewModel.setDateIntoDateTime(this.mViewModel.defaultStartTime, data); this.mViewModel.onStartTimeAccept(dataSource); - this.mRefreshCnt++; } setStartTime(data: string) { let dataSource = data; @@ -256,12 +265,10 @@ export default struct NoDisturb { dataSource = this.mPrevData; } this.mViewModel.onStartTimeAccept(dataSource); - this.mRefreshCnt++; } setEndDate(data: string) { let dataSource = this.mViewModel.setDateIntoDateTime(this.mViewModel.defaultEndTime, data); this.mViewModel.onEndTimeAccept(dataSource); - this.mRefreshCnt++; } setEndTime(data: string) { let dataSource = data; @@ -271,15 +278,12 @@ export default struct NoDisturb { dataSource = this.mPrevData; } this.mViewModel.onEndTimeAccept(dataSource); - this.mRefreshCnt++; } aboutToAppear(): void{ Log.showInfo(TAG, `aboutToAppear`) this.mViewModel.viewModelInit() - this.mRefreshCnt++; - } onBackPress() { diff --git a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets index 1353f9f2..bd1cac65 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets @@ -36,6 +36,7 @@ export default struct notificationManagenment { @State headName: Resource = $r('app.string.notification') @State title: Resource = $r('app.string.batch_Management') @State arrow: Resource= $r('app.media.ic_settings_arrow') + @State itemStr: string = '' @State allowDistribut: Resource = $r('app.string.allowDistribut') @State allowDistributDescribe: Resource = $r('app.string.allowDistributDescribe') @@ -143,7 +144,7 @@ export default struct notificationManagenment { .padding({ left: $r('sys.float.ohos_id_default_padding_start') }) Row() { - ItemComponent({ title: $title, value: '', arrow: $arrow }) + ItemComponent({ title: $title, value: $itemStr, arrow: $arrow }) }.onClick(() => { Log.showDebug(TAG, `BatchManagement on click`) Router.push({ uri: 'pages/batchSetEnable' }); diff --git a/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts b/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts index b20d7c03..21a2e1a8 100644 --- a/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts +++ b/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts @@ -22,6 +22,7 @@ import FeaturesConfigData, {DoNotDisturbType} from '../../../../../../../feature const TAG = 'NotificationManagement-NoDisturbViewModel'; const CONST_DAY_LENGTH = 24*3600*1000; +@Observed export default class NoDisturbViewModel extends NoDisturbComponentViewModel { startDateClue = ''; diff --git a/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts index 3ed6b4bf..74446999 100644 --- a/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ b/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts @@ -66,6 +66,7 @@ class ServiceExtAbility extends ServiceExtension { height: configInfo.height, }); }).then(() => { + Log.showInfo(TAG, `Spike ==> ${JSON.stringify(volumeRect)}`); WindowManager.resetSizeWindow(WindowType.VOLUME_PANEL, volumeRect); }).catch((err) => { }); diff --git a/product/pc/controlpanel/src/main/ets/pages/index.ets b/product/pc/controlpanel/src/main/ets/pages/index.ets index d10bf40c..e76fea85 100644 --- a/product/pc/controlpanel/src/main/ets/pages/index.ets +++ b/product/pc/controlpanel/src/main/ets/pages/index.ets @@ -158,7 +158,7 @@ struct Index { if (windowInfo) { windowInfo.visibility ? this.hideWindow() - : WindowManager.showWindow(WindowType.CONTROL_PANEL); + : this.showWindow(); } }) ); diff --git a/product/pc/notificationpanel/src/main/ets/pages/index.ets b/product/pc/notificationpanel/src/main/ets/pages/index.ets index cfd9129e..4cf8c2c2 100644 --- a/product/pc/notificationpanel/src/main/ets/pages/index.ets +++ b/product/pc/notificationpanel/src/main/ets/pages/index.ets @@ -126,7 +126,7 @@ struct Index { if (windowInfo) { windowInfo.visibility ? this.hideWindow() - : WindowManager.showWindow(WindowType.NOTIFICATION_PANEL); + : this.showWindow(); } }) ); From 33f049b4ac4ce08efce445f0412d6965a3e19f79 Mon Sep 17 00:00:00 2001 From: tangzhigang1 Date: Fri, 6 Jan 2023 18:09:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=93=9D=E5=8C=BA=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tangzhigang1 --- .../src/main/ets/default/TintStateManager.ts | 4 +- entry/pc/src/main/module.json5 | 6 +++ entry/phone/src/main/module.json5 | 6 +++ .../com/ohos/pages/SimpleToggleComponent.ets | 49 ++++++++++--------- .../pages/SimpleToggleLayoutEditComponent.ets | 2 +- .../com/ohos/view/component/itemComponent.ets | 2 +- .../ohos/vm/noDisturbComponentViewModel.ts | 2 +- .../ets/com/ohos/model/RingModeService.ts | 4 +- .../ets/com/ohos/pages/IconItemComponent.ets | 2 +- .../ets/viewmodel/NavigationBarViewModel.ts | 18 ++++--- .../src/main/ets/pages/noDisturb.ets | 40 ++++++++------- .../ets/pages/notificationManagenment.ets | 3 +- .../src/main/ets/vm/noDisturbViewModel.ts | 1 + .../ServiceExtAbility/ServiceExtAbility.ts | 1 + .../controlpanel/src/main/ets/pages/index.ets | 2 +- .../src/main/ets/pages/index.ets | 2 +- .../phone/dropdownpanel/src/main/module.json5 | 6 +++ product/phone/statusbar/src/main/module.json5 | 6 +++ 18 files changed, 95 insertions(+), 61 deletions(-) diff --git a/common/src/main/ets/default/TintStateManager.ts b/common/src/main/ets/default/TintStateManager.ts index fe462018..a71655b3 100644 --- a/common/src/main/ets/default/TintStateManager.ts +++ b/common/src/main/ets/default/TintStateManager.ts @@ -69,13 +69,13 @@ export default class TintStateManager { Log.showDebug(TAG, `unregistser ${windowType}, res: ${res}`); } - async onSystemBarTintChange(data): Promise { + onSystemBarTintChange(data): Promise { Log.showDebug(TAG, `onSystemBarTintChange, data: ${JSON.stringify(data)}`); if (!Array.isArray(data.regionTint)) { Log.showDebug(TAG, 'regionTint is not array.'); return; } - let dis = await display.getDefaultDisplay(); + let dis = display.getDefaultDisplaySync(); if (dis.id != data.displayId) { Log.showDebug(TAG, `Needn't change, displayId: ${data.displayId}`); return; diff --git a/entry/pc/src/main/module.json5 b/entry/pc/src/main/module.json5 index dba1a241..94a5243e 100644 --- a/entry/pc/src/main/module.json5 +++ b/entry/pc/src/main/module.json5 @@ -12,6 +12,12 @@ "installationFree": false, "uiSyntax": "ets", "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "extensionAbilities": [ { "visible": true, diff --git a/entry/phone/src/main/module.json5 b/entry/phone/src/main/module.json5 index cd0ec776..5aa8dde8 100644 --- a/entry/phone/src/main/module.json5 +++ b/entry/phone/src/main/module.json5 @@ -12,6 +12,12 @@ "installationFree": false, "uiSyntax": "ets", "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "extensionAbilities": [ { "visible": true, diff --git a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets index bf931a3a..d28177d5 100644 --- a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets +++ b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleComponent.ets @@ -48,31 +48,32 @@ export default struct SimpleToggleComponent { build() { Column() { - if (this.mItemData.get().pluginType == PluginType.META) { - SimpleToggleBase({ - mToggleId: this.keyId, - mIcon: $mDefaultIcon, - mIconStr: this.mItemData.get().iconUrl, - mUseIconStr: true, - mChangeSwitch: $mDefaultChangeSwitch, - mLabel: $mDefaultLabel, - mLabelStr: this.mItemData.get().label, - mUseLabelStr: true, - mEditMode: this.mEditMode, - mDragMode: this.mDragMode, - mClickEvent: () => this.onIconItemClick(), - mLongClickEvent: () => this.onIconItemLongPressGesture() - }) - } else if (this.mItemData.get().pluginType == PluginType.DATA_ABILITY) { - // TODO: - } else if (this.mItemData.get().pluginType == PluginType.PLUGIN_COMPONENT) { - PluginIconItemComponent({ - keyId: this.keyId, - mEditMode: this.mEditMode, - mDragMode: this.mDragMode - }) + if (this.keyId != ""){ + if (this.mItemData.get().pluginType == PluginType.META) { + SimpleToggleBase({ + mToggleId: this.keyId, + mIcon: $mDefaultIcon, + mIconStr: this.mItemData.get().iconUrl, + mUseIconStr: true, + mChangeSwitch: $mDefaultChangeSwitch, + mLabel: $mDefaultLabel, + mLabelStr: this.mItemData.get().label, + mUseLabelStr: true, + mEditMode: this.mEditMode, + mDragMode: this.mDragMode, + mClickEvent: () => this.onIconItemClick(), + mLongClickEvent: () => this.onIconItemLongPressGesture() + }) + } else if (this.mItemData.get().pluginType == PluginType.DATA_ABILITY) { + // TODO: + } else if (this.mItemData.get().pluginType == PluginType.PLUGIN_COMPONENT) { + PluginIconItemComponent({ + keyId: this.keyId, + mEditMode: this.mEditMode, + mDragMode: this.mDragMode + }) + } } - } .width('100%') .height('100%') diff --git a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets index 9aaea1b7..ed251f09 100644 --- a/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets +++ b/features/controlcentercomponent/src/main/ets/com/ohos/pages/SimpleToggleLayoutEditComponent.ets @@ -310,7 +310,7 @@ export default struct SimpleToggleLayoutEditComponent { onComponentTouch(event: TouchEvent) { Log.showDebug(TAG, `onComponentTouch`); - // event.stopPropagation(); TODO + event.stopPropagation(); } } diff --git a/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets b/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets index ba84a243..185e8e24 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets +++ b/features/managementcomponent/src/main/ets/com/ohos/view/component/itemComponent.ets @@ -17,7 +17,7 @@ import ConfigData from '../../common/constants'; @Component export default struct ItemComponent { @Link title: Resource; - @State value: string = ''; + @Link value: ResourceStr; @Link arrow: Resource; build() { diff --git a/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts b/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts index 089c1419..0709dd5c 100644 --- a/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts +++ b/features/managementcomponent/src/main/ets/com/ohos/vm/noDisturbComponentViewModel.ts @@ -27,7 +27,7 @@ export default class NoDisturbComponentViewModel { startTime = ''; endTime = ''; repeatMode = 0; - repeatName: any = ''; + repeatName: Resource | string = ''; prompt = ''; isEffective = true; nextDayLabel = ''; diff --git a/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts b/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts index 3f1242d0..b77c86ae 100644 --- a/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts +++ b/features/ringmodecomponent/src/main/ets/com/ohos/model/RingModeService.ts @@ -31,14 +31,14 @@ export class RingModeService { mListeners = new Set(); mAudioManager: any; - startService(): void { + async startService(): Promise { if (this.mIsStart) { return; } Log.showInfo(TAG, 'startService'); this.mIsStart = true; - this.mAudioManager = getAudioManager(); + this.mAudioManager = await getAudioManager().getVolumeManager().getVolumeGroupManager(audio.DEFAULT_VOLUME_GROUP_ID); this.getRingerMode(); diff --git a/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets b/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets index 1cc894c2..56d761e9 100644 --- a/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets +++ b/features/statusbarcomponent/src/main/ets/com/ohos/pages/IconItemComponent.ets @@ -133,7 +133,7 @@ export default struct IconItemComponent { onIconItemTouch(event: TouchEvent) { Log.showInfo(TAG, `onIconItemTouch, event: ${JSON.stringify(event)}`); if (this.mItemData.get()?.actionData?.clickAction || this.mItemData.get()?.actionData?.longClickAction) { - // event.stopPropagation() + event.stopPropagation() } } } \ No newline at end of file diff --git a/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts b/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts index b7ae6b05..c9b6ce0f 100644 --- a/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts +++ b/product/default/navigationBar/src/main/ets/viewmodel/NavigationBarViewModel.ts @@ -160,17 +160,19 @@ export default class NavigationBarViewModel { private windowSwitches(navigationBarStatusValue: string): void { this.isDisplay = navigationBarStatusValue == '1' ? true : false; - if (!this.isDisplay) { + if (!this.isDisplay || !this.mNavigationBarComponentData.isEnable) { //For gesture navigation scenarios //Systemui hides the navigation bar,and then notifies the launcher that it can start moving down the dock bar. WindowManager.hideWindow(WindowType.NAVIGATION_BAR).then(() => { - commonEvent.publish(NAVIGATIONBAR_HIDE_EVENT, (err) => { - if (err.code) { - Log.showError(TAG, `${NAVIGATIONBAR_HIDE_EVENT} PublishCallBack err: ${JSON.stringify(err)}`); - } else { - Log.showInfo(TAG, `${NAVIGATIONBAR_HIDE_EVENT} Publish sucess`); - } - }) + if(!this.isDisplay){ + commonEvent.publish(NAVIGATIONBAR_HIDE_EVENT, (err) => { + if (err.code) { + Log.showError(TAG, `${NAVIGATIONBAR_HIDE_EVENT} PublishCallBack err: ${JSON.stringify(err)}`); + } else { + Log.showInfo(TAG, `${NAVIGATIONBAR_HIDE_EVENT} Publish sucess`); + } + }) + } }).catch((err) => { Log.showError(TAG, `${NAVIGATIONBAR_HIDE_EVENT} Publish catch err: ${JSON.stringify(err)}`); }); diff --git a/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets b/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets index dfa42721..7025f50e 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/noDisturb.ets @@ -30,7 +30,7 @@ const GROUP_REPEAT_MODE = 'repeatMode'; @Entry @Component export default struct NoDisturb { - @State mViewModel: ViewModel = new ViewModel(); + @State@Watch("onChange") mViewModel: ViewModel = new ViewModel(); @State headName:Resource = $r('app.string.noDisturb'); @State repeatTitle:Resource = $r('app.string.repeat'); @State startDateTitle:Resource = $r('app.string.startDate'); @@ -38,9 +38,22 @@ export default struct NoDisturb { @State startTitle:Resource = $r('app.string.startTime'); @State endTitle:Resource = $r('app.string.endTime'); @State arrow: Resource = $r('app.media.ic_settings_arrow'); - @State mRefreshCnt: number = 0; + @State repeatName : ResourceStr = this.mViewModel.repeatName + @State startDateClue : string = this.mViewModel.startDateClue + @State startTimeClue : string = this.mViewModel.startTimeClue + @State endDateClue : string = this.mViewModel.endDateClue + @State endTimeClue : string = this.mViewModel.endTimeClue mPrevData: string = ''; + onChange() { + this.repeatName = this.mViewModel.repeatName + this.startDateClue = this.mViewModel.startDateClue + this.startTimeClue = this.mViewModel.startTimeClue + this.endDateClue = this.mViewModel.endDateClue + this.endTimeClue = this.mViewModel.endTimeClue + Log.showInfo(TAG, `mViewModel onChange repeatName: ${this.mViewModel.repeatName} startDateClue: ${this.mViewModel.startDateClue} + endDateClue: ${this.mViewModel.endDateClue} endTimeClue: ${this.mViewModel.endTimeClue}`) + } startDateDialogController: CustomDialogController = new CustomDialogController({ builder: DateDialog({ action:(data)=> this.setStartDate(data), @@ -109,11 +122,10 @@ export default struct NoDisturb { Row() { Column() { HeadComponent({ headName: $headName, isActive: true }) - if (this.mRefreshCnt > 0) { Row() { ItemComponent({ title: $repeatTitle, - value: this.mViewModel.repeatName, + value: $repeatName, arrow: $arrow }) }.onClick(() => { @@ -126,7 +138,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $startDateTitle, - value: this.mViewModel.startDateClue, + value: $startDateClue, arrow: $arrow }) }.onClick(() => { @@ -137,7 +149,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $startTitle, - value: this.mViewModel.startTimeClue, + value: $startTimeClue, arrow: $arrow }) }.onClick(() => { @@ -162,7 +174,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $endDateTitle, - value: this.mViewModel.endDateClue, + value: $endDateClue, arrow: $arrow }) }.onClick(() => { @@ -173,7 +185,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $endTitle, - value: this.mViewModel.endTimeClue, + value: $endTimeClue, arrow: $arrow }) }.onClick(() => { @@ -197,7 +209,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $startTitle, - value: this.mViewModel.startTimeClue, + value: $startTimeClue, arrow: $arrow }) }.onClick(() => { @@ -207,7 +219,7 @@ export default struct NoDisturb { Row() { ItemComponent({ title: $endTitle, - value: this.mViewModel.endTimeClue, + value: $endTimeClue, arrow: $arrow }) }.onClick(() => { @@ -215,7 +227,6 @@ export default struct NoDisturb { this.endTimeDialogController.open() }).margin({ bottom: $r('app.float.itemComp_margin_b')}) } - } } .width(ConfigData.WH_100_100) .height(ConfigData.WH_100_100) @@ -241,12 +252,10 @@ export default struct NoDisturb { setRepeatMode(data: number) { this.mViewModel.onRepeatModeAccect(data); - this.mRefreshCnt++; } setStartDate(data: string) { let dataSource = this.mViewModel.setDateIntoDateTime(this.mViewModel.defaultStartTime, data); this.mViewModel.onStartTimeAccept(dataSource); - this.mRefreshCnt++; } setStartTime(data: string) { let dataSource = data; @@ -256,12 +265,10 @@ export default struct NoDisturb { dataSource = this.mPrevData; } this.mViewModel.onStartTimeAccept(dataSource); - this.mRefreshCnt++; } setEndDate(data: string) { let dataSource = this.mViewModel.setDateIntoDateTime(this.mViewModel.defaultEndTime, data); this.mViewModel.onEndTimeAccept(dataSource); - this.mRefreshCnt++; } setEndTime(data: string) { let dataSource = data; @@ -271,15 +278,12 @@ export default struct NoDisturb { dataSource = this.mPrevData; } this.mViewModel.onEndTimeAccept(dataSource); - this.mRefreshCnt++; } aboutToAppear(): void{ Log.showInfo(TAG, `aboutToAppear`) this.mViewModel.viewModelInit() - this.mRefreshCnt++; - } onBackPress() { diff --git a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets index 1353f9f2..bd1cac65 100644 --- a/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets +++ b/product/default/notificationmanagement/src/main/ets/pages/notificationManagenment.ets @@ -36,6 +36,7 @@ export default struct notificationManagenment { @State headName: Resource = $r('app.string.notification') @State title: Resource = $r('app.string.batch_Management') @State arrow: Resource= $r('app.media.ic_settings_arrow') + @State itemStr: string = '' @State allowDistribut: Resource = $r('app.string.allowDistribut') @State allowDistributDescribe: Resource = $r('app.string.allowDistributDescribe') @@ -143,7 +144,7 @@ export default struct notificationManagenment { .padding({ left: $r('sys.float.ohos_id_default_padding_start') }) Row() { - ItemComponent({ title: $title, value: '', arrow: $arrow }) + ItemComponent({ title: $title, value: $itemStr, arrow: $arrow }) }.onClick(() => { Log.showDebug(TAG, `BatchManagement on click`) Router.push({ uri: 'pages/batchSetEnable' }); diff --git a/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts b/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts index b20d7c03..21a2e1a8 100644 --- a/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts +++ b/product/default/notificationmanagement/src/main/ets/vm/noDisturbViewModel.ts @@ -22,6 +22,7 @@ import FeaturesConfigData, {DoNotDisturbType} from '../../../../../../../feature const TAG = 'NotificationManagement-NoDisturbViewModel'; const CONST_DAY_LENGTH = 24*3600*1000; +@Observed export default class NoDisturbViewModel extends NoDisturbComponentViewModel { startDateClue = ''; diff --git a/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts index 3ed6b4bf..74446999 100644 --- a/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ b/product/default/volumepanel/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts @@ -66,6 +66,7 @@ class ServiceExtAbility extends ServiceExtension { height: configInfo.height, }); }).then(() => { + Log.showInfo(TAG, `Spike ==> ${JSON.stringify(volumeRect)}`); WindowManager.resetSizeWindow(WindowType.VOLUME_PANEL, volumeRect); }).catch((err) => { }); diff --git a/product/pc/controlpanel/src/main/ets/pages/index.ets b/product/pc/controlpanel/src/main/ets/pages/index.ets index d10bf40c..e76fea85 100644 --- a/product/pc/controlpanel/src/main/ets/pages/index.ets +++ b/product/pc/controlpanel/src/main/ets/pages/index.ets @@ -158,7 +158,7 @@ struct Index { if (windowInfo) { windowInfo.visibility ? this.hideWindow() - : WindowManager.showWindow(WindowType.CONTROL_PANEL); + : this.showWindow(); } }) ); diff --git a/product/pc/notificationpanel/src/main/ets/pages/index.ets b/product/pc/notificationpanel/src/main/ets/pages/index.ets index cfd9129e..4cf8c2c2 100644 --- a/product/pc/notificationpanel/src/main/ets/pages/index.ets +++ b/product/pc/notificationpanel/src/main/ets/pages/index.ets @@ -126,7 +126,7 @@ struct Index { if (windowInfo) { windowInfo.visibility ? this.hideWindow() - : WindowManager.showWindow(WindowType.NOTIFICATION_PANEL); + : this.showWindow(); } }) ); diff --git a/product/phone/dropdownpanel/src/main/module.json5 b/product/phone/dropdownpanel/src/main/module.json5 index 32b2ca1b..f3ad86fe 100644 --- a/product/phone/dropdownpanel/src/main/module.json5 +++ b/product/phone/dropdownpanel/src/main/module.json5 @@ -8,6 +8,12 @@ "deviceTypes": [ "default" ], + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "deliveryWithInstall": true, "installationFree": false, "uiSyntax": "ets", diff --git a/product/phone/statusbar/src/main/module.json5 b/product/phone/statusbar/src/main/module.json5 index adbb2868..2dd7de3f 100644 --- a/product/phone/statusbar/src/main/module.json5 +++ b/product/phone/statusbar/src/main/module.json5 @@ -8,6 +8,12 @@ "deviceTypes": [ "default" ], + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "deliveryWithInstall": true, "installationFree": false, "uiSyntax": "ets",