diff --git a/display/entry/src/main/ets/pages/ConfirmDialog.ets b/display/entry/src/main/ets/pages/ConfirmDialog.ets index e4c67dc9b1ea6bce13c2aa152e393e9ef6c57eb2..d9a163fce6edfb7ea15c1995ff63a41b5c9090e8 100644 --- a/display/entry/src/main/ets/pages/ConfirmDialog.ets +++ b/display/entry/src/main/ets/pages/ConfirmDialog.ets @@ -60,7 +60,7 @@ struct ConfirmCustomDialog { @State selectedAppDataList: AppSendData[] = []; @State isFoldable: boolean = display.isFoldable(); @State isFolded: display.FoldStatus = display.getFoldStatus(); - @State displayImpl: display.Display = display.getDefaultDisplaySync(); + @State mLocalHeight: number = display.getDefaultDisplaySync().height; @State currentOrientation: window.Orientation = window.Orientation.UNSPECIFIED; @State marginValue: number = 0; @State fontSizeScale: number = AppStorage.get('fontSizeScale') as number; @@ -68,7 +68,7 @@ struct ConfirmCustomDialog { @State isPC: boolean = false; @State isTablet: boolean = false; @State isCar: boolean = false; - @State fontSize: string = ''; + @State fontSize: string = ''; @State textHeight: number = 0; @State scrollHeight: number = 0; @State buttonHeight: number = 0; @@ -98,7 +98,7 @@ struct ConfirmCustomDialog { this.updateOrientation(); this.getDeviceType(); this.appDataList = this.getAppDataList(); - + if (AppStorage.get('isProxyBind') != null) { this.isProxy = AppStorage.get('isProxyBind') as boolean; console.log('isProxy is ' + this.isProxy); @@ -268,13 +268,13 @@ struct ConfirmCustomDialog { this.marginValue = 0; } else if (this.fontSizeScale === 1.75) { this.fontSize = '35vp'; - this.marginValue = 16; + this.marginValue = 5; } else if (this.fontSizeScale === 2) { this.fontSize = '40vp'; - this.marginValue = 20; + this.marginValue = 9; } else if (this.fontSizeScale === 3.2) { this.fontSize = '40vp'; - this.marginValue = 24; + this.marginValue = 13; } } @@ -322,7 +322,7 @@ struct ConfirmCustomDialog { ); } console.log('The currently selected data:', this.selectedAppDataList); -} + } getImages(peerdeviceType: number): Resource { console.info('peerdeviceType is ' + peerdeviceType); @@ -405,7 +405,7 @@ struct ConfirmCustomDialog { .fontWeight(FontWeight.Bold) .fontColor($r('sys.color.ohos_id_color_text_primary')) .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) - .lineHeight(this.isTibetanLanguages() ? 22 : 23) + .lineHeight(this.isTibetanLanguages() ? 22 : 0) .textOverflow({ overflow: TextOverflow.None }) .width('auto') .maxLines(2) @@ -420,48 +420,48 @@ struct ConfirmCustomDialog { }) .accessibilityGroup(true) .accessibilityLevel('yes') - .width('100%') - Scroll(){ - Column(){ - Text(this.peerCustomDescription) - .textAlign(TextAlign.Center) - .fontColor($r('sys.color.font_primary')) - .fontSize($r('sys.float.Body_L')) - .width('100%') - .lineHeight(this.isTibetanLanguages() ? 22 : 0) - .margin({ - bottom: 12, left: 24, right: 24 - }) - .padding({ left: (this.isPC) ? 10 : 0, right: (this.isPC) ? 10 : 0 }) - .accessibilityGroup(true) - .accessibilityLevel('yes') - - Stack(){ - List({ space: 0 }) { - ForEach(this.appDataList, (app: AppData, index: number) => { - ListItem() { - Row() { - Column() { - Column() { - Text(app.hostPkgLabel) - .fontSize($r('sys.float.Body_L')) - .fontColor($r('sys.color.font_primary')) - .textAlign(TextAlign.Start) - .maxLines(2) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .width('100%') - } - .margin({ top: this.marginValue, bottom: 2 }) + Column() { + Scroll(){ + Column(){ + Text(this.peerCustomDescription) + .textAlign(TextAlign.Center) + .fontColor($r('sys.color.font_primary')) + .fontSize($r('sys.float.Body_L')) + .width('auto') + .lineHeight(this.isTibetanLanguages() ? 22 : 0) + .margin({ + bottom: 12, left: 12, right: 12 + }) + .padding({ left: (this.isPC) ? 10 : 0, right: (this.isPC) ? 10 : 0 }) + .accessibilityGroup(true) + .accessibilityLevel('yes') + + Stack(){ + List({ space: 0 }) { + ForEach(this.appDataList, (app: AppData, index: number) => { + ListItem() { + Row() { Column() { - Text(app.bundleInfo) - .fontSize($r('sys.float.Body_M')) - .fontColor($r('sys.color.font_secondary')) - .textAlign(TextAlign.Start) - .width('100%') + Column() { + Text(app.hostPkgLabel) + .fontSize($r('sys.float.Body_L')) + .fontColor($r('sys.color.font_primary')) + .textAlign(TextAlign.Start) + .maxLines(2) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .width('100%') + } + .margin({ top: this.marginValue, bottom: 2 }) + Column() { + Text(app.bundleInfo) + .fontSize($r('sys.float.Body_M')) + .fontColor($r('sys.color.font_secondary')) + .textAlign(TextAlign.Start) + .width('100%') + } + .margin({ bottom: this.marginValue }) } - .margin({ bottom: this.marginValue }) - } .layoutWeight(1) .padding({ right: 8 @@ -472,47 +472,48 @@ struct ConfirmCustomDialog { top: index === 0 ? 4 : 0, bottom: index === (this.appDataList.length - 1) ? 4 : 0 }) - - Checkbox({ name: app.hostPkgLabel, }) - .select(this.selectedAppDataList.some(item => item.bundleName === app.bundleName)) - .shape(CheckBoxShape.CIRCLE) - .size({ width: 20, height: 20 }) - .onChange((checked: boolean) => { - this.toggleSelection(app, index, checked); - }) + + Checkbox({ name: app.hostPkgLabel, }) + .select(this.selectedAppDataList.some(item => item.bundleName === app.bundleName)) + .shape(CheckBoxShape.CIRCLE) + .size({ width: 20, height: 20 }) + .onChange((checked: boolean) => { + this.toggleSelection(app, index, checked); + }) + } + .width('100%') + .padding({ top: 11, bottom: 11, left: 12, right: 12 }) } - .width('100%') - .padding({ top: 11, bottom: 11, left: 12, right: 12 }) - } - }, (app: AppData) => app.hostPkgLabel) + }, (app: AppData) => app.hostPkgLabel) + } + .borderRadius($r('sys.float.ohos_id_corner_radius_dialog')) + .backgroundColor($r('sys.color.comp_background_list_card')) + .width('100%') + .divider({ + strokeWidth: 1, + color: $r('sys.color.ohos_id_color_sub_background'), + startMargin: 12, + endMargin: 12 + }) + .edgeEffect(EdgeEffect.Spring) } - .margin({ bottom: 8 }) - .borderRadius($r('sys.float.ohos_id_corner_radius_dialog')) - .backgroundColor($r('sys.color.comp_background_list_card')) - .width('100%') - .divider({ - strokeWidth: 1, - color: $r('sys.color.ohos_id_color_sub_background'), - startMargin: 12, - endMargin: 12 - }) - .edgeEffect(EdgeEffect.Spring) } + .margin({ left: 12, right: 12 }) } + .onAreaChange((o, n) => { + this.scrollHeight = n.height as number; + console.info('**scrollHeight**:${this.scrollHeight}') + }) + .constraintSize({ + maxHeight: (this.columnHeight - this.symbolHeight - this.buttonHeight - this.textHeight - 81) + }) + .onAreaChange((o, n) => { + this.scrollHeight = n.height as number; + }) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) } - .onAreaChange((o, n) => { - this.scrollHeight = n.height as number; - console.info('**scrollHeight**:${this.scrollHeight}') - }) - .constraintSize({ - maxHeight: (this.columnHeight - this.symbolHeight - this.buttonHeight - this.textHeight - 73) - }) - .onAreaChange((o, n) => { - this.scrollHeight = n.height as number; - }) - .margin({ left: 12, right: 12 }) - .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.Off) + .margin({ bottom: 8}) Column() { Button($r('app.string.dm_allow_always')) @@ -535,10 +536,10 @@ struct ConfirmCustomDialog { }) .stateStyles({ pressed: { - .backgroundColor($r('sys.color.ohos_id_color_click_effect')) + .backgroundColor($r('sys.color.ohos_id_color_click_effect')) }, normal: { - .backgroundColor(this.isPC ? $r('sys.color.ohos_id_color_button_normal') : Color.Transparent) + .backgroundColor(this.isPC ? $r('sys.color.ohos_id_color_button_normal') : Color.Transparent) } }) .accessibilityGroup(true) @@ -622,7 +623,9 @@ struct ConfirmCustomDialog { bottom: this.isPC ? 16 : 8 }) } - .width(328) + .margin({ + left: 16, right: 16, + }) .height('auto') .clip(true) .backgroundColor($r('sys.color.mask_fourth')) @@ -640,7 +643,7 @@ struct ConfirmCustomDialog { .fontWeight(FontWeight.Bold) .fontColor($r('sys.color.ohos_id_color_text_primary')) .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) - .lineHeight(this.isTibetanLanguages() ? 22 : 23) + .lineHeight(this.isTibetanLanguages() ? 22 : 0) .textOverflow({ overflow: TextOverflow.None }) .width('auto') .maxLines(2) @@ -755,7 +758,7 @@ struct ConfirmCustomDialog { }) .accessibilityGroup(true) .accessibilityLevel('yes') - + Button($r('app.string.dm_allow_this_time')) .margin({ bottom: 4, right: 4, left: 4 }) .padding({ top: 8, bottom: 8 }) @@ -786,7 +789,7 @@ struct ConfirmCustomDialog { .accessibilityLevel('yes') Button($r('app.plural.dm_not_allow', this.secondsNum, this.secondsNum)) - .margin({ bottom: 4, right: 4, left: 4 }) + .margin({ bottom: 8, right: 4, left: 4 }) .padding({ top: 8, bottom: 8 }) .type(ButtonType.ROUNDED_RECTANGLE) .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) @@ -824,15 +827,15 @@ struct ConfirmCustomDialog { }) .accessibilityGroup(true) .accessibilityLevel('yes') - } } + .margin({ left: 12, right: 12 }) + } .layoutWeight(1) .constraintSize({ maxHeight: 'auto' }) - .margin({ left: 12, right: 12 }) .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.Off) + .scrollBar(BarState.On) } .width(400) .height(266) @@ -852,7 +855,7 @@ struct ConfirmCustomDialog { .fontWeight(FontWeight.Bold) .fontColor($r('sys.color.ohos_id_color_text_primary')) .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) - .lineHeight(this.isTibetanLanguages() ? 22 : 23) + .lineHeight(this.isTibetanLanguages() ? 22 : 0) .textOverflow({ overflow: TextOverflow.None }) .width('auto') .maxLines(2) @@ -867,94 +870,95 @@ struct ConfirmCustomDialog { }) .accessibilityGroup(true) .accessibilityLevel('yes') - .width('100%') - Scroll() { - Column() { - Text(this.peerCustomDescription) - .textAlign(TextAlign.Center) - .fontColor($r('sys.color.font_primary')) - .fontSize($r('sys.float.Body_L')) - .width('100%') - .lineHeight(this.isTibetanLanguages() ? 22 : 0) - .margin({ - bottom: 12, left: 24, right: 24 - }) - .accessibilityGroup(true) - .accessibilityLevel('yes') - Stack() { - List({ space: 0 }) { - ForEach(this.appDataList, (app: AppData, index: number) => { - ListItem() { - Row() { - Column() { - Column() { - Text(app.hostPkgLabel) - .fontSize($r('sys.float.Body_L')) - .fontColor($r('sys.color.font_primary')) - .textAlign(TextAlign.Start) - .maxLines(2) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .width('100%') - } - .margin({ top: this.marginValue, bottom: 2 }) + Column() { + Scroll() { + Column() { + Text(this.peerCustomDescription) + .textAlign(TextAlign.Center) + .fontColor($r('sys.color.font_primary')) + .fontSize($r('sys.float.Body_L')) + .width('auto') + .lineHeight(this.isTibetanLanguages() ? 22 : 0) + .margin({ + bottom: 12, left: 24, right: 24 + }) + .accessibilityGroup(true) + .accessibilityLevel('yes') + Stack() { + List({ space: 0 }) { + ForEach(this.appDataList, (app: AppData, index: number) => { + ListItem() { + Row() { Column() { - Text(app.bundleInfo) - .fontSize($r('sys.float.Body_M')) - .fontColor($r('sys.color.font_secondary')) - .textAlign(TextAlign.Start) - .width('100%') + Column() { + Text(app.hostPkgLabel) + .fontSize($r('sys.float.Body_L')) + .fontColor($r('sys.color.font_primary')) + .textAlign(TextAlign.Start) + .maxLines(2) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .width('100%') + } + .margin({ top: this.marginValue, bottom: 2 }) + Column() { + Text(app.bundleInfo) + .fontSize($r('sys.float.Body_M')) + .fontColor($r('sys.color.font_secondary')) + .textAlign(TextAlign.Start) + .width('100%') + } + .margin({ bottom: this.marginValue }) } - .margin({ bottom: this.marginValue }) + .layoutWeight(1) + .padding({ + right: 8 + }) + .accessibilityGroup(true) + .accessibilityLevel('yes') + .margin({ + top: index === 0 ? 4 : 0, + bottom: index === (this.appDataList.length - 1) ? 4 : 0 + }) + + Checkbox({ name: app.hostPkgLabel, }) + .select(this.selectedAppDataList.some(item => item.bundleName === app.bundleName)) + .shape(CheckBoxShape.CIRCLE) + .size({ width: 20, height: 20 }) + .onChange((checked: boolean) => { + this.toggleSelection(app, index, checked); + }) } - .layoutWeight(1) - .padding({ - right: 8 - }) - .accessibilityGroup(true) - .accessibilityLevel('yes') - .margin({ - top: index === 0 ? 4 : 0, - bottom: index === (this.appDataList.length - 1) ? 4 : 0 - }) - - Checkbox({ name: app.hostPkgLabel, }) - .select(this.selectedAppDataList.some(item => item.bundleName === app.bundleName)) - .shape(CheckBoxShape.CIRCLE) - .size({ width: 20, height: 20 }) - .onChange((checked: boolean) => { - this.toggleSelection(app, index, checked); - }) + .width('100%') + .padding({ top: 11, bottom: 11, left: 12, right: 12 }) } - .width('100%') - .padding({ top: 11, bottom: 11, left: 12, right: 12 }) - } - }, (app: AppData) => app.hostPkgLabel) + }, (app: AppData) => app.hostPkgLabel) + } + .borderRadius($r('sys.float.ohos_id_corner_radius_dialog')) + .backgroundColor($r('sys.color.comp_background_list_card')) + .width('100%') + .divider({ + strokeWidth: 1, + color: $r('sys.color.ohos_id_color_sub_background'), + startMargin: 24, + endMargin: 24 + }) + .edgeEffect(EdgeEffect.Spring) } - .margin({ bottom: 8 }) - .borderRadius($r('sys.float.ohos_id_corner_radius_dialog')) - .backgroundColor($r('sys.color.comp_background_list_card')) - .width('100%') - .divider({ - strokeWidth: 1, - color: $r('sys.color.ohos_id_color_sub_background'), - startMargin: 24, - endMargin: 24 - }) - .edgeEffect(EdgeEffect.Spring) } + .margin({ left: 12, right: 12 }) } + .onAreaChange((o, n) => { + this.scrollHeight = n.height as number; + console.info('**scrollHeight**:${this.scrollHeight}') + }) + .constraintSize({ + maxHeight: (this.columnHeight - this.symbolHeight - this.buttonHeight - this.textHeight - 81) + }) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) } - .onAreaChange((o, n) => { - this.scrollHeight = n.height as number; - console.info('**scrollHeight**:${this.scrollHeight}') - }) - .constraintSize({ - maxHeight: (this.columnHeight - this.symbolHeight - this.buttonHeight - this.textHeight - 73) - }) - .margin({ left: 12, right: 12 }) - .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.Off) + .margin({ bottom: 8}) Column() { Button($r('app.string.dm_allow_always')) @@ -1082,9 +1086,9 @@ struct ConfirmCustomDialog { .fontWeight(FontWeight.Bold) .fontColor($r('sys.color.ohos_id_color_text_primary')) .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) - .lineHeight(this.isTibetanLanguages() ? 22 : 23) + .lineHeight(this.isTibetanLanguages() ? 22 : 0) .textOverflow({ overflow: TextOverflow.None }) - .width('100%') + .width('auto') .maxLines(2) } .onAreaChange((o, n) => { @@ -1097,96 +1101,96 @@ struct ConfirmCustomDialog { }) .accessibilityGroup(true) .accessibilityLevel('yes') - .width('100%') - - Scroll(){ - Column(){ - Text(this.peerCustomDescription) - .textAlign(TextAlign.Center) - .fontColor($r('sys.color.font_primary')) - .fontSize($r('sys.float.Body_L')) - .width('100%') - .lineHeight(this.isTibetanLanguages() ? 22 : 0) - .margin({ - bottom: 12, left: 24, right: 24 - }) - .padding({ left: (this.isPC) ? 10 : 0, right: (this.isPC) ? 10 : 0 }) - .accessibilityGroup(true) - .accessibilityLevel('yes') - Stack(){ - List({ space: 0 }) { - ForEach(this.appDataList, (app: AppData, index: number) => { - ListItem() { - Row() { - Column() { - Column() { - Text(app.hostPkgLabel) - .fontSize($r('sys.float.Body_L')) - .fontColor($r('sys.color.font_primary')) - .textAlign(TextAlign.Start) - .maxLines(2) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .width('100%') - } - .margin({ top: this.marginValue, bottom: 2 }) + Column() { + Scroll(){ + Column(){ + Text(this.peerCustomDescription) + .textAlign(TextAlign.Center) + .fontColor($r('sys.color.font_primary')) + .fontSize($r('sys.float.Body_L')) + .width('auto') + .lineHeight(this.isTibetanLanguages() ? 22 : 0) + .margin({ + bottom: 12, left: 12, right: 12 + }) + .accessibilityGroup(true) + .accessibilityLevel('yes') + + Stack(){ + List({ space: 0 }) { + ForEach(this.appDataList, (app: AppData, index: number) => { + ListItem() { + Row() { Column() { - Text(app.bundleInfo) - .fontSize($r('sys.float.Body_M')) - .fontColor($r('sys.color.font_secondary')) - .textAlign(TextAlign.Start) - .width('100%') + Column() { + Text(app.hostPkgLabel) + .fontSize($r('sys.float.Body_L')) + .fontColor($r('sys.color.font_primary')) + .textAlign(TextAlign.Start) + .maxLines(2) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .width('100%') + } + .margin({ top: this.marginValue, bottom: 2 }) + Column() { + Text(app.bundleInfo) + .fontSize($r('sys.float.Body_M')) + .fontColor($r('sys.color.font_secondary')) + .textAlign(TextAlign.Start) + .width('100%') + } + .margin({ bottom: this.marginValue }) } - .margin({ bottom: this.marginValue }) - } - .layoutWeight(1) - .padding({ - right: 8 - }) - .accessibilityGroup(true) - .accessibilityLevel('yes') - .margin({ - top: index === 0 ? 4 : 0, - bottom: index === (this.appDataList.length - 1) ? 4 : 0 - }) - - Checkbox({ name: app.hostPkgLabel, }) - .select(this.selectedAppDataList.some(item => item.bundleName === app.bundleName)) - .shape(CheckBoxShape.CIRCLE) - .size({ width: 20, height: 20 }) - .onChange((checked: boolean) => { - this.toggleSelection(app, index, checked); + .layoutWeight(1) + .padding({ + right: 8 }) + .accessibilityGroup(true) + .accessibilityLevel('yes') + .margin({ + top: index === 0 ? 4 : 0, + bottom: index === (this.appDataList.length - 1) ? 4 : 0 + }) + + Checkbox({ name: app.hostPkgLabel, }) + .select(this.selectedAppDataList.some(item => item.bundleName === app.bundleName)) + .shape(CheckBoxShape.CIRCLE) + .size({ width: 20, height: 20 }) + .onChange((checked: boolean) => { + this.toggleSelection(app, index, checked); + }) + } + .width('100%') + .padding({ top: 11, bottom: 11, left: 12, right: 12 }) } - .width('100%') - .padding({ top: 11, bottom: 11, left: 12, right: 12 }) - } - }, (app: AppData) => app.hostPkgLabel) + }, (app: AppData) => app.hostPkgLabel) + } + .borderRadius($r('sys.float.ohos_id_corner_radius_dialog')) + .backgroundColor($r('sys.color.comp_background_list_card')) + .width('100%') + .divider({ + strokeWidth: 1, + color: $r('sys.color.ohos_id_color_sub_background'), + startMargin: 12, + endMargin: 12 + }) + .edgeEffect(EdgeEffect.Spring) } - .margin({ bottom: 8 }) - .borderRadius($r('sys.float.ohos_id_corner_radius_dialog')) - .backgroundColor($r('sys.color.comp_background_list_card')) - .width('100%') - .divider({ - strokeWidth: 1, - color: $r('sys.color.ohos_id_color_sub_background'), - startMargin: 12, - endMargin: 12 - }) - .edgeEffect(EdgeEffect.Spring) } + .margin({ left: 12, right: 12 }) } + .constraintSize({ + maxHeight: (this.columnHeight - this.symbolHeight - this.buttonHeight - this.textHeight - 82) + }) + .onAreaChange((o, n) => { + this.scrollHeight = n.height as number; + console.info(`**scrollHeight**:${this.scrollHeight}`) + }) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) } - .constraintSize({ - maxHeight: (this.columnHeight - this.symbolHeight - this.buttonHeight - this.textHeight - 74) - }) - .onAreaChange((o, n) => { - this.scrollHeight = n.height as number; - console.info(`**scrollHeight**:${this.scrollHeight}`) - }) - .margin({ left: (this.isPC) ? 16 : 12, right: (this.isPC) ? 16 : 12 }) - .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.Off) + .margin({ bottom: 8 }) Column() { Button($r('app.string.dm_allow_always')) @@ -1285,7 +1289,7 @@ struct ConfirmCustomDialog { }) .accessibilityGroup(true) .accessibilityLevel('yes') - } + } .onAreaChange((o, n) => { this.buttonHeight = n.height as number; console.info(`**buttonHeight**:${this.buttonHeight}`) @@ -1296,7 +1300,9 @@ struct ConfirmCustomDialog { bottom: this.isPC ? 16 : 8 }) } - .width(328) + .margin({ + left: 16, right: 16, + }) .height('auto') .clip(true) .backgroundColor($r('sys.color.mask_fourth')) @@ -1314,7 +1320,7 @@ struct ConfirmCustomDialog { .fontWeight(FontWeight.Bold) .fontColor($r('sys.color.ohos_id_color_text_primary')) .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) - .lineHeight(this.isTibetanLanguages() ? 22 : 23) + .lineHeight(this.isTibetanLanguages() ? 22 : 0) .textOverflow({ overflow: TextOverflow.None }) .width('auto') .maxLines(2) @@ -1399,7 +1405,7 @@ struct ConfirmCustomDialog { }) .margin({ bottom: 4 }) .edgeEffect(EdgeEffect.Spring) - .scrollBar(BarState.On) + .scrollBar(BarState.Off) Button($r('app.string.dm_allow_always')) .margin({ top: 4, bottom: 4, right: 4, left: 4 }) @@ -1458,9 +1464,9 @@ struct ConfirmCustomDialog { }) .accessibilityGroup(true) .accessibilityLevel('yes') - + Button($r('app.plural.dm_not_allow', this.secondsNum, this.secondsNum)) - .margin({ bottom: 4, right: 4, left: 4 }) + .margin({ bottom: 8, right: 4, left: 4 }) .padding({ top: 8, bottom: 8 }) .type(ButtonType.ROUNDED_RECTANGLE) .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) @@ -1499,14 +1505,14 @@ struct ConfirmCustomDialog { .accessibilityGroup(true) .accessibilityLevel('yes') } + .margin({ left: 12, right: 12 }) } .layoutWeight(1) .constraintSize({ maxHeight: 'auto' }) - .margin({ left: 12, right: 12 }) .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.Off) + .scrollBar(BarState.On) } .width(400) .height(266) @@ -1526,7 +1532,7 @@ struct ConfirmCustomDialog { .fontWeight(FontWeight.Bold) .fontColor($r('sys.color.ohos_id_color_text_primary')) .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) - .lineHeight(this.isTibetanLanguages() ? 22 : 23) + .lineHeight(this.isTibetanLanguages() ? 22 : 0) .textOverflow({ overflow: TextOverflow.None }) .width('auto') .maxLines(2) @@ -1603,7 +1609,7 @@ struct ConfirmCustomDialog { normal: { .backgroundColor(this.isPC ? $r('sys.color.ohos_id_color_button_normal') : Color.Transparent) } - }) + }) Button($r('app.plural.dm_not_allow', this.secondsNum, this.secondsNum)) .margin({ left: 16, right: 16 }) .padding({ top: 8, bottom: 8 }) @@ -1657,8 +1663,8 @@ struct ConfirmCustomDialog { this.columnHeight = n.height as number; console.info(`**columnHeight**:${this.columnHeight}`) }) - .constraintSize({ maxHeight: '90%' }) - .height('100%') + .constraintSize({ maxHeight: (px2vp(this.mLocalHeight) - 28 - 39)*0.9 }) + .height('auto') } } @@ -1703,7 +1709,7 @@ struct dialogPlusPage { } onWillDismiss() { - console.log(TAG + 'onWillDismiss: ' + ACTION_CANCEL_AUTH) + console.log(TAG + 'onWillDismiss: ' + ACTION_CANCEL_AUTH) this.setUserOperation(ACTION_CANCEL_AUTH); this.destruction(); } @@ -1749,4 +1755,4 @@ struct dialogPlusPage { build() { Column(this.dialogController.open()) } -} \ No newline at end of file +}