diff --git a/entry/src/main/ets/pages/CommonComponent.ets b/entry/src/main/ets/pages/CommonComponent.ets index 9e4776f5eaa160a35fbcab60361dc70a196b944d..3557ab618a3665bbf2837ae5d59df6ab89f08b48 100644 --- a/entry/src/main/ets/pages/CommonComponent.ets +++ b/entry/src/main/ets/pages/CommonComponent.ets @@ -23,7 +23,7 @@ export function CommonComponentBuilder() { } @Entry - // [Start common_component] +// [Start common_component1] @Component struct CommonComponent { imageAttribute: ImageModifier = new ImageModifier(330, 330); @@ -48,7 +48,7 @@ struct CommonComponent { .title(getResourceString($r('app.string.common'), this)) } } -// [End common_component] +// [End common_component1] // [Start my_button1] //Provider customizes and exports components diff --git a/entry/src/main/ets/pages/ComponentFactory.ets b/entry/src/main/ets/pages/ComponentFactory.ets index a73280700a4dc391b483b239823173aaf7b50e2d..9437de801bc3f9f1b1fcbaa14313c99719074edc 100644 --- a/entry/src/main/ets/pages/ComponentFactory.ets +++ b/entry/src/main/ets/pages/ComponentFactory.ets @@ -29,17 +29,17 @@ export function ComponentFactoryBuilder() { } @Entry - // [Start component_factory] +// [Start component_factory] @Component struct ComponentFactory { build() { NavDestination() { - Column({ space: CommonConstants.BUTTON_SPACING }) { + Column({ space: 12 }) { // myRadio and myCheckbox are WrappedBuilder objects obtained from the component factory. myRadio.builder(); myCheckbox.builder(); } - .width(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') .padding($r('app.float.padding')) } .title(getResourceString($r('app.string.factory'), this)) diff --git a/entry/src/main/ets/pages/DialogComponent.ets b/entry/src/main/ets/pages/DialogComponent.ets index a6051b09ac7f8620a96c68c1da61305d1f568e9d..c22dc20ce4c2790efdd9eaa04d869e7288ec9982 100644 --- a/entry/src/main/ets/pages/DialogComponent.ets +++ b/entry/src/main/ets/pages/DialogComponent.ets @@ -23,7 +23,7 @@ export function DialogComponentBuilder() { } @Builder export function buildText(_obj: Object) { - Column({ space: CommonConstants.ROW_SPACING }) { + Column({ space: 16 }) { Text($r('app.string.tips')) .fontSize($r('app.float.font_size_l')) .fontWeight(FontWeight.Bold) @@ -34,12 +34,12 @@ export function buildText(_obj: Object) { .fontColor($r('app.color.blue')) .backgroundColor(Color.White) .margin({ right: $r('app.float.margin_right') }) - .width(CommonConstants.BUTTON_WIDTH) + .width('42%') .onClick(() => { PopViewUtils.closePopView(); }) Button($r('app.string.confirm')) - .width(CommonConstants.BUTTON_WIDTH) + .width('42%') .onClick(() => { PopViewUtils.closePopView(); }) @@ -62,7 +62,7 @@ struct DialogComponent { NavDestination() { Column() { Button('Click me') - .width(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') .onClick(() => { PopViewUtils.showPopView(wrapBuilder(buildText), new Object(), { alignment: DialogAlignment.Center }); }) @@ -73,8 +73,8 @@ struct DialogComponent { right: $r('app.float.padding'), bottom: $r('app.float.padding') }) - .width(CommonConstants.ONE_HUNDRED_PERCENT) - .height(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') + .height('100%') } .title(getResourceString($r('app.string.dialog'), this)) } diff --git a/entry/src/main/ets/view/CustomImageText.ets b/entry/src/main/ets/view/CustomImageText.ets index 1a3279fe7cd7a006f0a5f5e728991fb65adf6e83..7e6c4000e4cfb4dcacf4d7709fbf4eaf96a8d07b 100644 --- a/entry/src/main/ets/view/CustomImageText.ets +++ b/entry/src/main/ets/view/CustomImageText.ets @@ -22,7 +22,7 @@ export struct CustomImageText { @Prop text: string; build() { - Column({ space: CommonConstants.BUTTON_SPACING }) { + Column({ space: 12 }) { Image($r('app.media.image')) .attributeModifier(this.imageAttribute) Text('Scenery') @@ -53,7 +53,7 @@ struct MyButton { @Component struct Index { build() { - MyButton({ text: String($r('app.string.click')), stateEffect: true }) + MyButton({ text: 'Click with animation', stateEffect: true }) } } // [End index] \ No newline at end of file diff --git a/entry/src/main/ets/view/FactoryMap.ets b/entry/src/main/ets/view/FactoryMap.ets index 7a41ffb193cedae9d2ee56968de50494e60201a7..6a992efc5edeabfc21473ac6fc8604d2db75c141 100644 --- a/entry/src/main/ets/view/FactoryMap.ets +++ b/entry/src/main/ets/view/FactoryMap.ets @@ -24,14 +24,14 @@ function myRadio() { .margin({ right: $r('app.float.margin_right') }) Text('man') } - .width(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') Row() { Radio({ value: '0', group: 'radioGroup' }) .margin({ right: $r('app.float.margin_right') }) Text('woman') } - .width(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') } @Builder @@ -45,7 +45,7 @@ function myCheckBox() { Text('all') .margin({ left: $r('app.float.margin_right') }) } - .width(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') Row() { Checkbox({ name: '1', group: 'checkboxGroup' }) @@ -53,7 +53,7 @@ function myCheckBox() { .margin({ right: $r('app.float.margin_right') }) Text('text1') } - .width(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') Row() { Checkbox({ name: '0', group: 'checkboxGroup' }) @@ -61,7 +61,7 @@ function myCheckBox() { .margin({ right: $r('app.float.margin_right') }) Text('text2') } - .width(CommonConstants.ONE_HUNDRED_PERCENT) + .width('100%') } // [End my_radio] diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json index 86e9f1d40676f06de03ab90a2ff75a2a51e1edb3..8d61c21208448bd1a4ac7084d90329b01e4d3e94 100644 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -51,10 +51,6 @@ { "name": "checkbox", "value": "CheckBox" - }, - { - "name": "click", - "value": "CheckBox" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index 7d20e07d1f86e724463c3c8920e867f27734cfcf..82248c13665c88dd60a4b283762bbed0608e7821 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -51,10 +51,6 @@ { "name": "checkbox", "value": "复选框" - }, - { - "name": "click", - "value": "点击带有动效" } ] } \ No newline at end of file