去除多余嵌套

Signed-off-by: chenqi <chenqi144@huawei.com>
This commit is contained in:
chenqi 2022-09-26 16:18:45 +08:00
parent 005177b4b1
commit aeb2b14539
27 changed files with 414 additions and 489 deletions

View File

@ -35,18 +35,13 @@ struct AboutDevice {
Column() {
HeadComponent({ headName: $r('app.string.aboutTab'), isActive: true })
Row() {
SubEntryComponentWithEndText({
targetPage: "pages/deviceName",
title: $r("app.string.deviceName"),
endText: this.systemName
});
}
.width(ConfigData.WH_100_100)
.margin({
bottom: $r("app.float.distance_12"),
top: $r("app.float.distance_8")
SubEntryComponentWithEndText({
targetPage: "pages/deviceName",
title: $r("app.string.deviceName"),
endText: this.systemName
})
.width(ConfigData.WH_100_100)
.margin({ bottom: $r("app.float.distance_12"), top: $r("app.float.distance_8") })
List() {
ForEach(this.aboutDeviceList, (item) => {

View File

@ -37,19 +37,17 @@ struct AppManagement {
Column() {
HeadComponent({ headName: $r('app.string.appManagement'), isActive: true });
Column() {
ImageAnimatorComponent({
imageWidth: $r('app.float.wh_value_80'),
imageHeight: $r('app.float.wh_value_80'), whtl: this.whtl
});
}
.margin({ top: $r("app.float.distance_8") })
.zIndex(1)
.visibility(this.appList.length > 0 ? Visibility.None : Visibility.Visible)
.align(Alignment.Center)
.padding({ top: ConfigData.WH_35_100 })
.width(ConfigData.WH_100_100)
.height(ConfigData.WH_100_100);
ImageAnimatorComponent({
imageWidth: $r('app.float.wh_value_80'),
imageHeight: $r('app.float.wh_value_80'), whtl: this.whtl
})
.margin({ top: $r("app.float.distance_8") })
.zIndex(1)
.visibility(this.appList.length > 0 ? Visibility.None : Visibility.Visible)
.align(Alignment.Center)
.padding({ top: ConfigData.WH_35_100 })
.width(ConfigData.WH_100_100)
.height(ConfigData.WH_100_100);
Column() {
List() {

View File

@ -32,10 +32,8 @@ struct Application {
Column() {
HeadComponent({ headName: $r('app.string.applyTab'), isActive: true })
Column() {
SubEntryComponent({ targetPage: 'pages/appManagement', title: $r('app.string.appManagement') })
}
.margin({ top: $r("app.float.distance_8") })
SubEntryComponent({ targetPage: 'pages/appManagement', title: $r('app.string.appManagement') })
.margin({ top: $r("app.float.distance_8") })
}
.padding({
left: $r('sys.float.ohos_id_card_margin_start'),

View File

@ -65,18 +65,15 @@ struct ApplicationInfo {
Text(appInfo.settingTitle)
.fontColor($r('app.color.font_color_182431'))
.fontSize($r('app.float.font_16'))
.alignSelf(ItemAlign.Start)
.margin({ top: $r('app.float.wh_value_10'), bottom: $r('app.float.wh_value_5') })
Row() {
Text(appInfo.settingSummary)
.fontColor($r('app.color.font_color_182431'))
.fontSize($r('app.float.font_14'))
.maxLines(ConfigData.MAX_LINES_1)
.margin({ bottom: $r('app.float.distance_11') });
}
.alignSelf(ItemAlign.Start)
Text(appInfo.settingSummary)
.fontColor($r('app.color.font_color_182431'))
.fontSize($r('app.float.font_14'))
.maxLines(ConfigData.MAX_LINES_1)
.margin({ bottom: $r('app.float.distance_11') });
}
.alignItems(HorizontalAlign.Start)
.width(ConfigData.WH_100_100)
.height($r('app.float.wh_value_64'))
}

View File

@ -57,17 +57,14 @@ struct ApplicationStorage {
.fontSize($r('app.float.font_16'))
.maxLines(ConfigData.MAX_LINES_3)
.margin({ top: $r('app.float.wh_value_10'), bottom: $r('app.float.wh_value_5') })
.alignSelf(ItemAlign.Start);
Row() {
Text(appInfo.settingSummary)
.fontColor($r('app.color.font_color_182431'))
.fontSize($r('app.float.font_14'))
.maxLines(ConfigData.MAX_LINES_1)
.margin({ bottom: $r('app.float.distance_11') });
}
.alignSelf(ItemAlign.Start)
Text(appInfo.settingSummary)
.fontColor($r('app.color.font_color_182431'))
.fontSize($r('app.float.font_14'))
.maxLines(ConfigData.MAX_LINES_1)
.margin({ bottom: $r('app.float.distance_11') })
}
.alignItems(HorizontalAlign.Start)
.width(ConfigData.WH_100_100)
.height($r('app.float.wh_value_64'))
}
@ -77,31 +74,29 @@ struct ApplicationStorage {
SubHeader({ titleContent: $r('app.string.senior') })
// body
Row() {
List() {
ForEach(this.storageList, (item) => {
ListItem() {
EntryComponent({
settingIcon: '',
settingTitle: item.settingTitle,
settingSummary: item.settingSummary,
settingValue: item.settingValue,
settingArrow: item.settingArrow,
settingArrowStyle: '',
settingUri: '',
heights: $r('app.float.wh_value_48'),
fontSize: $r('app.float.font_16')
});
}
});
}
.divider({
strokeWidth: $r('app.float.divider_wh'),
color: $r('app.color.color_E3E3E3_grey'),
startMargin: $r('app.float.storage_common_margin'),
endMargin: $r('app.float.storage_common_margin')
})
List() {
ForEach(this.storageList, (item) => {
ListItem() {
EntryComponent({
settingIcon: '',
settingTitle: item.settingTitle,
settingSummary: item.settingSummary,
settingValue: item.settingValue,
settingArrow: item.settingArrow,
settingArrowStyle: '',
settingUri: '',
heights: $r('app.float.wh_value_48'),
fontSize: $r('app.float.font_16')
});
}
});
}
.divider({
strokeWidth: $r('app.float.divider_wh'),
color: $r('app.color.color_E3E3E3_grey'),
startMargin: $r('app.float.storage_common_margin'),
endMargin: $r('app.float.storage_common_margin')
})
.borderRadius($r("sys.float.ohos_id_corner_radius_default_l"))
.backgroundColor($r("app.color.white_bg_color"))

View File

@ -77,26 +77,23 @@ struct Bluetooth {
Blank()
Stack({ alignContent: Alignment.Start }) {
Toggle({ type: ToggleType.Switch, isOn: this.isOn })
.width('36vp')
.height('20vp')
.selectedColor('#007DFF')
.margin({ left: $r('app.float.wh_value_6') })
.onChange(() => {
LogUtil.log(this.PAGE_TAG + 'Toggle onClick: isOn = ' + this.isOn + ', enabled = ' + this.isEnabled)
if (!this.isEnabled) return;
this.deviceController.toggleValue(!this.isOn);
});
}
.width($r('app.float.wh_value_48'))
Toggle({ type: ToggleType.Switch, isOn: this.isOn })
.width('36vp')
.height('20vp')
.selectedColor('#007DFF')
.margin({ left: $r('app.float.wh_value_6') })
.onChange(() => {
LogUtil.log(this.PAGE_TAG + 'Toggle onClick: isOn = ' + this.isOn + ', enabled = ' + this.isEnabled)
if (!this.isEnabled) return;
this.deviceController.toggleValue(!this.isOn);
});
}
.margin({ top: $r("app.float.distance_8") })
.width(ConfigData.WH_100_100)
.height($r('app.float.wh_value_56'))
.backgroundColor($r("app.color.white_bg_color"))
.borderRadius($r('app.float.wh_value_28'))
.padding({ left: $r('app.float.wh_value_12'), right: $r('app.float.wh_value_12') })
.padding({ left: $r('app.float.wh_value_12'), right: $r('app.float.wh_value_6') })
.alignItems(VerticalAlign.Center)
.borderRadius($r('app.float.distance_24'))
@ -430,11 +427,9 @@ struct PairedDeviceComponent {
struct DiscoveringAnimatorComponent {
build() {
Column() {
Row() {
ImageAnimatorComponent({
imageWidth: $r('app.float.wh_value_24'),
imageHeight: $r('app.float.wh_value_24') })
}
ImageAnimatorComponent({
imageWidth: $r('app.float.wh_value_24'),
imageHeight: $r('app.float.wh_value_24') })
}
}
}
@ -548,15 +543,13 @@ struct AvailableDeviceComponent {
endMargin: $r('app.float.wh_value_12')
})
} else {
Row() {
// Scanning...
Text($r('app.string.scanning'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.textCase(TextCase.UpperCase)
.fontWeight(FontWeight.Medium)
.fontColor($r("sys.color.ohos_id_color_primary"))
}
.height($r('app.float.wh_value_48'))
// Scanning...
Text($r('app.string.scanning'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.textCase(TextCase.UpperCase)
.fontWeight(FontWeight.Medium)
.fontColor($r("sys.color.ohos_id_color_primary"))
.height($r('app.float.wh_value_48'))
}
}
}
@ -692,7 +685,6 @@ class AvailableDevicesDataSource extends BasicDataSource {
}
}
/**
* Pair dialog
*/

View File

@ -47,23 +47,21 @@ struct BluetoothPairedDeviceInfo {
Blank()
Row() {
Button() {
Text($r("app.string.cancelPairing"))
.fontSize($r('app.float.application_button_subtitle_size'))
.fontColor($r("app.color.font_color_007DFF"))
}
.backgroundColor($r('sys.color.ohos_id_color_button_normal'))
.width($r("app.float.component_button_width"))
.height($r("app.float.wh_value_40"))
.align(Alignment.Center)
.onClick(() => {
LogUtil.log(ConfigData.TAG + "unpair onClick");
if (this.controller.unpair(this.bluetoothDevice.deviceId)) {
Router.back();
}
})
Button() {
Text($r("app.string.cancelPairing"))
.fontSize($r('app.float.application_button_subtitle_size'))
.fontColor($r("app.color.font_color_007DFF"))
}
.backgroundColor($r('sys.color.ohos_id_color_button_normal'))
.width($r("app.float.component_button_width"))
.height($r("app.float.wh_value_40"))
.align(Alignment.Center)
.onClick(() => {
LogUtil.log(ConfigData.TAG + "unpair onClick");
if (this.controller.unpair(this.bluetoothDevice.deviceId)) {
Router.back();
}
})
.margin({ bottom: $r('app.float.distance_24'), top: $r("app.float.distance_8") });
}
.height(ConfigData.WH_100_100)

View File

@ -94,16 +94,14 @@ struct developerOptions {
Column() {
HeadComponent({ headName: $r("app.string.developerOptionsTab"), isActive: true });
Column() {
SwitchComponent({
title: $r("app.string.usbDebugging"),
summary: $r("app.string.locationServicesPromptInfo"),
isOn: $controllerDebugIsOn,
controller: this.controller,
switchHeight:$r("app.float.wh_value_72")
})
}
.margin({ top: $r("app.float.distance_8") })
SwitchComponent({
title: $r("app.string.usbDebugging"),
summary: $r("app.string.locationServicesPromptInfo"),
isOn: $controllerDebugIsOn,
controller: this.controller,
switchHeight: $r("app.float.wh_value_72")
})
.margin({ top: $r("app.float.distance_8") })
Column() {
List() {
@ -168,16 +166,14 @@ struct developerOptions {
bottom:$r("app.float.distance_4")
})
Column() {
SwitchComponent({
title: $r("app.string.Debug_GPU_OverDraw"),
summary: "",
isOn: $controllerOverdrawIsOn,
controller: this.controllerOverdraw,
switchHeight:$r("app.float.wh_value_56")
})
}
.margin({ top: $r("app.float.distance_12") })
SwitchComponent({
title: $r("app.string.Debug_GPU_OverDraw"),
summary: "",
isOn: $controllerOverdrawIsOn,
controller: this.controllerOverdraw,
switchHeight: $r("app.float.wh_value_56")
})
.margin({ top: $r("app.float.distance_12") })
}
.padding({
left: $r('sys.float.ohos_id_card_margin_start'),
@ -213,58 +209,53 @@ struct AnimationScalingInformation {
build() {
Column(){
Column() {
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
Text($r("app.string.Excessive_animation_scaling"))
.fontFamily("HarmonyHeiTi")
.fontSize($r("sys.float.ohos_id_text_size_headline8"))
.fontWeight(FontWeight.Medium)
}
.height($r("app.float.wh_value_56"))
Text($r("app.string.Excessive_animation_scaling"))
.fontFamily("HarmonyHeiTi")
.fontSize($r("sys.float.ohos_id_text_size_headline8"))
.fontWeight(FontWeight.Medium)
.height($r("app.float.wh_value_56"))
.alignSelf(ItemAlign.Start)
List() {
ForEach(this.AnimationMultiplier, (item, index) => {
ListItem() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Column() {
Text(item === "0" ? $r("app.string.Close_Animation") : $r("app.string.Animation_Multiplier", item))
.fontFamily("HarmonyHeiTi")
.fontSize($r("sys.float.ohos_id_text_size_body1"))
.fontWeight(FontWeight.Medium)
}
Text(item === "0" ? $r("app.string.Close_Animation") : $r("app.string.Animation_Multiplier", item))
.fontFamily("HarmonyHeiTi")
.fontSize($r("sys.float.ohos_id_text_size_body1"))
.fontWeight(FontWeight.Medium)
Row() {
Radio({ value: "", group: 'radioGroup' })
.checked(this.checked === this.AnimationMultiplier[index] ? true : false)
.height($r("app.float.wh_value_24"))
.width($r("app.float.wh_value_24"))
.onChange((value: boolean) => {
this.controller.close();
if (item === "0") {
this.AnimationText = $r("app.string.Close_Animation");
parameter.set(GRAPHIC_ANIMATION_SCALE_NAME, "0");
parameter.set(ARKUI_ANIMATION_SCALE_NAME, "0");
LogUtil.info(MODULE_TAG + "close animation success");
} else {
this.AnimationText = $r("app.string.Animation_Multiplier", item);
parameter.set(GRAPHIC_ANIMATION_SCALE_NAME, item)
.then(() => {
LogUtil.info(MODULE_TAG + "set graphic parameter success");
})
.catch((err) => {
LogUtil.info(MODULE_TAG + "catch graphic parameter error" + JSON.stringify(err));
})
Radio({ value: "", group: 'radioGroup' })
.checked(this.checked === this.AnimationMultiplier[index] ? true : false)
.height($r("app.float.wh_value_24"))
.width($r("app.float.wh_value_24"))
.onChange((value: boolean) => {
this.controller.close();
if (item === "0") {
this.AnimationText = $r("app.string.Close_Animation");
parameter.set(GRAPHIC_ANIMATION_SCALE_NAME, "0");
parameter.set(ARKUI_ANIMATION_SCALE_NAME, "0");
LogUtil.info(MODULE_TAG + "close animation success");
} else {
this.AnimationText = $r("app.string.Animation_Multiplier", item);
parameter.set(GRAPHIC_ANIMATION_SCALE_NAME, item)
.then(() => {
LogUtil.info(MODULE_TAG + "set graphic parameter success");
})
.catch((err) => {
LogUtil.info(MODULE_TAG + "catch graphic parameter error" + JSON.stringify(err));
})
parameter.set(ARKUI_ANIMATION_SCALE_NAME, item)
.then(() => {
LogUtil.info(MODULE_TAG + "set arkui parameter success");
})
.catch((err) => {
LogUtil.info(MODULE_TAG + "catch arkui parameter error" + JSON.stringify(err));
})
}
this.checked = item;
})
}
parameter.set(ARKUI_ANIMATION_SCALE_NAME, item)
.then(() => {
LogUtil.info(MODULE_TAG + "set arkui parameter success");
})
.catch((err) => {
LogUtil.info(MODULE_TAG + "catch arkui parameter error" + JSON.stringify(err));
})
}
this.checked = item;
})
}
.height($r("app.float.wh_value_48"))
}
@ -272,19 +263,16 @@ struct AnimationScalingInformation {
})
}
Column() {
Text($r("app.string.Cancel_Animation"))
.fontSize($r("sys.float.ohos_id_text_size_button1"))
.fontColor($r("sys.color.ohos_id_color_text_primary_activated"))
}
.justifyContent(FlexAlign.Center)
.width($r("app.float.cancel_animation_button_w_value"))
.height($r("app.float.wh_value_40"))
.margin({ top: $r("app.float.distance_8") })
.backgroundColor($r("app.color.white_bg_color"))
.onClick(() => {
this.controller.close();
})
Text($r("app.string.Cancel_Animation"))
.fontSize($r("sys.float.ohos_id_text_size_button1"))
.fontColor($r("sys.color.ohos_id_color_text_primary_activated"))
.alignSelf(ItemAlign.Center)
.width($r("app.float.cancel_animation_button_w_value"))
.height($r("app.float.wh_value_40"))
.margin({ top: $r("app.float.distance_8") })
.onClick(() => {
this.controller.close();
})
}
.padding({
left: $r("app.float.padding_24"),

View File

@ -32,11 +32,7 @@ struct LocationServices {
Column() {
HeadComponent({ headName: $r('app.string.locationServicesTab'), isActive: true });
Flex({
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceBetween,
alignItems: ItemAlign.Center
}) {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Text($r('app.string.positionInformation'))
.fontColor($r("app.color.font_color_182431"))
.fontStyle(FontStyle.Normal)

View File

@ -42,10 +42,12 @@ struct MoreConnections {
Column() {
HeadComponent({ headName: $r('app.string.moreConnectionsTab'), isActive: true });
Column(){
SubEntryComponentWithEndText({ targetPage:'pages/nfc', title: $r('app.string.NFC'), endText: this.nfcStatus ? $r("app.string.enabled") : $r("app.string.disabled") })
}
.margin({ top: $r("app.float.distance_8") })
SubEntryComponentWithEndText({
targetPage: 'pages/nfc',
title: $r('app.string.NFC'),
endText: this.nfcStatus ? $r("app.string.enabled") : $r("app.string.disabled")
})
.margin({ top: $r("app.float.distance_8") })
}
.padding({
left: $r('sys.float.ohos_id_card_margin_start'),

View File

@ -470,7 +470,8 @@ struct UserDialogBuilder {
SystemAccountController.switchUser(this.user.localId);
})
Divider().color($r("sys.color.ohos_id_color_list_separator"))
Divider()
.color($r("sys.color.ohos_id_color_list_separator"))
Text($r("app.string.removeUser"))
.fontSize($r("app.float.font_16"))
@ -615,7 +616,8 @@ struct AddUserDialog {
}
aboutToAppear() {
ResourceUtil.getString($r("app.string.nickname")).then(value => this.hintText = value);
ResourceUtil.getString($r("app.string.nickname"))
.then(value => this.hintText = value);
}
}

View File

@ -56,16 +56,14 @@ struct Nfc {
Blank()
Stack({ alignContent: Alignment.Start }) {
Toggle({ type: ToggleType.Switch, isOn: this.isNfcEnabled })
.width('36vp')
.height('20vp')
.selectedColor($r("app.color.toggle_selected_color_007DFF"))
.margin({ left: $r('app.float.wh_value_6') })
.onChange((isOn: boolean) => {
this.switchNfcActiveStatus();
});
}
Toggle({ type: ToggleType.Switch, isOn: this.isNfcEnabled })
.width('36vp')
.height('20vp')
.selectedColor($r("app.color.toggle_selected_color_007DFF"))
.margin({ left: $r('app.float.wh_value_6') })
.onChange((isOn: boolean) => {
this.switchNfcActiveStatus();
});
}
.width(ConfigData.WH_100_100)
.height($r('app.float.wh_value_56'))

View File

@ -167,10 +167,7 @@ struct PasswordCheck {
}
Divider()
.padding({
left: $r('sys.float.ohos_id_card_margin_start'),
right: $r('sys.float.ohos_id_card_margin_end')
})
.padding({ left: $r('sys.float.ohos_id_card_margin_start'), right: $r('sys.float.ohos_id_card_margin_end') })
.color($r("sys.color.ohos_id_color_list_separator"))
// prompt message

View File

@ -185,33 +185,31 @@ struct PasswordInput {
}
} else {
Column() {
Row() {
TextInput({ placeholder: '', text: this.password })
.width(ConfigData.WH_100_100)
.height(ConfigData.WH_100_100)
.placeholderFont({
size: $r("app.float.font_18"),
weight: FontWeight.Normal,
style: FontStyle.Normal
})
.type(InputType.Password)
.enterKeyType(EnterKeyType.Done)
.caretColor($r('sys.color.ohos_id_color_text_primary_activated'))
.borderRadius(0)
.layoutWeight(ConfigData.LAYOUT_WEIGHT_1)
.backgroundColor($r('app.color.color_00000000_transparent'))
.onChange(this.passwordOnChangeHandler)
.onSubmit((enterKey) => {
InputMethod.getInputMethodController().stopInput()
.then((ret) => {
LogUtil.debug(`${ConfigData.TAG}, enterType: ${enterKey}, stopInput: ${ret}`);
});
})
.onFocus(() => {
LogUtil.info(TAG + "text input is focused");
this.isFocused = true;
})
}
TextInput({ placeholder: '', text: this.password })
.width(ConfigData.WH_100_100)
.height(ConfigData.WH_100_100)
.placeholderFont({
size: $r("app.float.font_18"),
weight: FontWeight.Normal,
style: FontStyle.Normal
})
.type(InputType.Password)
.enterKeyType(EnterKeyType.Done)
.caretColor($r('sys.color.ohos_id_color_text_primary_activated'))
.borderRadius(0)
.layoutWeight(ConfigData.LAYOUT_WEIGHT_1)
.backgroundColor($r('app.color.color_00000000_transparent'))
.onChange(this.passwordOnChangeHandler)
.onSubmit((enterKey) => {
InputMethod.getInputMethodController().stopInput()
.then((ret) => {
LogUtil.debug(`${ConfigData.TAG}, enterType: ${enterKey}, stopInput: ${ret}`);
});
})
.onFocus(() => {
LogUtil.info(TAG + "text input is focused");
this.isFocused = true;
})
Divider()
}
@ -449,15 +447,13 @@ struct CheckText {
private checkMessage: string | Resource = '';
build() {
Row() {
Text(this.checkMessage ? this.checkMessage : $r('app.string.password_set_prompt'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontWeight(FontWeight.Medium)
.fontColor($r('sys.color.ohos_id_color_warning'))
.align(Alignment.Center)
.textAlign(TextAlign.Center)
}
.margin({ top: $r('app.float.distance_4'), bottom: $r('app.float.distance_24') })
Text(this.checkMessage ? this.checkMessage : $r('app.string.password_set_prompt'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontWeight(FontWeight.Medium)
.fontColor($r('sys.color.ohos_id_color_warning'))
.align(Alignment.Center)
.textAlign(TextAlign.Center)
.margin({ top: $r('app.float.distance_4'), bottom: $r('app.float.distance_24') })
}
}
@ -480,65 +476,59 @@ struct chooseUnlockMethodDialog {
build() {
Column() {
Row() {
Text(this.dialogTitle)
.height($r('app.float.wh_value_56'))
.margin({ left: $r('app.float.wh_value_24') })
.width(ConfigData.WH_100_100)
.fontSize($r('app.float.font_20'))
.fontColor($r("sys.color.ohos_id_color_primary"))
.fontWeight(500)
}
Text(this.dialogTitle)
.height($r('app.float.wh_value_56'))
.margin({ left: $r('app.float.wh_value_24') })
.width(ConfigData.WH_100_100)
.fontSize($r('app.float.font_20'))
.fontColor($r("sys.color.ohos_id_color_primary"))
.fontWeight(500)
Row() {
RadioListComponent({
dataList: this.dataList,
checkedValue: this.checkedValue,
showRadio: false,
onChange: (item: RadioListItem) => {
if (this.chosenAction != null) {
LogUtil.info(ConfigData.TAG + 'chooseUnlockMethodDialog : onCheckedAction : call back');
this.chosenAction(item.settingType);
}
this.closeDialog();
RadioListComponent({
dataList: this.dataList,
checkedValue: this.checkedValue,
showRadio: false,
onChange: (item: RadioListItem) => {
if (this.chosenAction != null) {
LogUtil.info(ConfigData.TAG + 'chooseUnlockMethodDialog : onCheckedAction : call back');
this.chosenAction(item.settingType);
}
this.closeDialog();
}
})
Text($r('app.string.cancel'))
.fontSize($r('app.float.application_button_subtitle_size'))
.fontColor($r('sys.color.ohos_id_color_focused_bg'))
.textAlign(TextAlign.Center)
.fontWeight(500)
.width(ConfigData.WH_100_100)
.height($r("app.float.wh_value_56"))
.margin({ top: $r("app.float.wh_value_6") })
.padding({ top: $r("app.float.wh_value_12"), bottom: $r("app.float.wh_value_6") })
.borderRadius($r('app.float.radius_20'))
.linearGradient(this.isTouched ? {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]]
} : {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]]
})
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.isTouched = true;
}
if (event.type === TouchType.Up) {
this.isTouched = false;
}
})
}
Column() {
Text($r('app.string.cancel'))
.fontSize($r('app.float.application_button_subtitle_size'))
.fontColor($r('sys.color.ohos_id_color_focused_bg'))
.textAlign(TextAlign.Center)
.fontWeight(500)
.width(ConfigData.WH_100_100)
.height($r("app.float.wh_value_56"))
.margin({ top: $r("app.float.wh_value_6") })
.padding({ top: $r("app.float.wh_value_12"), bottom: $r("app.float.wh_value_6") })
.borderRadius($r('app.float.radius_20'))
.linearGradient(this.isTouched ? {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]]
} : {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]]
})
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.isTouched = true;
}
if (event.type === TouchType.Up) {
this.isTouched = false;
}
})
.onClick(() => {
this.closeDialog();
});
}
.align(Alignment.Center);
.onClick(() => {
this.closeDialog();
})
.alignSelf(ItemAlign.Center)
}
}
}

View File

@ -125,7 +125,7 @@ struct PasswordSetting {
titleFontColor: $r("app.color.font_color_007DFF"),
heights: $r('app.float.password_list_item_height'),
fontSize: $r('app.float.font_16')
});
})
}
.width(ConfigData.WH_100_100)
.onClick(() => {
@ -151,7 +151,7 @@ struct PasswordSetting {
settingUri: item.settingUri,
heights: $r('app.float.password_list_item_height'),
fontSize: $r('app.float.font_16')
});
})
}
.width(ConfigData.WH_100_100)
.onClick(() => {

View File

@ -34,13 +34,10 @@ struct PrivacySettings {
Column() {
HeadComponent({ headName: $r('app.string.privacy'), isActive: true });
Column() {
PermissionComponent()
.margin({ bottom: $r('sys.float.ohos_id_card_margin_start') })
PermissionComponent()
.margin({ top: $r("app.float.distance_8"), bottom: $r('sys.float.ohos_id_card_margin_start') })
SubEntryComponent({ targetPage: 'pages/locationServices', title: $r('app.string.locationServicesTab') });
}
.margin({ top: $r("app.float.distance_8") })
SubEntryComponent({ targetPage: 'pages/locationServices', title: $r('app.string.locationServicesTab') });
}
.padding({
left: $r('sys.float.ohos_id_card_margin_start'),
@ -77,15 +74,13 @@ export struct PermissionComponent {
build() {
Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
Text($r('app.string.permissionManager'))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontColor($r('app.color.font_color_182431'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start);
}
Text($r('app.string.permissionManager'))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontColor($r('app.color.font_color_182431'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start);
Image('/res/image/ic_settings_arrow.svg')
.width($r('app.float.wh_value_12'))

View File

@ -32,19 +32,17 @@ struct restoreFactorySettings {
Column() {
HeadComponent({ headName: $r("app.string.resetPhone"), isActive: true });
Row() {
Text($r("app.string.resetPhonePromptInfo"))
.fontFamily('HarmonyHeiTi')
.fontWeight(FontWeight.Medium)
.fontSize($r("app.float.font_18"))
.align(Alignment.Start)
.margin({
left: $r('app.float.distance_12'),
right: $r("app.float.distance_18"),
top: $r("app.float.distance_24"),
})
}
.width(ConfigData.WH_100_100)
Text($r("app.string.resetPhonePromptInfo"))
.fontFamily('HarmonyHeiTi')
.fontWeight(FontWeight.Medium)
.fontSize($r("app.float.font_18"))
.align(Alignment.Start)
.margin({
left: $r('app.float.distance_12'),
right: $r("app.float.distance_18"),
top: $r("app.float.distance_24"),
})
.width(ConfigData.WH_100_100)
Blank()

View File

@ -130,15 +130,13 @@ export struct ScreenModelComponent {
build() {
Navigator({ target: "pages/screenMode" }) {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
Text($r("app.string.screenResolution"))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("sys.color.ohos_id_color_text_primary"))
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start);
}
Text($r("app.string.screenResolution"))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("sys.color.ohos_id_color_text_primary"))
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start);
Row() {
Text(this.sysScreenModeText)

View File

@ -181,44 +181,42 @@ struct EntryComponent {
List({ space: this.listSpaces }) {
// search
ListItem() {
Column() {
Row() {
Image($r("app.media.ic_search"))
.width($r('app.float.wh_value_18'))
.height($r('app.float.wh_value_18'))
.objectFit(ImageFit.Contain)
.margin({
left: $r("app.float.distance_11"),
top: $r('app.float.distance_11'),
bottom: $r('app.float.distance_11')
});
Row() {
Image($r("app.media.ic_search"))
.width($r('app.float.wh_value_18'))
.height($r('app.float.wh_value_18'))
.objectFit(ImageFit.Contain)
.margin({
left: $r("app.float.distance_11"),
top: $r('app.float.distance_11'),
bottom: $r('app.float.distance_11')
});
Text($r("app.string.searchHint"))
.fontSize($r("app.float.font_16"))
.lineHeight($r("app.float.lineHeight_21"))
.fontWeight(FontWeight.Regular)
.fontFamily('HarmonyHeiTi')
.fontColor($r("sys.color.ohos_id_color_text_secondary"))
.align(Alignment.Start)
.margin({
left: $r("app.float.distance_6"),
top: $r('app.float.distance_9'),
bottom: $r('app.float.distance_9')
});
}
.border({
width: $r('app.float.wh_value_1_5'),
color: $r("sys.color.ohos_id_color_fourth"),
radius: $r('app.float.wh_value_20')
})
.height($r("app.float.wh_value_40"))
.width(ConfigData.WH_100_100)
.alignItems(VerticalAlign.Center)
.backgroundColor($r("sys.color.ohos_id_color_foreground_contrary"));
Text($r("app.string.searchHint"))
.fontSize($r("app.float.font_16"))
.lineHeight($r("app.float.lineHeight_21"))
.fontWeight(FontWeight.Regular)
.fontFamily('HarmonyHeiTi')
.fontColor($r("sys.color.ohos_id_color_text_secondary"))
.align(Alignment.Start)
.margin({
left: $r("app.float.distance_6"),
top: $r('app.float.distance_9'),
bottom: $r('app.float.distance_9')
});
}
.height($r("app.float.wh_value_56"))
.padding({ top: $r("app.float.wh_value_8"), bottom: $r("app.float.wh_value_8") })
.border({
width: $r('app.float.wh_value_1_5'),
color: $r("sys.color.ohos_id_color_fourth"),
radius: $r('app.float.wh_value_20')
})
.height($r("app.float.wh_value_40"))
.width(ConfigData.WH_100_100)
.alignItems(VerticalAlign.Center)
.backgroundColor($r("sys.color.ohos_id_color_foreground_contrary"));
}
.height($r("app.float.wh_value_56"))
.padding({ top: $r("app.float.wh_value_8"), bottom: $r("app.float.wh_value_8") })
.width(ConfigData.WH_100_100)
.onClick(() => {
LogUtil.info('On click the search editText.');

View File

@ -82,6 +82,7 @@ struct Storage {
.fontSize($r("app.float.dataPanel_percent_font_size_1"))
.fontWeight(FontWeight.Medium)
.fontColor($r("sys.color.ohos_id_color_secondary"))
Text(' ')
.fontSize($r("app.float.dataPanel_proportion_font_size"))
}

View File

@ -87,21 +87,19 @@ struct SoftwareUpdateComponent {
build(){
Row(){
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems:ItemAlign.Center }) {
Row() {
Text(this.title)
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.font_color_182431'))
.margin({left: $r('app.float.distance_8')})
.textAlign(TextAlign.Start);
}
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Text(this.title)
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r('app.color.font_color_182431'))
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start);
Image('/res/image/ic_settings_arrow.svg')
.width($r('app.float.wh_value_12'))
.height($r('app.float.wh_value_24'))
.margin({right: $r('app.float.distance_8')})
.margin({ right: $r('app.float.distance_8') })
.fillColor($r("sys.color.ohos_id_color_primary"))
.opacity($r("app.float.opacity_0_2"))
}

View File

@ -32,13 +32,11 @@ struct LanguageSettings {
Column() {
HeadComponent({ headName: $r('app.string.setlanguage'), isActive: true });
Column() {
SubEntryComponent({
targetPage: 'pages/system/languageSettings/languageAndRegion/homePage',
title: $r("app.string.languageAndRegion")
})
}
.margin({top:$r("app.float.distance_8")})
SubEntryComponent({
targetPage: 'pages/system/languageSettings/languageAndRegion/homePage',
title: $r("app.string.languageAndRegion")
})
.margin({ top: $r("app.float.distance_8") })
}
.padding({
left: $r('sys.float.ohos_id_card_margin_start'),

View File

@ -32,12 +32,10 @@ struct EditLanguage {
Column() {
GridContainer({ gutter: ConfigData.GRID_CONTAINER_GUTTER_24, margin: ConfigData.GRID_CONTAINER_MARGIN_24 }) {
Column() {
HeadComponent({ headName: $r('app.string.editLanguage'), deleteFlag: $deleteFlag, deleteItem: $deleteItem});
HeadComponent({ headName: $r('app.string.editLanguage'), deleteFlag: $deleteFlag, deleteItem: $deleteItem });
Column(){
EditList({ deleteFlag: $deleteFlag, deleteItem: $deleteItem });
}
.margin({top:$r("app.float.distance_8")})
EditList({ deleteFlag: $deleteFlag, deleteItem: $deleteItem })
.margin({ top: $r("app.float.distance_8") })
}
.padding({
left: $r('sys.float.ohos_id_card_margin_start'),

View File

@ -200,34 +200,33 @@ struct AddText {
build() {
Navigator({ target: 'pages/system/languageSettings/languageAndRegion/addLanguage' }) {
Row() {
Text($r("app.string.addLanguage"))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("app.color.font_color_007DFF"))
.margin({left: $r('app.float.distance_8')})
.textAlign(TextAlign.Start);
}
.height(ConfigData.WH_100_100)
.width(ConfigData.WH_100_100)
.borderRadius($r('app.float.radius_20'))
.linearGradient(this.isTouched ? {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]]
} : {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]]})
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.isTouched = true;
}
if (event.type === TouchType.Up) {
this.isTouched = false;
}
});
Text($r("app.string.addLanguage"))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("app.color.font_color_007DFF"))
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start)
.height(ConfigData.WH_100_100)
.width(ConfigData.WH_100_100)
.borderRadius($r('app.float.radius_20'))
.linearGradient(this.isTouched ? {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]]
} : {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]]
})
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.isTouched = true;
}
if (event.type === TouchType.Up) {
this.isTouched = false;
}
});
}
.padding($r("app.float.distance_4"))
.height($r('app.float.wh_value_56'))
@ -247,15 +246,13 @@ struct Region {
build() {
Navigator({ target: 'pages/system/languageSettings/languageAndRegion/selectRegion' }) {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
Text($r("app.string.currentRegion"))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("sys.color.ohos_id_color_primary"))
.margin({left: $r('app.float.distance_8')})
.textAlign(TextAlign.Start);
}
Text($r("app.string.currentRegion"))
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("sys.color.ohos_id_color_primary"))
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start);
Row() {
Text(this.currentRegion)
@ -268,7 +265,7 @@ struct Region {
Image('/res/image/ic_settings_arrow.svg')
.width($r('app.float.wh_value_12'))
.height($r('app.float.wh_value_24'))
.margin({right: $r('app.float.distance_8')})
.margin({ right: $r('app.float.distance_8') })
.fillColor($r("sys.color.ohos_id_color_primary"))
.opacity($r("app.float.opacity_0_2"))
}

View File

@ -120,34 +120,33 @@ struct CurrentRegion {
build() {
Column() {
Row() {
Text(this.currentRegion)
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("app.color.font_color_007DFF"))
.margin({left: $r('app.float.distance_8')})
.textAlign(TextAlign.Start);
}
.height(ConfigData.WH_100_100)
.width(ConfigData.WH_100_100)
.borderRadius($r('app.float.radius_20'))
.linearGradient(this.isTouched ? {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]]
} : {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]]})
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.isTouched = true;
}
if (event.type === TouchType.Up) {
this.isTouched = false;
}
});
Text(this.currentRegion)
.fontSize($r('app.float.font_16'))
.lineHeight($r('app.float.wh_value_22'))
.fontWeight(FontWeight.Medium)
.fontColor($r("app.color.font_color_007DFF"))
.margin({ left: $r('app.float.distance_8') })
.textAlign(TextAlign.Start)
.height(ConfigData.WH_100_100)
.width(ConfigData.WH_100_100)
.borderRadius($r('app.float.radius_20'))
.linearGradient(this.isTouched ? {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("app.color.DCEAF9"), 0.0], [$r("app.color.FAFAFA"), 1.0]]
} : {
angle: 90,
direction: GradientDirection.Right,
colors: [[$r("sys.color.ohos_id_color_foreground_contrary"), 1], [$r("sys.color.ohos_id_color_foreground_contrary"), 1]]
})
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
this.isTouched = true;
}
if (event.type === TouchType.Up) {
this.isTouched = false;
}
});
}
.padding($r('app.float.distance_4'))
.height($r('app.float.wh_value_56'))

View File

@ -189,8 +189,8 @@ struct Index {
.padding({
left: $r('app.float.wh_value_12'),
top: $r('app.float.distance_19_5'),
bottom: $r('app.float.distance_9_5')
})
bottom: $r('app.float.distance_9_5')
})
.justifyContent(FlexAlign.Start);
Column() {
@ -202,7 +202,7 @@ struct Index {
settingArrow: this.connectedWiFi.settingArrow,
settingUri: this.connectedWiFi.settingUri,
titleFontColor: "activated"
});
})
}
.height($r("app.float.wh_value_64"))
.borderRadius($r("app.float.radius_24"))
@ -219,18 +219,19 @@ struct Index {
Column() {
Row() {
Row() {
Text($r("app.string.wifiTipValidWLAN"))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_secondary'))
.fontWeight(FontWeight.Medium)
.height($r('app.float.wh_value_19'));
}
.padding({ top: $r('app.float.distance_19_5'), bottom: $r('app.float.distance_9_5') });
Text($r("app.string.wifiTipValidWLAN"))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_secondary'))
.fontWeight(FontWeight.Medium)
.height($r('app.float.wh_value_19'))
.margin({ top: $r('app.float.distance_19_5'), bottom: $r('app.float.distance_9_5') });
Blank()
ImageAnimatorComponent({ imageWidth: $r('app.float.wh_value_24'), imageHeight: $r('app.float.wh_value_24') })
ImageAnimatorComponent({
imageWidth: $r('app.float.wh_value_24'),
imageHeight: $r('app.float.wh_value_24')
})
}
.height($r("app.float.wh_value_48"))
.width(ConfigData.WH_100_100)

View File

@ -329,10 +329,8 @@ struct connectProgressDialog {
Blank()
Column() {
ImageAnimatorComponent({ imageWidth: $r('app.float.wh_value_24'),
imageHeight: $r('app.float.wh_value_24') })
}
ImageAnimatorComponent({ imageWidth: $r('app.float.wh_value_24'),
imageHeight: $r('app.float.wh_value_24') })
}
.alignItems(VerticalAlign.Center)
.height($r("app.float.wh_value_48"))