!284 代码同步至monthly

Merge pull request !284 from SEASON_SYSU/master
This commit is contained in:
openharmony_ci
2023-01-09 11:40:22 +00:00
committed by Gitee
20 changed files with 98 additions and 63 deletions
@@ -69,13 +69,13 @@ export default class TintStateManager {
Log.showDebug(TAG, `unregistser ${windowType}, res: ${res}`);
}
async onSystemBarTintChange(data): Promise<void> {
onSystemBarTintChange(data): Promise<void> {
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;
+6
View File
@@ -12,6 +12,12 @@
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"extensionAbilities": [
{
"visible": true,
+6
View File
@@ -12,6 +12,12 @@
"installationFree": false,
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"extensionAbilities": [
{
"visible": true,
@@ -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%')
@@ -310,7 +310,7 @@ export default struct SimpleToggleLayoutEditComponent {
onComponentTouch(event: TouchEvent) {
Log.showDebug(TAG, `onComponentTouch`);
// event.stopPropagation(); TODO
event.stopPropagation();
}
}
@@ -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')
@@ -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() {
@@ -27,7 +27,7 @@ export default class NoDisturbComponentViewModel {
startTime = '';
endTime = '';
repeatMode = 0;
repeatName: any = '';
repeatName: Resource | string = '';
prompt = '';
isEffective = true;
nextDayLabel = '';
@@ -31,14 +31,14 @@ export class RingModeService {
mListeners = new Set<RingModeStatusListener>();
mAudioManager: any;
startService(): void {
async startService(): Promise<void> {
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();
@@ -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()
}
}
}
@@ -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)}`);
});
@@ -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() {
@@ -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' });
@@ -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 = '';
@@ -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) => {
});
@@ -158,7 +158,7 @@ struct Index {
if (windowInfo) {
windowInfo.visibility
? this.hideWindow()
: WindowManager.showWindow(WindowType.CONTROL_PANEL);
: this.showWindow();
}
})
);
@@ -126,7 +126,7 @@ struct Index {
if (windowInfo) {
windowInfo.visibility
? this.hideWindow()
: WindowManager.showWindow(WindowType.NOTIFICATION_PANEL);
: this.showWindow();
}
})
);
@@ -147,8 +147,6 @@ struct Index {
return
}
StatusBarVM.setUseInWindowName(WindowType.DROPDOWN_PANEL)
this.componentOptAreaTranslateY = '0px'
this.backgroundOpacity = 1
Trace.end(Trace.CORE_METHOD_START_DROPDOWNPANEL)
}
@@ -254,6 +252,8 @@ struct Index {
Log.showDebug(TAG, `showSelf, showComponentName: ${showComponentName}`)
this.showComponentName = showComponentName
WindowManager.showWindow(WindowType.DROPDOWN_PANEL)
this.componentOptAreaTranslateY = '0px'
this.backgroundOpacity = 1
Trace.start(Trace.CORE_METHOD_START_DROPDOWNPANEL)
}
@@ -8,6 +8,12 @@
"deviceTypes": [
"default"
],
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"deliveryWithInstall": true,
"installationFree": false,
"uiSyntax": "ets",
@@ -8,6 +8,12 @@
"deviceTypes": [
"default"
],
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"deliveryWithInstall": true,
"installationFree": false,
"uiSyntax": "ets",