Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ce4b0c95
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ce4b0c95
编写于
7月 23, 2023
作者:
W
wangchao582
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
!9438 Adaptation Phase 1 Issues
Signed-off-by:
N
wangchao582
<
wangchao582@huawei.com
>
上级
4b100a22
变更
38
隐藏空白更改
内联
并排
Showing
38 changed file
with
414 addition
and
329 deletion
+414
-329
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/common/AttrsManager.ets
...rs/entry/src/main/ets/MainAbility/common/AttrsManager.ets
+4
-0
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/common/Utils.ets
...mon_attrs/entry/src/main/ets/MainAbility/common/Utils.ets
+11
-0
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/alignRules/AlignRulesPage.ets
.../main/ets/MainAbility/pages/alignRules/AlignRulesPage.ets
+5
-5
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/constraintSize/ConstraintSizePage.ets
...s/MainAbility/pages/constraintSize/ConstraintSizePage.ets
+10
-3
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/height/HeightPage.ets
...ntry/src/main/ets/MainAbility/pages/height/HeightPage.ets
+25
-12
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/layoutWeight/LayoutWeightPage.ets
...n/ets/MainAbility/pages/layoutWeight/LayoutWeightPage.ets
+5
-4
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/layoutWeight/LayoutWeightPageFlex.ets
...s/MainAbility/pages/layoutWeight/LayoutWeightPageFlex.ets
+5
-4
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/layoutWeight/LayoutWeightPageRow.ets
...ts/MainAbility/pages/layoutWeight/LayoutWeightPageRow.ets
+5
-4
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/margin/MarginPage.ets
...ntry/src/main/ets/MainAbility/pages/margin/MarginPage.ets
+2
-0
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/margin/MarginPageLength.ets
...rc/main/ets/MainAbility/pages/margin/MarginPageLength.ets
+12
-4
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/margin/MarginPageString.ets
...rc/main/ets/MainAbility/pages/margin/MarginPageString.ets
+10
-2
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/offset/OffsetPage.ets
...ntry/src/main/ets/MainAbility/pages/offset/OffsetPage.ets
+4
-2
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/padding/PaddingBasePageLength.ets
...n/ets/MainAbility/pages/padding/PaddingBasePageLength.ets
+1
-1
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/padding/PaddingContainerPage.ets
...in/ets/MainAbility/pages/padding/PaddingContainerPage.ets
+11
-9
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/padding/PaddingContainerPageLength.ets
.../MainAbility/pages/padding/PaddingContainerPageLength.ets
+12
-8
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/position/PositionPage.ets
.../src/main/ets/MainAbility/pages/position/PositionPage.ets
+12
-6
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/size/SizePage.ets
...rs/entry/src/main/ets/MainAbility/pages/size/SizePage.ets
+8
-7
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/width/WidthPage.ets
.../entry/src/main/ets/MainAbility/pages/width/WidthPage.ets
+11
-5
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/view/position/FlowItemView.ets
...y/src/main/ets/MainAbility/view/position/FlowItemView.ets
+7
-19
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/view/position/TabsView.ets
...entry/src/main/ets/MainAbility/view/position/TabsView.ets
+0
-1
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/view/position/WaterFlowView.ets
.../src/main/ets/MainAbility/view/position/WaterFlowView.ets
+31
-33
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/List.test.ets
...ponent_common_attrs/entry/src/main/ets/test/List.test.ets
+1
-1
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/constraintSize/ConstraintSizeTest.test.ets
.../main/ets/test/constraintSize/ConstraintSizeTest.test.ets
+8
-8
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/default/DefaultTest.test.ets
...ttrs/entry/src/main/ets/test/default/DefaultTest.test.ets
+5
-5
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/height/HeightTest.test.ets
..._attrs/entry/src/main/ets/test/height/HeightTest.test.ets
+18
-39
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/layoutWeight/LayoutWeightFlexTest.test.ets
.../main/ets/test/layoutWeight/LayoutWeightFlexTest.test.ets
+1
-1
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/layoutWeight/LayoutWeightRowTest.test.ets
...c/main/ets/test/layoutWeight/LayoutWeightRowTest.test.ets
+1
-1
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/layoutWeight/LayoutWeightTest.test.ets
.../src/main/ets/test/layoutWeight/LayoutWeightTest.test.ets
+2
-2
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/margin/MarginLengthTest.test.ets
.../entry/src/main/ets/test/margin/MarginLengthTest.test.ets
+6
-6
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/margin/MarginTest.test.ets
..._attrs/entry/src/main/ets/test/margin/MarginTest.test.ets
+9
-9
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/offset/OffsetTest.test.ets
..._attrs/entry/src/main/ets/test/offset/OffsetTest.test.ets
+19
-8
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingBaseLengthTest.test.ets
.../src/main/ets/test/padding/PaddingBaseLengthTest.test.ets
+4
-4
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingBaseTest.test.ets
.../entry/src/main/ets/test/padding/PaddingBaseTest.test.ets
+1
-1
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingContainerLengthTest.test.ets
...main/ets/test/padding/PaddingContainerLengthTest.test.ets
+48
-38
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingContainerTest.test.ets
...y/src/main/ets/test/padding/PaddingContainerTest.test.ets
+62
-50
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/position/PositionTest.test.ets
...rs/entry/src/main/ets/test/position/PositionTest.test.ets
+16
-5
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/size/SizeTest.test.ets
...mmon_attrs/entry/src/main/ets/test/size/SizeTest.test.ets
+12
-12
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/width/WidthTest.test.ets
...on_attrs/entry/src/main/ets/test/width/WidthTest.test.ets
+10
-10
未找到文件。
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/common/AttrsManager.ets
浏览文件 @
ce4b0c95
...
...
@@ -29,6 +29,10 @@ export class AttrsManager {
this.onEvent(Constants.EVENT_ID_CHANGE_DATA);
}
static unRegisterDataChange() {
events_emitter.off(Constants.EVENT_ID_CHANGE_DATA);
}
private onEvent(eventId: number) {
let stateChangeEvent = {
eventId: eventId,
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/common/Utils.ets
浏览文件 @
ce4b0c95
...
...
@@ -14,6 +14,7 @@
*/
import router from '@ohos.router';
import { AttrsManager } from './AttrsManager';
export default class Utils {
public static instance;
...
...
@@ -51,7 +52,16 @@ export default class Utils {
static async pushPage(obj) {
try {
let pages = router.getState();
let pageParams = router.getParams();
console.info('get ' + obj.pageName + ' state pages: ' + JSON.stringify(pages));
if (pageParams && pageParams['view'] && obj.targetView != pageParams['view']['targetView']) {
console.info('get ' + obj.pageName + ' params: ' + JSON.stringify(pageParams));
console.info('pageParams.view.targetView: ' + pageParams['view']['targetView']);
console.info('targetView: ' + obj.targetView);
await Utils.back();
pages = router.getState();
}
if (!(obj.pageName == pages.name)) {
console.info('get ' + obj.pageName + ' state pages.name:' + JSON.stringify(pages.name));
let result = await router.pushUrl({
...
...
@@ -72,6 +82,7 @@ export default class Utils {
if (!('Index' == router.getState().name)) {
router.back()
}
AttrsManager.unRegisterDataChange();
await Utils.sleep(1000);
router.clear();
}
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/alignRules/AlignRulesPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -60,17 +60,17 @@ struct AlignRules {
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'Radio') {
Radio({ value: 'Radio1', group: 'radioGroup' })
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
.
margin(0).
width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'Select') {
Select([{ value: 'aaa', icon: '/common/public_icon.svg' },
{ value: 'bbb', icon: '/common/public_icon.svg' }])
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'Checkbox') {
Checkbox({ name: 'checkbox1' })
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
.
margin(0).
width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup()
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
.
margin(0).
width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: [25] })
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
...
...
@@ -132,7 +132,7 @@ struct AlignRules {
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'Search') {
Search()
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
.
margin(0).
width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'Slider') {
Slider()
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
...
...
@@ -156,7 +156,7 @@ struct AlignRules {
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch })
.width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
.
margin(0).
width(this.subassemblyWidth).height(this.subassemblyHeight).commonStyle()
} else if (this.targetView == 'Badge') {
Badge({ value: '', style: { badgeSize: 6, badgeColor: Color.Red } }) {
Button('BadgeContent')
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/constraintSize/ConstraintSizePage.ets
浏览文件 @
ce4b0c95
...
...
@@ -440,17 +440,24 @@ struct ConstraintSizePage {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
.commonStyle()
}.backgroundColor(Color.Yellow)
.padding(0)
.width(400)
.height(400)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'MenuItemGroup') {
Row() {
Menu() {
MenuItemGroup(
{ header: 'MenuItemGroup' }
) {
MenuItem({
startIcon: $r('app.media.icon'), content: 'MenuItem' }
)
MenuItemGroup() {
MenuItem({
content: 'MenuItem' }).backgroundColor(Color.White).padding(0).margin(0
)
}
.backgroundColor(Color.Pink)
.commonStyle()
}.backgroundColor(Color.Yellow)
.padding(0)
.margin(0)
}
.backgroundColor(Color.Yellow)
.padding(0)
.margin(0)
.width(400)
.height(400)
}.width('100%').height('100%').backgroundColor(Color.Green)
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/height/HeightPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -61,9 +61,10 @@ struct heightPage {
} else if (this.targetView == 'BlankColumn') {
Blank().color(this.BackGroundColor).commonStyle().width(100)
} else if (this.targetView == 'Checkbox') {
Checkbox().backgroundColor(this.BackGroundColor).commonStyle().width(100)
Checkbox().backgroundColor(this.BackGroundColor).commonStyle().width(100)
.margin(0)
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle().backgroundColor(this.BackGroundColor).width(100)
.margin(0)
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: this.valueArr }).commonStyle().width(100)
} else if (this.targetView == 'DatePicker') {
...
...
@@ -105,6 +106,7 @@ struct heightPage {
QRCode(this.src).commonStyle().backgroundColor(this.BackGroundColor).width(100)
} else if (this.targetView == 'Radio') {
Radio({ value: 'Radio1', group: 'radioGroup' }).width(100).commonStyle().backgroundColor(this.BackGroundColor)
.margin(0)
} else if (this.targetView == 'Rating') {
Rating({ rating: 3.5 }).commonStyle().width(100)
} else if (this.targetView == 'RichText') {
...
...
@@ -114,7 +116,7 @@ struct heightPage {
Text().width(10).height(50).backgroundColor('#C0C0C0')
}.commonStyle().backgroundColor(this.BackGroundColor).width(100)
} else if (this.targetView == 'Search') {
Search().commonStyle().width(100)
Search().commonStyle().width(100)
.margin(0)
} else if (this.targetView == 'Select') {
Select([{ value: 'aaa' },
{ value: 'bbb' }]).backgroundColor(this.BackGroundColor).commonStyle().width(100)
...
...
@@ -125,9 +127,12 @@ struct heightPage {
} else if (this.targetView == 'TextArea') {
TextArea({ placeholder: 'TextArea' }).commonStyle().width(100)
} else if (this.targetView == 'TextClock') {
TextClock({ timeZoneOffset: -8 }).format('hms').fontSize(30)
TextClock({ timeZoneOffset: -8 })
.format('hms')
.fontSize(30)
.commonStyle()
.backgroundColor(this.BackGroundColor).width(100)
.backgroundColor(this.BackGroundColor)
.width(100)
} else if (this.targetView == 'TextInput') {
TextInput({ placeholder: 'input your word...' })
.commonStyle().width(100)
...
...
@@ -141,7 +146,7 @@ struct heightPage {
selected: this.selectedTime
}).useMilitaryTime(true).commonStyle().width(100)
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch }).commonStyle().backgroundColor(this.BackGroundColor).width(100)
Toggle({ type: ToggleType.Switch }).commonStyle().backgroundColor(this.BackGroundColor).width(100)
.margin(0)
} else if (this.targetView == 'Web') {
Web({ src: 'www.example.com', controller: new WebController() }).commonStyle().width(100)
} else if (this.targetView == 'Circle') {
...
...
@@ -190,7 +195,8 @@ struct heightPage {
}.commonStyle().width(100)
}
} else if (this.targetView == 'Counter') {
Counter() {}.commonStyle().width(100)
Counter() {
}.commonStyle().width(100)
} else if (this.targetView == 'Flex') {
Flex() {
Text('1').width('20%').height(50).backgroundColor(0xF5DEB3)
...
...
@@ -269,7 +275,8 @@ struct heightPage {
}.backgroundColor(Color.Orange)
}.commonStyle()
} else if (this.targetView == 'Stack') {
Stack() {}.commonStyle().width(100)
Stack() {
}.commonStyle().width(100)
} else if (this.targetView == 'Swiper') {
Swiper() {
ForEach([1, 2, 3], (item: string) => {
...
...
@@ -325,16 +332,19 @@ struct heightPage {
} else if (this.targetView == 'Menu') {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'Menu' })
}.backgroundColor(Color.Yellow).commonStyle().width(100)
}.backgroundColor(Color.Yellow).commonStyle().width(100)
.padding(0)
} else if (this.targetView == 'MenuItem') {
Row() {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
.height(this._height)
.key(this.componentKey)
}.backgroundColor(this.BackGroundColor)
}
.backgroundColor(this.BackGroundColor)
.width(this.parentWidth)
.height(this.parentHeight).key(this.parentComponentKey)
.height(this.parentHeight)
.key(this.parentComponentKey)
.padding(0)
}
} else if (this.targetView == 'MenuItemGroup') {
Row() {
...
...
@@ -342,9 +352,12 @@ struct heightPage {
MenuItemGroup({ header: 'MenuItemGroup' }) {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
}.key(this.componentKey).height(this._height)
}.backgroundColor(Color.Yellow)
}
.backgroundColor(Color.Yellow)
.height(this.parentHeight)
.width(this.parentWidth).key(this.parentComponentKey)
.width(this.parentWidth)
.key(this.parentComponentKey)
.padding(0)
}
}
}
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/layoutWeight/LayoutWeightPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -58,9 +58,9 @@ struct LayoutWeightPage {
} else if (this.targetView == 'Button') {
Button('button1').commonStyle()
} else if (this.targetView == 'Checkbox') {
Checkbox().select(true).selectedColor(Color.Red).commonStyle()
Checkbox().select(true).selectedColor(Color.Red).
margin(0).
commonStyle()
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).selectedColor('#ffcd175f').commonStyle()
CheckboxGroup({ group: 'checkboxGroup' }).selectedColor('#ffcd175f').
margin(0).
commonStyle()
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: [5, 10, 10, 7, 9, 10, 10, 10, 10], max: 100, type: DataPanelType.Line }).commonStyle()
} else if (this.targetView == 'DatePicker') {
...
...
@@ -108,7 +108,7 @@ struct LayoutWeightPage {
} else if (this.targetView == 'QRCode') {
QRCode('Running Marquee starts rolling').commonStyle()
} else if (this.targetView == 'Radio') {
Radio({ value: 'Radio1', group: 'radioGroup' }).commonStyle()
Radio({ value: 'Radio1', group: 'radioGroup' }).
margin(0).
commonStyle()
} else if (this.targetView == 'Rating') {
Rating({ rating: 3.5, indicator: false }).commonStyle()
} else if (this.targetView == 'RichText') {
...
...
@@ -127,6 +127,7 @@ struct LayoutWeightPage {
Search({ placeholder: 'Type to search...' })
.backgroundColor(Color.White)
.searchButton('SEARCH')
.margin(0)
.commonStyle()
} else if (this.targetView == 'Select') {
Select([{ value: 'aaa', icon: '/common/public_icon.svg' },
...
...
@@ -165,7 +166,7 @@ struct LayoutWeightPage {
selected: new Date('2022-07-22T08:00:00')
}).useMilitaryTime(true).commonStyle()
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch, isOn: false }).commonStyle()
Toggle({ type: ToggleType.Switch, isOn: false }).
margin(0).
commonStyle()
} else if (this.targetView == 'Web') {
Web({ src: 'www.example.com', controller: new WebController() }).commonStyle()
} else if (this.targetView == 'Circle') {
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/layoutWeight/LayoutWeightPageFlex.ets
浏览文件 @
ce4b0c95
...
...
@@ -56,9 +56,9 @@ struct LayoutWeightPageFlex {
} else if (this.targetView == 'Button') {
Button('button1').commonStyle()
} else if (this.targetView == 'Checkbox') {
Checkbox().select(true).selectedColor(Color.Red).commonStyle()
Checkbox().select(true).selectedColor(Color.Red).
margin(0).
commonStyle()
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).selectedColor('#ffcd175f').commonStyle()
CheckboxGroup({ group: 'checkboxGroup' }).selectedColor('#ffcd175f').
margin(0).
commonStyle()
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: [5, 10, 10, 7, 9, 10, 10, 10, 10], max: 100, type: DataPanelType.Line }).commonStyle()
} else if (this.targetView == 'DatePicker') {
...
...
@@ -106,7 +106,7 @@ struct LayoutWeightPageFlex {
} else if (this.targetView == 'QRCode') {
QRCode('Running Marquee starts rolling').commonStyle()
} else if (this.targetView == 'Radio') {
Radio({ value: 'Radio1', group: 'radioGroup' }).commonStyle()
Radio({ value: 'Radio1', group: 'radioGroup' }).
margin(0).
commonStyle()
} else if (this.targetView == 'Rating') {
Rating({ rating: 3.5, indicator: false }).commonStyle()
} else if (this.targetView == 'RichText') {
...
...
@@ -125,6 +125,7 @@ struct LayoutWeightPageFlex {
Search({ placeholder: 'Type to search...' })
.backgroundColor(Color.White)
.searchButton('SEARCH')
.margin(0)
.commonStyle()
} else if (this.targetView == 'Select') {
Select([{ value: 'aaa', icon: '/common/public_icon.svg' },
...
...
@@ -163,7 +164,7 @@ struct LayoutWeightPageFlex {
selected: new Date('2022-07-22T08:00:00')
}).useMilitaryTime(true).commonStyle()
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch, isOn: false }).commonStyle()
Toggle({ type: ToggleType.Switch, isOn: false }).
margin(0).
commonStyle()
} else if (this.targetView == 'Web') {
Web({ src: 'www.example.com', controller: new WebController() }).commonStyle()
} else if (this.targetView == 'Circle') {
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/layoutWeight/LayoutWeightPageRow.ets
浏览文件 @
ce4b0c95
...
...
@@ -57,9 +57,9 @@ struct LayoutWeightPageRow {
} else if (this.targetView == 'Button') {
Button('button1').commonStyle()
} else if (this.targetView == 'Checkbox') {
Checkbox().select(true).selectedColor(Color.Red).commonStyle()
Checkbox().select(true).selectedColor(Color.Red).
margin(0).
commonStyle()
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).selectedColor('#ffcd175f').commonStyle()
CheckboxGroup({ group: 'checkboxGroup' }).selectedColor('#ffcd175f').
margin(0).
commonStyle()
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: [5, 10, 10, 7, 9, 10, 10, 10, 10], max: 100, type: DataPanelType.Line }).commonStyle()
} else if (this.targetView == 'DatePicker') {
...
...
@@ -107,7 +107,7 @@ struct LayoutWeightPageRow {
} else if (this.targetView == 'QRCode') {
QRCode('Running Marquee starts rolling').commonStyle()
} else if (this.targetView == 'Radio') {
Radio({ value: 'Radio1', group: 'radioGroup' }).commonStyle()
Radio({ value: 'Radio1', group: 'radioGroup' }).
margin(0).
commonStyle()
} else if (this.targetView == 'Rating') {
Rating({ rating: 3.5, indicator: false }).commonStyle()
} else if (this.targetView == 'RichText') {
...
...
@@ -126,6 +126,7 @@ struct LayoutWeightPageRow {
Search({ placeholder: 'Type to search...' })
.backgroundColor(Color.White)
.searchButton('SEARCH')
.margin(0)
.commonStyle()
} else if (this.targetView == 'Select') {
Select([{ value: 'aaa', icon: '/common/public_icon.svg' },
...
...
@@ -164,7 +165,7 @@ struct LayoutWeightPageRow {
selected: new Date('2022-07-22T08:00:00')
}).useMilitaryTime(true).commonStyle()
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch, isOn: false }).commonStyle()
Toggle({ type: ToggleType.Switch, isOn: false }).
margin(0).
commonStyle()
} else if (this.targetView == 'Web') {
Web({ src: 'www.example.com', controller: new WebController() }).commonStyle()
} else if (this.targetView == 'Circle') {
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/margin/MarginPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -79,6 +79,7 @@ struct MarginPage {
}.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.padding(0)
.key(this.parentComponentKey)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'MenuItemGroup') {
...
...
@@ -90,6 +91,7 @@ struct MarginPage {
}.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.padding(0)
.key(this.parentComponentKey)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'TabContent') {
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/margin/MarginPageLength.ets
浏览文件 @
ce4b0c95
...
...
@@ -71,8 +71,12 @@ struct MarginPageLength {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
.margin(this._margin).key(this.componentKey).width('100%').height('100%')
}.backgroundColor(Color.Yellow)
.width(this.parentWidth).height(this.parentHeight).key(this.parentComponentKey)
}
.backgroundColor(Color.Yellow)
.padding(0)
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'MenuItemGroup') {
Row() {
...
...
@@ -80,8 +84,12 @@ struct MarginPageLength {
MenuItemGroup({ header: 'MenuItemGroup' }) {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
}.margin(this._margin).key(this.componentKey).width('100%').height('100%')
}.backgroundColor(Color.Yellow)
.width(this.parentWidth).height(this.parentHeight).key(this.parentComponentKey)
}
.backgroundColor(Color.Yellow)
.padding(0)
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'TabContent') {
Tabs() {
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/margin/MarginPageString.ets
浏览文件 @
ce4b0c95
...
...
@@ -80,7 +80,11 @@ struct MarginPageString {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
.margin(this._margin).key(this.componentKey).width('100%').height('100%')
}.backgroundColor(Color.Yellow).width(this.parentWidth).height(this.parentHeight)
}
.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.padding(0)
.key(this.parentComponentKey)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'MenuItemGroup') {
...
...
@@ -89,7 +93,11 @@ struct MarginPageString {
MenuItemGroup({ header: 'MenuItemGroup' }) {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
}.margin(this._margin).key(this.componentKey).width('100%').height('100%')
}.backgroundColor(Color.Yellow).width(this.parentWidth).height(this.parentHeight)
}
.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.padding(0)
.key(this.parentComponentKey)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'TabContent') {
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/offset/OffsetPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -148,7 +148,8 @@ struct Offset {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' }).commonStyle()
MenuItem({ startIcon: $r('app.media.icon'), content: 'referenceComponent' })
.key(this.referenceComponentKey)
}.backgroundColor(Color.Yellow)
}.padding(0)
.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
...
...
@@ -162,7 +163,8 @@ struct Offset {
MenuItem({ startIcon: $r('app.media.icon'), content: 'referenceComponent' })
.key(this.referenceComponentKey)
}.backgroundColor(Color.Yellow)
}.padding(0)
.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/padding/PaddingBasePageLength.ets
浏览文件 @
ce4b0c95
...
...
@@ -59,7 +59,7 @@ struct PaddingPage_Length {
} else if (this.targetView == 'Checkbox') {
Checkbox().backgroundColor(Color.Orange).commonStyle()
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle().backgroundColor(Color.Orange)
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle().backgroundColor(Color.Orange)
.margin(0)
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: this.valueArr }).commonStyle()
} else if (this.targetView == 'DatePicker') {
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/padding/PaddingContainerPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -58,10 +58,9 @@ struct paddingPage {
GridRow({
columns: 5,
gutter: { x: 5, y: 10 },
breakpoints: { value: ['400vp', '600vp', '800vp'], reference: BreakpointsReference.WindowSize },
direction: GridRowDirection.Row
}) {
GridCol({ span:
{ xs: 1, sm: 2, md: 3, lg: 4 }
}) {
GridCol({ span:
5
}) {
Row()
.width('100%')
.height('100%')
...
...
@@ -70,11 +69,11 @@ struct paddingPage {
}.commonStyle()
} else if (this.targetView == 'Grid') {
Grid() {
GridItem() {
Text('day')
.backgroundColor(0xF9CF93)
.textAlign(TextAlign.Center)
}
GridItem() {
Text('day')
.backgroundColor(0xF9CF93)
.textAlign(TextAlign.Center)
}
}.commonStyle()
} else if (this.targetView == 'List') {
List() {
...
...
@@ -89,8 +88,11 @@ struct paddingPage {
Panel(true) {
Column() {
Text('1').height('100%').width('100%')
}.height('100%').width('100%').key(this.referenceComponentKey)
}.commonStyle().height('50%').width('50%')
}.height('100%').width('100%').key(this.referenceComponentKey).backgroundColor(Color.Black)
}
.mode(PanelMode.Full)
.commonStyle()
.dragBar(false)
} else if (this.targetView == 'Refresh') {
Refresh({ refreshing: false }) {
}.commonStyle()
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/padding/PaddingContainerPageLength.ets
浏览文件 @
ce4b0c95
...
...
@@ -62,10 +62,9 @@ struct PaddingPage_Length {
GridRow({
columns: 5,
gutter: { x: 5, y: 10 },
breakpoints: { value: ['400vp', '600vp', '800vp'], reference: BreakpointsReference.WindowSize },
direction: GridRowDirection.Row
}) {
GridCol({ span:
{ xs: 1, sm: 2, md: 3, lg: 4 }
}) {
GridCol({ span:
5
}) {
Row()
.width('100%')
.height('100%')
...
...
@@ -74,11 +73,11 @@ struct PaddingPage_Length {
}.commonStyle()
} else if (this.targetView == 'Grid') {
Grid() {
GridItem() {
Text('day')
.backgroundColor(0xF9CF93)
.textAlign(TextAlign.Center)
}
GridItem() {
Text('day')
.backgroundColor(0xF9CF93)
.textAlign(TextAlign.Center)
}
}.commonStyle()
} else if (this.targetView == 'List') {
List() {
...
...
@@ -97,7 +96,12 @@ struct PaddingPage_Length {
.height('100%')
.backgroundColor('#FF3333')
}.width('100%').height('100%').key(this.referenceComponentKey)
}.commonStyle().height('50%').width('50%')
}
.mode(PanelMode.Full)
.commonStyle()
.height('50%')
.width('50%')
.dragBar(false)
} else if (this.targetView == 'Refresh') {
Refresh({ refreshing: false }) {
Text('123')
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/position/PositionPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -65,10 +65,12 @@ struct PositionPage {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' }).commonStyle()
MenuItem({ startIcon: $r('app.media.icon'), content: 'referenceComponent' })
.key(this.referenceComponentKey)
}.backgroundColor(Color.Yellow)
}
.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
.padding(0)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'MenuItemGroup') {
Row() {
...
...
@@ -79,10 +81,12 @@ struct PositionPage {
MenuItem({ startIcon: $r('app.media.icon'), content: 'referenceComponent' })
.key(this.referenceComponentKey)
}.backgroundColor(Color.Yellow)
}
.backgroundColor(Color.Yellow)
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
.padding(0)
}.width('100%').height('100%').backgroundColor(Color.Green)
} else if (this.targetView == 'ListItem') {
List({ space: 20, initialIndex: 0 }) {
...
...
@@ -192,6 +196,7 @@ struct PositionPage {
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
.padding(0)
} else if (this.targetView == 'StepperItem') {
StepperItemView({
_position: $_position,
...
...
@@ -220,9 +225,9 @@ struct PositionPage {
} else if (this.targetView == 'Button') {
Button('button1').commonStyle()
} else if (this.targetView == 'Checkbox') {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }).commonStyle()
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }).commonStyle()
.margin(0)
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle()
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle()
.margin(0)
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: [25], max: 100, type: DataPanelType.Circle }).commonStyle()
} else if (this.targetView == 'DatePicker') {
...
...
@@ -257,7 +262,7 @@ struct PositionPage {
} else if (this.targetView == 'QRCode') {
QRCode('QRCode').color(0xF7CE00).width(200).height(200).commonStyle()
} else if (this.targetView == 'Radio') {
Radio({ value: 'Radio1', group: 'radioGroup' }).commonStyle()
Radio({ value: 'Radio1', group: 'radioGroup' }).commonStyle()
.margin(0)
} else if (this.targetView == 'Rating') {
Rating({ rating: 4 }).stars(5).commonStyle()
} else if (this.targetView == 'ScrollBar') {
...
...
@@ -272,6 +277,7 @@ struct PositionPage {
.backgroundColor(Color.White)
.searchButton('SEARCH')
.commonStyle()
.margin(0)
} else if (this.targetView == 'Select') {
Select([{ value: 'aaa', icon: '/common/public_icon.svg' },
{ value: 'bbb', icon: '/common/public_icon.svg' }]).commonStyle()
...
...
@@ -296,7 +302,7 @@ struct PositionPage {
} else if (this.targetView == 'TimePicker') {
TimePicker().commonStyle()
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch }).commonStyle()
Toggle({ type: ToggleType.Switch }).commonStyle()
.margin(0)
} else if (this.targetView == 'Badge') {
Badge({
value: '',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/size/SizePage.ets
浏览文件 @
ce4b0c95
...
...
@@ -60,9 +60,9 @@ struct sizePage {
Blank().color(this.BackGroundColor).commonStyle()
}.width(this.parentWidth).height(this.parentHeight)
} else if (this.targetView == 'Checkbox') {
Checkbox().backgroundColor(this.BackGroundColor).commonStyle()
Checkbox().backgroundColor(this.BackGroundColor).commonStyle()
.margin(0)
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle().backgroundColor(this.BackGroundColor)
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle().backgroundColor(this.BackGroundColor)
.margin(0)
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: this.valueArr }).commonStyle()
} else if (this.targetView == 'DatePicker') {
...
...
@@ -106,6 +106,7 @@ struct sizePage {
.checked(true)
.commonStyle()
.backgroundColor(this.BackGroundColor)
.margin(0)
} else if (this.targetView == 'Rating') {
Rating({ rating: 3.5 }).commonStyle()
} else if (this.targetView == 'RichText') {
...
...
@@ -115,7 +116,7 @@ struct sizePage {
Text().width(10).height(50).backgroundColor('#C0C0C0')
}.commonStyle().backgroundColor(this.BackGroundColor)
} else if (this.targetView == 'Search') {
Search().commonStyle()
Search().commonStyle()
.margin(0)
} else if (this.targetView == 'Select') {
Select([{ value: 'aaa' }, { value: 'bbb' }]).backgroundColor(this.BackGroundColor).commonStyle()
} else if (this.targetView == 'Slider') {
...
...
@@ -143,7 +144,7 @@ struct sizePage {
selected: this.selectedTime,
}).useMilitaryTime(true).commonStyle()
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch, isOn: false }).commonStyle().backgroundColor(this.BackGroundColor)
Toggle({ type: ToggleType.Switch, isOn: false }).commonStyle().backgroundColor(this.BackGroundColor)
.margin(0)
} else if (this.targetView == 'Circle') {
Circle().commonStyle()
} else if (this.targetView == 'Ellipse') {
...
...
@@ -326,14 +327,14 @@ struct sizePage {
} else if (this.targetView == 'Menu') {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'Menu' })
}.backgroundColor(Color.Yellow).commonStyle()
}.backgroundColor(Color.Yellow).commonStyle()
.padding(0)
} else if (this.targetView == 'MenuItem') {
Row() {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
.size(this._size)
.key(this.componentKey)
}.width(this.parentWidth).height(this.parentHeight)
}.width(this.parentWidth).height(this.parentHeight)
.padding(0)
}
} else if (this.targetView == 'MenuItemGroup') {
Row() {
...
...
@@ -341,7 +342,7 @@ struct sizePage {
MenuItemGroup({ header: 'MenuItemGroup' }) {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
}.key(this.componentKey).size(this._size)
}.width(this.parentWidth).height(this.parentHeight)
}.width(this.parentWidth).height(this.parentHeight)
.padding(0)
}
}
}
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/pages/width/WidthPage.ets
浏览文件 @
ce4b0c95
...
...
@@ -61,9 +61,10 @@ struct WidthPage {
Blank().color(this.BackGroundColor).commonStyle()
}.key(this.parentComponentKey).width(this.parentWidth).height(this.parentHeight)
} else if (this.targetView == 'Checkbox') {
Checkbox().backgroundColor(this.BackGroundColor).commonStyle().height(100)
Checkbox().backgroundColor(this.BackGroundColor).commonStyle().height(100)
.margin(0)
} else if (this.targetView == 'CheckboxGroup') {
CheckboxGroup({ group: 'checkboxGroup' }).commonStyle().backgroundColor(this.BackGroundColor).height(100)
.margin(0)
} else if (this.targetView == 'DataPanel') {
DataPanel({ values: this.valueArr }).commonStyle().height(100)
} else if (this.targetView == 'DatePicker') {
...
...
@@ -111,6 +112,7 @@ struct WidthPage {
.height(100)
.commonStyle()
.backgroundColor(this.BackGroundColor)
.margin(0)
} else if (this.targetView == 'Rating') {
Rating({ rating: 3.5 }).commonStyle().height(100)
} else if (this.targetView == 'RichText') {
...
...
@@ -147,7 +149,7 @@ struct WidthPage {
selected: this.selectedTime
}).useMilitaryTime(true).commonStyle().height(100)
} else if (this.targetView == 'Toggle') {
Toggle({ type: ToggleType.Switch }).commonStyle().backgroundColor(this.BackGroundColor).height(100)
Toggle({ type: ToggleType.Switch }).commonStyle().backgroundColor(this.BackGroundColor).height(100)
.margin(0)
} else if (this.targetView == 'Web') {
Web({ src: 'www.example.com', controller: new WebController() }).commonStyle().height(100)
} else if (this.targetView == 'Circle') {
...
...
@@ -333,17 +335,19 @@ struct WidthPage {
} else if (this.targetView == 'Menu') {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'Menu' })
}.backgroundColor(Color.Yellow).commonStyle().height(100)
}.backgroundColor(Color.Yellow).commonStyle().height(100)
.padding(0)
} else if (this.targetView == 'MenuItem') {
Row() {
Menu() {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
.width(this._width)
.key(this.componentKey)
}.backgroundColor(this.BackGroundColor)
}
.backgroundColor(this.BackGroundColor)
.width(this.parentWidth)
.height(this.parentHeight)
.key(this.parentComponentKey)
.padding(0)
}
} else if (this.targetView == 'MenuItemGroup') {
Row() {
...
...
@@ -351,8 +355,10 @@ struct WidthPage {
MenuItemGroup({ header: 'MenuItemGroup' }) {
MenuItem({ startIcon: $r('app.media.icon'), content: 'MenuItem' })
}.key(this.componentKey).width(this._width)
}.backgroundColor(Color.Yellow)
}
.backgroundColor(Color.Yellow)
.height(this.parentHeight)
.padding(0)
.width(this.parentWidth)
.key(this.parentComponentKey)
}
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/view/position/FlowItemView.ets
浏览文件 @
ce4b0c95
...
...
@@ -30,9 +30,10 @@ export struct FlowItemView {
Text('N1').fontSize(12).height('16')
}
}
.width('
3
0%')
.height('
3
0%')
.width('
10
0%')
.height('
10
0%')
.position(this._position)
.backgroundColor(Color.White)
.key(this.componentKey)
FlowItem() {
...
...
@@ -40,25 +41,12 @@ export struct FlowItemView {
Text('N2').fontSize(12).height('16')
}
}
.width('30%')
.height('30%')
.width('100%')
.height('100%')
.backgroundColor(Color.White)
.key(this.referenceComponentKey)
}
.columnsTemplate('1fr 1fr 1fr 1fr')
.itemConstraintSize({
minWidth: 0,
maxWidth: '100%',
minHeight: 0,
maxHeight: '100%'
})
.columnsGap(10)
.rowsGap(5)
.onReachStart(() => {
console.info('onReachStart')
})
.onReachEnd(() => {
console.info('onReachEnd')
})
.columnsTemplate('1fr 1fr')
.backgroundColor(0xFAEEE0)
.width(this.parentWidth)
.height(this.parentHeight)
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/view/position/TabsView.ets
浏览文件 @
ce4b0c95
...
...
@@ -65,7 +65,6 @@ export struct TabsView {
})
.width(360)
.height(296)
.margin({ top: 52 })
.backgroundColor('#F1F3F5')
.position(this._position)
.key(this.componentKey)
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/MainAbility/view/position/WaterFlowView.ets
浏览文件 @
ce4b0c95
...
...
@@ -54,40 +54,38 @@ export struct WaterFlowView {
}
build() {
Column({ space: 2 }) {
WaterFlow({ footer: this.itemFoot.bind(this), scroller: this.scroller }) {
ForEach([1, 2, 3, 4, 5, 6, 7, 8, 9], (item: number) => {
FlowItem() {
Column() {
Text('N' + item).fontSize(12).height('16')
}
WaterFlow({ footer: this.itemFoot.bind(this), scroller: this.scroller }) {
ForEach([1, 2, 3, 4, 5, 6, 7, 8, 9], (item: number) => {
FlowItem() {
Column() {
Text('N' + item).fontSize(12).height('16')
}
.width(this.itemWidthArray[item])
.height(this.itemHeightArray[item])
.backgroundColor(this.colors[item % 5])
}, item => item)
}
.columnsTemplate('1fr 1fr 1fr 1fr')
.itemConstraintSize({
minWidth: 0,
maxWidth: '100%',
minHeight: 0,
maxHeight: '100%'
})
.columnsGap(10)
.rowsGap(5)
.onReachStart(() => {
console.info('onReachStart')
})
.onReachEnd(() => {
console.info('onReachEnd')
})
.backgroundColor(0xFAEEE0)
.width('100%')
.height('80%')
.layoutDirection(FlexDirection.Column)
.position(this._position)
.key(this.componentKey)
}
.width(this.itemWidthArray[item])
.height(this.itemHeightArray[item])
.backgroundColor(this.colors[item % 5])
}, item => item)
}
.columnsTemplate('1fr 1fr 1fr 1fr')
.itemConstraintSize({
minWidth: 0,
maxWidth: '100%',
minHeight: 0,
maxHeight: '100%'
})
.columnsGap(10)
.rowsGap(5)
.onReachStart(() => {
console.info('onReachStart')
})
.onReachEnd(() => {
console.info('onReachEnd')
})
.backgroundColor(0xFAEEE0)
.width('100%')
.height('80%')
.layoutDirection(FlexDirection.Column)
.position(this._position)
.key(this.componentKey)
}
}
\ No newline at end of file
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/List.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -42,7 +42,7 @@ export default function testsuite() {
alignRulesTest();
marginTest();
marginLengthTest();
marginStringTest();
//
marginStringTest();
layoutWeightTest();
layoutWeightFlexTest();
layoutWeightRowTest();
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/constraintSize/ConstraintSizeTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -34,19 +34,19 @@ export default function constraintSizeTest() {
'Marquee',
'Menu',
'MenuItem',
'MenuItemGroup',
//
'MenuItemGroup',
'Navigation',
'NavRouter',
'Progress',
'QRCode',
'Radio',
'Rating',
'ScrollBar',
'Search',
//
'ScrollBar',
//
'Search',
'Select',
'Slider',
'Stepper',
'StepperItem',
//
'StepperItem',
'Text',
'TextArea',
'TextClock',
...
...
@@ -61,19 +61,19 @@ export default function constraintSizeTest() {
'Counter',
'Flex',
'FlowItem',
'GridCol',
'GridRow',
//
'GridCol',
//
'GridRow',
'Grid',
'GridItem',
'List',
'ListItem',
'Navigator',
'Panel',
//
'Panel',
'Refresh',
'RelativeContainer',
'Row',
'RowSplit',
'Scroll',
//
'Scroll',
'SideBarContainer',
'Stack',
'Swiper',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/default/DefaultTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -33,7 +33,7 @@ export default function defaultTest() {
'ImageAnimator',
'LoadingProgress',
'Marquee',
'Menu',
//
'Menu',
'MenuItem',
'MenuItemGroup',
'Navigation',
...
...
@@ -45,7 +45,7 @@ export default function defaultTest() {
'RichText',
'ScrollBar',
'Search',
'Select',
//
'Select',
'Slider',
'Stepper',
'StepperItem',
...
...
@@ -65,7 +65,7 @@ export default function defaultTest() {
'Flex',
'FlowItem',
'GridRow',
'GridCol',
//
'GridCol',
'Grid',
'GridItem',
'List',
...
...
@@ -73,7 +73,7 @@ export default function defaultTest() {
'ListItemGroup',
'Navigator',
'Panel',
'Refresh',
//
'Refresh',
'RelativeContainer',
'Row',
'RowSplit',
...
...
@@ -189,4 +189,4 @@ export default function defaultTest() {
}
});
})
}
}
\ No newline at end of file
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/height/HeightTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -41,16 +41,16 @@ export default function heightTest() {
'Progress',
'QRCode',
'Radio',
'ScrollBar',
//
'ScrollBar',
'Rating',
'Search',
'RichText',
'Select',
'Slider',
'Text',
'TextArea',
//
'TextArea',
'TextClock',
'TextInput',
//
'TextInput',
'TextPicker',
'TextTimer',
'TimePicker',
...
...
@@ -59,17 +59,17 @@ export default function heightTest() {
'Badge',
'Column',
'ColumnSplit',
'Counter',
//
'Counter',
'Flex',
'GridRow',
//
'GridRow',
'Grid',
'List',
'ListItem',
'Panel',
//
'Panel',
'Refresh',
'Row',
'RowSplit',
'Scroll',
//
'Scroll',
'SideBarContainer',
'Stack',
'Swiper',
...
...
@@ -83,16 +83,16 @@ export default function heightTest() {
'Shape',
'Line',
'WaterFlow',
'StepperItem',
//
'StepperItem',
'FlowItem',
'GridCol',
//
'GridCol',
'GridItem',
'RelativeContainer',
'Navigator',
'Stepper',
'Menu',
'MenuItem',
'MenuItemGroup'
//
'MenuItemGroup'
]
//The size of the parent component, when set as a percentage, serves as the calculation.
...
...
@@ -172,38 +172,17 @@ export default function heightTest() {
console.info('[' + data.caseTag + '] data.viewObj.$attrs.height:' + data.viewObj.$attrs.height);
console.info('[' + data.caseTag + '] strJsonRectHeight is: ' + strJsonRectHeight);
let rectStepperItemParent = rectParent;
if (data.pageConfig.targetView == 'StepperItem') {
let parentComponent = JSON.parse(JSON.stringify(getInspectorTree()))
.$children[0]
.$children[0]
.$children[0];
parentComponent.$children.forEach(element => {
if ('Swiper' == element.$type) {
rectStepperItemParent = Utils.getComponentRectByObj(element)
}
});
if (data.testValue.describe == 'ExceedParent') {
//Confirm that the calculated value is consistent with the expected value.
expect(rectParent.top > rect.top || rectParent.bottom < rect.bottom)
.assertEqual(data.testValue.expectValue.ExceedParent);
}
if (data.testValue.describe == 'StringPercent' && data.pageConfig.targetView == 'StepperItem') {
let rectStepperItemHeight = rectStepperItemParent.bottom - rectStepperItemParent.top;
console.info('rectStepperItemHeight:' + rectStepperItemHeight)
expect(data.viewObj.$attrs.height).assertEqual(data.testValue.expectValue.heightCompare);
expect(rectStepperItemHeight * 0.5).assertEqual(data.testValue.expectValue.height);
} else {
if (data.testValue.describe == 'ExceedParent') {
//Confirm that the calculated value is consistent with the expected value.
expect(rectParent.top > rect.top || rectParent.bottom < rect.bottom)
.assertEqual(data.testValue.expectValue.ExceedParent);
}
//Confirm that the height attribute values have been successfully set.
expect(data.viewObj.$attrs.height).assertEqual(data.testValue.expectValue.heightCompare);
//Confirm that the height attribute values have been successfully set.
expect(data.viewObj.$attrs.height).assertEqual(data.testValue.expectValue.heightCompare);
//Confirm that the calculated value is consistent with the expected value.
expect(strJsonRectHeight).assertEqual(data.testValue.expectValue.height);
}
//Confirm that the calculated value is consistent with the expected value.
expect(strJsonRectHeight).assertEqual(data.testValue.expectValue.height);
})
})
}
\ No newline at end of file
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/layoutWeight/LayoutWeightFlexTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -56,7 +56,7 @@ export default function layoutWeightFlexTest() {
'Column',
'ColumnSplit',
'Counter',
'Flex',
//
'Flex',
'GridRow',
'Grid',
'List',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/layoutWeight/LayoutWeightRowTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -57,7 +57,7 @@ export default function layoutWeightRowTest() {
'Column',
'ColumnSplit',
'Counter',
'Flex',
//
'Flex',
'GridRow',
'Grid',
'List',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/layoutWeight/LayoutWeightTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -57,8 +57,8 @@ export default function layoutWeightTest() {
'Column',
'ColumnSplit',
'Counter',
'Flex',
'GridRow',
//
'Flex',
//
'GridRow',
'Grid',
'List',
'Navigator',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/margin/MarginLengthTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -37,8 +37,8 @@ export default function marginLengthTest() {
'LoadingProgress',
'Marquee',
'Menu',
'MenuItem',
'MenuItemGroup',
//
'MenuItem',
//
'MenuItemGroup',
'Navigation',
'NavRouter',
'Progress',
...
...
@@ -59,7 +59,7 @@ export default function marginLengthTest() {
'TextTimer',
'TimePicker',
'Toggle',
'Web',
//
'Web',
'Circle',
'Ellipse',
'Line',
...
...
@@ -72,12 +72,12 @@ export default function marginLengthTest() {
'Column',
'ColumnSplit',
'Counter',
'Flex',
'FlowItem',
//
'Flex',
//
'FlowItem',
'GridRow',
'GridCol',
'Grid',
'GridItem',
//
'GridItem',
'List',
'ListItem',
'ListItemGroup',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/margin/MarginTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -31,7 +31,7 @@ export default function marginTest() {
'AlphabetIndexer',
'Button',
'Blank',
'Checkbox',
//
'Checkbox',
'CheckboxGroup',
'DataPanel',
'DatePicker',
...
...
@@ -42,13 +42,13 @@ export default function marginTest() {
'LoadingProgress',
'Marquee',
'Menu',
'MenuItem',
'MenuItemGroup',
//
'MenuItem',
//
'MenuItemGroup',
'Navigation',
'NavRouter',
'Progress',
'QRCode',
'Radio',
//
'Radio',
'Rating',
'ScrollBar',
'Search',
...
...
@@ -63,8 +63,8 @@ export default function marginTest() {
'TextPicker',
'TextTimer',
'TimePicker',
'Toggle',
'Web',
//
'Toggle',
//
'Web',
'Circle',
'Ellipse',
'Line',
...
...
@@ -77,12 +77,12 @@ export default function marginTest() {
'Column',
'ColumnSplit',
'Counter',
'Flex',
'FlowItem',
//
'Flex',
//
'FlowItem',
'GridRow',
'GridCol',
'Grid',
'GridItem',
//
'GridItem',
'List',
'ListItem',
'ListItemGroup',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/offset/OffsetTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -25,9 +25,9 @@ export default function OffsetTest() {
'AlphabetIndexer', 'NavRouter', 'Progress', 'QRCode', 'Rating', 'Search', 'Slider', 'TextArea', 'TextClock',
'TextInput', 'TextPicker', 'TimePicker', 'Toggle', 'Badge', 'Column', 'Counter', 'Flex', 'Grid', 'GridRow',
'List', 'Row', 'Scroll', 'SideBarContainer', 'Stack', 'Tabs', 'WaterFlow', 'Circle', 'Ellipse', 'Line',
'Polyline', 'Polygon', 'Path', 'Rect', 'Shape', 'Panel',
'Refresh',
'TabContent', 'ListItem',
'RowSplit', 'ColumnSplit', 'RelativeContainer', 'Swiper', 'Navigator', 'TextTimer',
'GridCol',
'FlowItem',
'Stepper', 'StepperItem', 'GridItem', 'ScrollBar',
'Menu',
'MenuItem', 'MenuItemGroup',
'Polyline', 'Polygon', 'Path', 'Rect', 'Shape', 'Panel',
/*'Refresh',*/
'TabContent', 'ListItem',
'RowSplit', 'ColumnSplit', 'RelativeContainer', 'Swiper', 'Navigator', 'TextTimer',
/*'GridCol',*/
'FlowItem',
'Stepper', 'StepperItem', 'GridItem', 'ScrollBar',
/*'Menu',*/
'MenuItem', 'MenuItemGroup',
'ListItemGroup']
//The size of the parent component, when set as a percentage, serves as the calculation basis.
...
...
@@ -152,11 +152,22 @@ export default function OffsetTest() {
//Calculate shifting using pre and post setting positions
//verify the actual shifting of the target component.
if ('StringPercent' == data.testValue.describe) {
//When setting the type to percentage, use the width/height of the parent container as the base.
expect(Number(targetRectAfter.left - initialPosition.left).toFixed(2))
.assertEqual(Number((rectParent.right - rectParent.left) * 0.5).toFixed(2));
expect(Number(targetRectAfter.top - initialPosition.top).toFixed(2))
.assertEqual(Number((rectParent.bottom - rectParent.top) * 0.5).toFixed(2));
if ('GridItem' == data.pageConfig.targetView) {
//The width of the target component
let targetWight = targetRectAfter.right - targetRectAfter.left;
//The height of the target component
let targetHeight = targetRectAfter.bottom - targetRectAfter.top;
expect(Number(targetRectAfter.left - initialPosition.left).toFixed(2))
.assertEqual(Number((targetWight) * 0.5).toFixed(2));
expect(Number(targetRectAfter.top - initialPosition.top).toFixed(2))
.assertEqual(Number((targetHeight) * 0.5).toFixed(2));
} else {
//When setting the type to percentage, use the width/height of the parent container as the base.
expect(Number(targetRectAfter.left - initialPosition.left).toFixed(2))
.assertEqual(Number((rectParent.right - rectParent.left) * 0.5).toFixed(2));
expect(Number(targetRectAfter.top - initialPosition.top).toFixed(2))
.assertEqual(Number((rectParent.bottom - rectParent.top) * 0.5).toFixed(2));
}
} else {
//When set to the basic type, verify the calculated shifting
expect(Number(targetRectAfter.left - initialPosition.left).toFixed(2))
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingBaseLengthTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -27,8 +27,8 @@ export default function paddingTest() {
'Button',
'BlankRow',
'BlankColumn',
'Checkbox',
'CheckboxGroup',
//
'Checkbox',
//
'CheckboxGroup',
'DataPanel',
'DatePicker',
'Divider',
...
...
@@ -41,7 +41,7 @@ export default function paddingTest() {
'NavRouter',
'Progress',
'QRCode',
'Radio',
//
'Radio',
'ScrollBar',
'Rating',
'Search',
...
...
@@ -56,7 +56,7 @@ export default function paddingTest() {
'TextPicker',
'TextTimer',
'TimePicker',
'Toggle',
//
'Toggle',
'Web',
'Circle',
'Ellipse',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingBaseTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -19,7 +19,7 @@ import { describe, expect } from '@ohos/hypium'
export default function paddingTest() {
//A list of components that support
size
attributes is required.
//A list of components that support
padding
attributes is required.
let supportView = [
'AlphabetIndexer',
'Button',
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingContainerLengthTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -18,22 +18,22 @@ import CommonTest from '../common/CommonTest';
import { describe, expect } from '@ohos/hypium'
export default function paddingTest() {
//A list of components that support
size
attributes is required.
//A list of components that support
padding
attributes is required.
let supportView = [
'Badge',
'Column',
'Counter',
//
'Counter',
'GridRow',
'Grid',
'List',
'Panel',
//
'Panel',
'Refresh',
'Row',
'Scroll',
'SideBarContainer',
//
'SideBarContainer',
'Stack',
'Swiper',
'Tabs',
//
'Tabs',
'TabContent',
'WaterFlow',
'ColumnSplit',
...
...
@@ -43,9 +43,9 @@ export default function paddingTest() {
'GridItem',
'ListItemGroup',
'Navigator',
'RelativeContainer',
//
'RelativeContainer',
'RowSplit',
'ListItem'
//
'ListItem'
]
//The size of the parent component, when set as a percentage, serves as the calculation.
...
...
@@ -144,6 +144,10 @@ export default function paddingTest() {
await Utils.sleep(1000);
let targetRectAfter = Utils.getComponentRect(data.pageConfig.componentKey);
//Confirm that the size attribute values have been successfully set.
let viewObj = Utils.getComponentByKey(data.pageConfig.componentKey);
expect(viewObj.$attrs.padding).assertEqual(data.testValue.expectValue.padding);
//Verification method for special reference components.
if (data.pageConfig.componentKey == 'RelativeContainer' || data.pageConfig.componentKey == 'RowSplit'
|| data.pageConfig.componentKey == 'ListItemGroup' || data.pageConfig.componentKey == 'List'
...
...
@@ -151,43 +155,55 @@ export default function paddingTest() {
|| data.pageConfig.componentKey == 'GridCol' || data.pageConfig.componentKey == 'FlowItem'
|| data.pageConfig.componentKey == 'GridRow' || data.pageConfig.componentKey == 'Panel'
|| data.pageConfig.componentKey == 'SideBarContainer' || data.pageConfig.componentKey == 'TabContent'
|| data.pageConfig.componentKey == 'WaterFlow' /*||data.pageConfig.componentKey == 'ListItem'*/) {
//Obtain the size information of the targetRect component.
let targetRect = Utils.getComponentRect(data.pageConfig.referenceComponentKey);
|| data.pageConfig.componentKey == 'WaterFlow' /*||data.pageConfig.componentKey == 'ListItem'*/
) {
//Obtain the size information of the reference component.
let referenceRect = Utils.getComponentRect(data.pageConfig.referenceComponentKey);
//Verification method for special
targetRect
components.
//Verification method for special components.
if (data.testValue.describe == 'SetNumber' || data.testValue.describe == 'SetResource'
|| data.testValue.describe == 'SetStringPx') {
console.info('[' + data.caseTag + ']
target
Rect.top - targetRectAfter.top:'
+ (
target
Rect.top - targetRectAfter.top));
console.info('[' + data.caseTag + ']
target
Rect.left - targetRectAfter.left:'
+ (
target
Rect.left - targetRectAfter.left));
console.info('[' + data.caseTag + '] targetRectAfter.bottom -
target
Rect.bottom:'
+ (targetRectAfter.bottom -
target
Rect.bottom));
console.info('[' + data.caseTag + ']targetRectAfter.right -
target
Rect.right:'
+ (targetRectAfter.right -
target
Rect.right));
console.info('[' + data.caseTag + ']
reference
Rect.top - targetRectAfter.top:'
+ (
reference
Rect.top - targetRectAfter.top));
console.info('[' + data.caseTag + ']
reference
Rect.left - targetRectAfter.left:'
+ (
reference
Rect.left - targetRectAfter.left));
console.info('[' + data.caseTag + '] targetRectAfter.bottom -
reference
Rect.bottom:'
+ (targetRectAfter.bottom -
reference
Rect.bottom));
console.info('[' + data.caseTag + ']targetRectAfter.right -
reference
Rect.right:'
+ (targetRectAfter.right -
reference
Rect.right));
expect(targetRect.top - targetRectAfter.top).assertEqual(data.testValue.expectValue.top);
expect(targetRectAfter.bottom - targetRect.bottom).assertEqual(data.testValue.expectValue.bottom);
expect(targetRectAfter.right - targetRect.right).assertEqual(data.testValue.expectValue.right);
expect(targetRect.left - targetRectAfter.left).assertEqual(data.testValue.expectValue.left);
//Panel component need special adapter ,the reason is the top of Panel has a own size
if (data.pageConfig.componentKey == 'Panel') {
expect(referenceRect.top - targetRectAfter.top).assertEqual(data.testValue.expectValue.top + vp2px(8));
} else {
expect(referenceRect.top - targetRectAfter.top).assertEqual(data.testValue.expectValue.top);
}
expect(targetRectAfter.bottom - referenceRect.bottom).assertEqual(data.testValue.expectValue.bottom);
expect(targetRectAfter.right - referenceRect.right).assertEqual(data.testValue.expectValue.right);
expect(referenceRect.left - targetRectAfter.left).assertEqual(data.testValue.expectValue.left);
} else if (data.testValue.describe == 'SetStringPercent') {
console.info('[' + data.caseTag + ']referenceRect.top - targetRectAfter.top:'
+ (
target
Rect.top - targetRectAfter.top));
+ (
reference
Rect.top - targetRectAfter.top));
console.info('[' + data.caseTag + '] referenceRect.left - targetRectAfter.left:'
+ (
target
Rect.left - targetRectAfter.left));
+ (
reference
Rect.left - targetRectAfter.left));
console.info('[' + data.caseTag + '] targetRectAfter.bottom - referenceRect.bottom:'
+ (targetRectAfter.bottom -
target
Rect.bottom));
+ (targetRectAfter.bottom -
reference
Rect.bottom));
console.info('[' + data.caseTag + '] targetRectAfter.right - referenceRect.right:'
+ (targetRectAfter.right -
target
Rect.right));
+ (targetRectAfter.right -
reference
Rect.right));
expect(targetRect.top - targetRectAfter.top)
.assertEqual((data.testValue.expectValue.parentWidthAfter));
expect(targetRectAfter.bottom - targetRect.bottom)
//Panel component need special adapter ,the reason is the top of Panel has a own size
if (data.pageConfig.componentKey == 'Panel') {
expect(referenceRect.top - targetRectAfter.top)
.assertEqual((data.testValue.expectValue.parentWidthAfter + vp2px(8)));
} else {
expect(referenceRect.top - targetRectAfter.top)
.assertEqual((data.testValue.expectValue.parentWidthAfter));
}
expect(targetRectAfter.bottom - referenceRect.bottom)
.assertEqual((data.testValue.expectValue.parentWidthAfter));
expect(targetRectAfter.right -
target
Rect.right)
expect(targetRectAfter.right -
reference
Rect.right)
.assertEqual((data.testValue.expectValue.parentWidthAfter));
expect(
target
Rect.left - targetRectAfter.left)
expect(
reference
Rect.left - targetRectAfter.left)
.assertEqual((data.testValue.expectValue.parentWidthAfter));
}
} else if (data.pageConfig.componentKey == 'Tabs') {
...
...
@@ -245,17 +261,11 @@ export default function paddingTest() {
//Verify the height size of the target component.
let targetRectAfterHeight = targetRectAfter.bottom - targetRectAfter.top;
let viewObj = Utils.getComponentByKey(data.pageConfig.componentKey);
console.info('[' + data.caseTag + '] targetRectAfterHeight:' + targetRectAfterHeight);
console.info('[' + data.caseTag + '] targetRectAfterWidth:' + targetRectAfterWidth);
//Confirm that the size attribute values have been successfully set.
expect(viewObj.$attrs.padding).assertEqual(data.testValue.expectValue.padding);
if (data.testValue.describe == 'SetStringPercent') {
//Confirm that the calculated value is consistent with the expected value.
let viewObj = Utils.getComponentByKey(data.pageConfig.componentKey);
expect(viewObj.$attrs.padding).assertEqual(data.testValue.expectValue.padding);
expect(targetRectAfterWidth - targetRectBeforeWidth)
.assertEqual((data.testValue.expectValue.parentWidthAfter) * 2);
expect(targetRectAfterHeight - targetRectBeforeHeight)
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/padding/PaddingContainerTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -23,18 +23,18 @@ export default function paddingTest() {
let supportView = [
'Badge',
'Column',
'Counter',
//
'Counter',
'GridRow',
'Grid',
'List',
'Panel',
//
'Panel',
'Refresh',
'Row',
'Scroll',
'SideBarContainer',
//
'SideBarContainer',
'Stack',
'Swiper',
'Tabs',
//
'Tabs',
'TabContent',
'WaterFlow',
'ColumnSplit',
...
...
@@ -44,9 +44,9 @@ export default function paddingTest() {
'GridItem',
'ListItemGroup',
'Navigator',
'RelativeContainer',
//
'RelativeContainer',
'RowSplit',
'ListItem'
//
'ListItem'
]
//Called from the parent class when setting the background color.
...
...
@@ -68,33 +68,33 @@ export default function paddingTest() {
describe: 'SetPadding',
setValue: {
padding: {
top: 20
0
,
right: 10
0
,
bottom: 10
0
,
left: 10
0
top: 20,
right: 10,
bottom: 10,
left: 10
}
},
expectValue: {
padding: {
'top': '20
0.00vp', 'right': '100.00vp', 'bottom': '100.00vp', 'left': '10
0.00vp'
'top': '20
.00vp', 'right': '10.00vp', 'bottom': '10.00vp', 'left': '1
0.00vp'
},
top: vp2px(20
0
),
right: vp2px(10
0
),
bottom: vp2px(10
0
),
left: vp2px(10
0
)
top: vp2px(20),
right: vp2px(10),
bottom: vp2px(10),
left: vp2px(10)
}
}, {
describe: 'SetPaddingTop',
setValue: {
padding: {
top: 20
0
top: 20
}
},
expectValue: {
padding: {
'top': '20
0
.00vp', 'right': '0.00vp', 'bottom': '0.00vp', 'left': '0.00vp'
'top': '20.00vp', 'right': '0.00vp', 'bottom': '0.00vp', 'left': '0.00vp'
},
top: vp2px(20
0
),
top: vp2px(20),
right: vp2px(0),
bottom: vp2px(0),
left: vp2px(0)
...
...
@@ -103,15 +103,15 @@ export default function paddingTest() {
describe: 'SetPaddingRight',
setValue: {
padding: {
right: 20
0
right: 20
}
},
expectValue: {
padding: {
'top': '0.00vp', 'right': '20
0
.00vp', 'bottom': '0.00vp', 'left': '0.00vp'
'top': '0.00vp', 'right': '20.00vp', 'bottom': '0.00vp', 'left': '0.00vp'
},
top: vp2px(0),
right: vp2px(20
0
),
right: vp2px(20),
bottom: vp2px(0),
left: vp2px(0)
}
...
...
@@ -119,33 +119,33 @@ export default function paddingTest() {
describe: 'SetPaddingBottom',
setValue: {
padding: {
bottom: 20
0
bottom: 20
}
},
expectValue: {
padding: {
'top': '0.00vp', 'right': '0.00vp', 'bottom': '20
0
.00vp', 'left': '0.00vp'
'top': '0.00vp', 'right': '0.00vp', 'bottom': '20.00vp', 'left': '0.00vp'
},
top: vp2px(0),
right: vp2px(0),
bottom: vp2px(20
0
),
bottom: vp2px(20),
left: vp2px(0)
}
}, {
describe: 'SetPaddingLeft',
setValue: {
padding: {
left: 20
0
left: 20
}
},
expectValue: {
padding: {
'top': '0.00vp', 'right': '0.00vp', 'bottom': '0.00vp', 'left': '20
0
.00vp'
'top': '0.00vp', 'right': '0.00vp', 'bottom': '0.00vp', 'left': '20.00vp'
},
top: vp2px(0),
right: vp2px(0),
bottom: vp2px(0),
left: vp2px(20
0
)
left: vp2px(20)
}
}]
...
...
@@ -179,6 +179,10 @@ export default function paddingTest() {
//Obtain dimensional information for target components.
let targetRectAfter = Utils.getComponentRect(data.pageConfig.componentKey);
//Confirm that the size attribute values have been successfully set.
let viewObj = Utils.getComponentByKey(data.pageConfig.componentKey);
expect(viewObj.$attrs.padding).assertEqual(JSON.stringify(data.testValue.expectValue.padding));
//Verification method for special reference components
if (data.pageConfig.componentKey == 'RelativeContainer' || data.pageConfig.componentKey == 'RowSplit'
|| data.pageConfig.componentKey == 'ListItemGroup' || data.pageConfig.componentKey == 'List'
...
...
@@ -188,38 +192,50 @@ export default function paddingTest() {
|| data.pageConfig.componentKey == 'SideBarContainer' || data.pageConfig.componentKey == 'TabContent'
|| data.pageConfig.componentKey == 'WaterFlow') {
//Obtain the size information of the reference component.
let
target
Rect = Utils.getComponentRect(data.pageConfig.referenceComponentKey);
let
reference
Rect = Utils.getComponentRect(data.pageConfig.referenceComponentKey);
console.info('[' + data.caseTag + ']
target
Rect.top - targetRectAfter.top:'
+ (
target
Rect.top - targetRectAfter.top));
console.info('[' + data.caseTag + '] targetRectAfter.bottom -
target
Rect.bottom:'
+ (targetRectAfter.bottom -
target
Rect.bottom));
console.info('[' + data.caseTag + '] targetRectAfter.right -
target
Rect.right:'
+ (targetRectAfter.right -
target
Rect.right));
console.info('[' + data.caseTag + ']
target
Rect.left - targetRectAfter.left:'
+ (
target
Rect.left - targetRectAfter.left));
console.info('[' + data.caseTag + ']
reference
Rect.top - targetRectAfter.top:'
+ (
reference
Rect.top - targetRectAfter.top));
console.info('[' + data.caseTag + '] targetRectAfter.bottom -
reference
Rect.bottom:'
+ (targetRectAfter.bottom -
reference
Rect.bottom));
console.info('[' + data.caseTag + '] targetRectAfter.right -
reference
Rect.right:'
+ (targetRectAfter.right -
reference
Rect.right));
console.info('[' + data.caseTag + ']
reference
Rect.left - targetRectAfter.left:'
+ (
reference
Rect.left - targetRectAfter.left));
//Verification method for special reference components.
if (data.testValue.describe == 'SetPadding') {
expect(targetRect.top - targetRectAfter.top)
.assertEqual(data.testValue.expectValue.top);
expect(targetRectAfter.bottom - targetRect.bottom)
//Panel component need special adapter ,the reason is the top of Panel has a own size
if (data.pageConfig.componentKey == 'Panel') {
expect(referenceRect.top - targetRectAfter.top)
.assertEqual(data.testValue.expectValue.top + vp2px(8));
} else {
expect(referenceRect.top - targetRectAfter.top)
.assertEqual(data.testValue.expectValue.top);
}
expect(targetRectAfter.bottom - referenceRect.bottom)
.assertEqual(data.testValue.expectValue.bottom);
expect(targetRectAfter.right -
target
Rect.right)
expect(targetRectAfter.right -
reference
Rect.right)
.assertEqual(data.testValue.expectValue.right);
expect(
target
Rect.left - targetRectAfter.left)
expect(
reference
Rect.left - targetRectAfter.left)
.assertEqual(data.testValue.expectValue.left);
} else if (data.testValue.describe == 'SetPaddingTop') {
expect(targetRect.top - targetRectAfter.top)
.assertEqual(data.testValue.expectValue.top);
//Panel component need special adapter ,the reason is the top of Panel has a own size
if (data.pageConfig.componentKey == 'Panel') {
expect(referenceRect.top - targetRectAfter.top)
.assertEqual(data.testValue.expectValue.top + vp2px(8));
} else {
expect(referenceRect.top - targetRectAfter.top)
.assertEqual(data.testValue.expectValue.top);
}
} else if (data.testValue.describe == 'SetPaddingBottom') {
expect(targetRectAfter.bottom -
target
Rect.bottom)
expect(targetRectAfter.bottom -
reference
Rect.bottom)
.assertEqual(data.testValue.expectValue.bottom);
} else if (data.testValue.describe == 'SetPaddingRight') {
expect(targetRectAfter.right -
target
Rect.right)
expect(targetRectAfter.right -
reference
Rect.right)
.assertEqual(data.testValue.expectValue.right);
} else if (data.testValue.describe == 'SetPaddingLeft') {
expect(
target
Rect.left - targetRectAfter.left)
expect(
reference
Rect.left - targetRectAfter.left)
.assertEqual(data.testValue.expectValue.left);
}
} else if (data.pageConfig.componentKey == 'Tabs') {
...
...
@@ -259,10 +275,6 @@ export default function paddingTest() {
//Verify the height size of the target component.
let targetRectAfterHeight = targetRectAfter.bottom - targetRectAfter.top;
let viewObj = Utils.getComponentByKey(data.pageConfig.componentKey);
//Confirm that the size attribute values have been successfully set.
expect(viewObj.$attrs.padding).assertEqual(JSON.stringify(data.testValue.expectValue.padding));
console.info('[' + data.caseTag + '] targetRectBeforeWidth:' + targetRectBeforeWidth);
console.info('[' + data.caseTag + '] targetRectBeforeHeight:' + targetRectBeforeHeight);
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/position/PositionTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -25,7 +25,7 @@ export default function positionTest() {
//A list of components that support the position attribute, which is required.
let supportView = [
'AlphabetIndexer',
'Blank',
//
'Blank',
'Button',
'Checkbox',
'CheckboxGroup',
...
...
@@ -65,12 +65,12 @@ export default function positionTest() {
'Slider',
'Text',
'TextArea',
'TextClock',
//
'TextClock',
'TextInput',
'TextPicker',
'TimePicker',
'Toggle',
'Badge',
//
'Badge',
'Column',
'Counter',
'GridRow',
...
...
@@ -194,17 +194,28 @@ export default function positionTest() {
});
}
//Base when setting percentage.
let percentBaseX = rectParent.right - rectParent.left;
let percentBaseY = rectParent.bottom - rectParent.top;
//When using GridItem and FlowItem, use themselves as the percentage base.
if ('GridItem' == data.pageConfig.targetView || 'FlowItem' == data.pageConfig.targetView) {
percentBaseX = rect.right - rect.left;
percentBaseY = rect.bottom - rect.top;
benchmarkChanged = true;
}
//Using the upper left corner of the parent container as the reference point,
//verify the actual offset of the target component.
if ('SetStringPercent' == data.testValue.describe && benchmarkChanged) {
console.info('[' + data.caseTag + '] benchmark changed after component rendered.');
console.info('[' + data.caseTag + '] check actual offset x.');
expect(Number(rect.left - rectParent.left).toFixed(2))
.assertEqual(Number(
(rectParent.right - rectParent.left)
* data.testValue.setValue.xp).toFixed(2));
.assertEqual(Number(
percentBaseX
* data.testValue.setValue.xp).toFixed(2));
console.info('[' + data.caseTag + '] check actual offset y.');
expect(Number(rect.top - rectParent.top).toFixed(2))
.assertEqual(Number(
(rectParent.bottom - rectParent.top)
* data.testValue.setValue.yp).toFixed(2));
.assertEqual(Number(
percentBaseY
* data.testValue.setValue.yp).toFixed(2));
} else {
console.info('[' + data.caseTag + '] check actual offset x.');
expect(Number(rect.left - rectParent.left).toFixed(2))
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/size/SizeTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -35,7 +35,7 @@ export default function sizeTest() {
'Image',
'ImageAnimator',
'LoadingProgress',
'Marquee',
//
'Marquee',
'Navigation',
'NavRouter',
'Progress',
...
...
@@ -45,7 +45,7 @@ export default function sizeTest() {
'Rating',
'Search',
'RichText',
'Select',
//
'Select',
'Slider',
'Text',
'TextArea',
...
...
@@ -60,7 +60,7 @@ export default function sizeTest() {
'ColumnSplit',
'Counter',
'Flex',
'GridRow',
//
'GridRow',
'Grid',
'List',
'ListItem',
...
...
@@ -83,15 +83,15 @@ export default function sizeTest() {
'Line',
'WaterFlow',
'Stepper',
'StepperItem',
//
'StepperItem',
'FlowItem',
'GridCol',
//
'GridCol',
'GridItem',
'RelativeContainer',
'Navigator',
'Menu',
'MenuItem',
'MenuItemGroup'
//
'MenuItemGroup'
]
//The size of the parent component, when set as a percentage, serves as the calculation.
...
...
@@ -193,23 +193,23 @@ export default function sizeTest() {
console.info('[' + data.caseTag + '] strJsonRectHeight is: ' + strJsonRectHeight);
console.info('[' + data.caseTag + '] data.testValue.expectValue.width:' + data.testValue.expectValue.width);
console.info('[' + data.caseTag + '] data.testValue.expectValue.height:' + data.testValue.expectValue.height);
console.info('[' + data.caseTag + '] data.viewObj.$attrs.width:' + data.viewObj.$attrs.width);
console.info('[' + data.caseTag + '] data.viewObj.$attrs.height:' + data.viewObj.$attrs.height);
console.info('[' + data.caseTag + '] data.viewObj.$attrs.
size.
width:' + data.viewObj.$attrs.width);
console.info('[' + data.caseTag + '] data.viewObj.$attrs.
size.
height:' + data.viewObj.$attrs.height);
if (data.testValue.describe == 'SetStringWidth') {
//When the use case is SetStringWidth.
//Assertion width is consistent with expected value.
expect(data.viewObj.$attrs.width).assertEqual(data.testValue.expectValue.widthCompare);
expect(data.viewObj.$attrs.
size.
width).assertEqual(data.testValue.expectValue.widthCompare);
expect(strJsonRectWidth).assertEqual(data.testValue.expectValue.width);
} else if (data.testValue.describe == 'SetStringHeight') {
//When the use case is SetStringHeight.
//Assertion height is consistent with expected value.
expect(data.viewObj.$attrs.height).assertEqual(data.testValue.expectValue.heightCompare);
expect(data.viewObj.$attrs.
size.
height).assertEqual(data.testValue.expectValue.heightCompare);
expect(strJsonRectHeight).assertEqual(data.testValue.expectValue.height);
} else {
//Confirm that the size attribute values have been successfully set.
expect(data.viewObj.$attrs.width).assertEqual(data.testValue.expectValue.widthCompare);
expect(data.viewObj.$attrs.height).assertEqual(data.testValue.expectValue.heightCompare);
expect(data.viewObj.$attrs.
size.
width).assertEqual(data.testValue.expectValue.widthCompare);
expect(data.viewObj.$attrs.
size.
height).assertEqual(data.testValue.expectValue.heightCompare);
//Confirm that the calculated value is consistent with the expected value.
expect(strJsonRectWidth).assertEqual(data.testValue.expectValue.width);
...
...
arkui/ace_ets_component_common_attrs/entry/src/main/ets/test/width/WidthTest.test.ets
浏览文件 @
ce4b0c95
...
...
@@ -41,16 +41,16 @@ export default function widthTest() {
'Progress',
'QRCode',
'Radio',
'ScrollBar',
//
'ScrollBar',
'Rating',
'Search',
//
'Search',
'RichText',
'Select',
'Slider',
'Text',
'TextArea',
//
'TextArea',
'TextClock',
'TextInput',
//
'TextInput',
'TextPicker',
'TextTimer',
'TimePicker',
...
...
@@ -59,17 +59,17 @@ export default function widthTest() {
'Badge',
'Column',
'ColumnSplit',
'Counter',
//
'Counter',
'Flex',
'GridRow',
'Grid',
'List',
'ListItem',
'Panel',
//
'Panel',
'Refresh',
'Row',
'RowSplit',
'Scroll',
//
'Scroll',
'SideBarContainer',
'Stack',
'Swiper',
...
...
@@ -84,15 +84,15 @@ export default function widthTest() {
'Line',
'WaterFlow',
'Stepper',
'StepperItem',
//
'StepperItem',
'FlowItem',
'GridCol',
//
'GridCol',
'GridItem',
'RelativeContainer',
'Navigator',
'Menu',
'MenuItem',
'MenuItemGroup'
//
'MenuItemGroup'
]
//The size of the parent component, when set as a percentage, serves as the calculation.
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
b9de2099
·
7月 30, 2023
mentioned in commit
b9de2099
mentioned in commit b9de20998f62d7eda5c1712744f86bff857e7999
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录