未验证 提交 a557c882 编写于 作者: O openharmony_ci 提交者: Gitee

!7452 test:add flex_Wrap_Wrap xts_acts testcase part2

Merge pull request !7452 from 李伟明/flex_wrap_1
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_DisplayPriority{
@State firstTextPriority: number = 1;
@State secondTextPriority: number = 1;
@State thirdTextPriority: number = 1;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_DisplayPriority onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'firstTextPriority') {
this.firstTextPriority = message.value;
}
if (message.name == 'secondTextPriority') {
this.secondTextPriority = message.value;
}
if (message.name == 'thirdTextPriority') {
this.thirdTextPriority = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
// 子组件设置DisplayPriority
Flex({wrap:FlexWrap.Wrap}){
Text('1').width(150).height(100).backgroundColor(0xF5DEB3)
.displayPriority(this.firstTextPriority).key('Wrap_DisplayPriority01');
Text('2').width(150).height(150).backgroundColor(0xD2B48C)
.displayPriority(this.secondTextPriority).key('Wrap_DisplayPriority02');
Text('3').width(300).height(200).backgroundColor(0xF5DEB3)
.displayPriority(this.thirdTextPriority).key('Wrap_DisplayPriority03');
}
.width(500)
.height(400)
.backgroundColor(0xAFEEEE)
.key('FlexWrap_DisplayPriority_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_FlexMarPad_TextMarPad{
@State firstTextPadding: number = 0;
@State secondTextPadding: number = 0;
@State thirdTextPadding: number = 0;
@State firstTextMargin: number = 0;
@State secondTextMargin: number = 0;
@State thirdTextMargin: number = 0;
@State flexMargin: number = 0;
@State flexPadding: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_FlexMarPad_TextMarPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'firstTextPadding') {
this.firstTextPadding = message.value;
}
if (message.name == 'secondTextPadding') {
this.secondTextPadding = message.value;
}
if (message.name == 'thirdTextPadding') {
this.thirdTextPadding = message.value;
}
if (message.name == 'firstTextMargin') {
this.firstTextMargin = message.value;
}
if (message.name == 'secondTextMargin') {
this.secondTextMargin = message.value;
}
if (message.name == 'thirdTextMargin') {
this.thirdTextMargin = message.value;
}
if (message.name == 'flexMargin') {
this.flexMargin = message.value;
}
if (message.name == 'flexPadding') {
this.flexPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.firstTextMargin)
.padding(this.firstTextPadding).key('Wrap_FlexMarPad_TextPad1');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).margin(this.secondTextMargin)
.padding(this.secondTextPadding).key('Wrap_FlexMarPad_TextPad2');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).margin(this.thirdTextMargin)
.padding(this.thirdTextPadding).key('Wrap_FlexMarPad_TextPad3');
}
.width(500)
.height(300)
.margin(this.flexMargin)
.padding(this.flexPadding)
.backgroundColor(0xAFEEEE)
.key('FlexWrap_FlexMarPad_TextMarPad_Container01')
}
.width('100%')
.height('100%')
.alignItems(HorizontalAlign.Start)
.key('Column_Wrap_FlexMarPad_TextMarPad_Container01')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_FlexMar_TextMarPad{
@State firstTextPadding: number = 0;
@State secondTextPadding: number = 0;
@State thirdTextPadding: number = 0;
@State firstTextMargin: number = 0;
@State secondTextMargin: number = 0;
@State thirdTextMargin: number = 0;
@State flexMargin: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_FlexMar_TextMarPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'firstTextPadding') {
this.firstTextPadding = message.value;
}
if (message.name == 'secondTextPadding') {
this.secondTextPadding = message.value;
}
if (message.name == 'thirdTextPadding') {
this.thirdTextPadding = message.value;
}
if (message.name == 'firstTextMargin') {
this.firstTextMargin = message.value;
}
if (message.name == 'secondTextMargin') {
this.secondTextMargin = message.value;
}
if (message.name == 'thirdTextMargin') {
this.thirdTextMargin = message.value;
}
if (message.name == 'flexMargin') {
this.flexMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.firstTextMargin)
.padding(this.firstTextPadding).key('Wrap_FlexMar_TextPad1');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).margin(this.secondTextMargin)
.padding(this.secondTextPadding).key('Wrap_FlexMar_TextPad2');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).margin(this.thirdTextMargin)
.padding(this.thirdTextPadding).key('Wrap_FlexMar_TextPad3');
}
.width(500)
.height(300)
.margin(this.flexMargin)
.backgroundColor(0xAFEEEE)
.key('Wrap_FlexMar_TextMarPad_Container01')
}
.width('100%')
.height('100%')
.alignItems(HorizontalAlign.Start)
.key('Column_Wrap_FlexMar_TextMarPad_Container')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_FlexPad_TextMarPad{
@State firstTextPadding: number = 0;
@State secondTextPadding: number = 0;
@State thirdTextPadding: number = 0;
@State firstTextMargin: number = 0;
@State secondTextMargin: number = 0;
@State thirdTextMargin: number = 0;
@State flexPadding: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_FlexPad_TextMarPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'firstTextPadding') {
this.firstTextPadding = message.value;
}
if (message.name == 'secondTextPadding') {
this.secondTextPadding = message.value;
}
if (message.name == 'thirdTextPadding') {
this.thirdTextPadding = message.value;
}
if (message.name == 'firstTextMargin') {
this.firstTextMargin = message.value;
}
if (message.name == 'secondTextMargin') {
this.secondTextMargin = message.value;
}
if (message.name == 'thirdTextMargin') {
this.thirdTextMargin = message.value;
}
if (message.name == 'flexPadding') {
this.flexPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.firstTextMargin)
.padding(this.firstTextPadding).key('Wrap_FlexPad_TextMarPad1');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).margin(this.secondTextMargin)
.padding(this.secondTextPadding).key('Wrap_FlexPad_TextMarPad2');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).margin(this.thirdTextMargin)
.padding(this.thirdTextPadding).key('Wrap_FlexPad_TextMarPad3');
}
.width(500)
.height(300)
.padding(this.flexPadding)
.backgroundColor(0xAFEEEE)
.key('Wrap_FlexPad_TextMarPad_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_FlexSize{
@State testWidth: number = 400;
@State testHeight: number = 100;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_FlexSize onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'width') {
this.testWidth = message.value;
}
if (message.name == 'height') {
this.testHeight = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:10}){
Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('Wrap_flexSize_Text1');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('Wrap_flexSize_Text2');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('Wrap_flexSize_Text3');
}
.width(this.testWidth)
.height(this.testHeight)
.backgroundColor(0xAFEEEE)
.key('Wrap_FlexSize_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_layoutWeight{
@State firstTextLayoutWeight: number = 1;
@State secondTextLayoutWeight: number = 1;
@State thirdTextLayoutWeight: number = 1;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_layoutWeight onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'firstTextLayoutWeight') {
this.firstTextLayoutWeight = message.value;
}
if (message.name == 'secondTextLayoutWeight') {
this.secondTextLayoutWeight = message.value;
}
if (message.name == 'thirdTextLayoutWeight') {
this.thirdTextLayoutWeight = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
Text('1').width(150).height(100).backgroundColor(0xF5DEB3)
.layoutWeight(this.firstTextLayoutWeight).key('Wrap_LayoutWeight01');
Text('2').width(150).height(150).backgroundColor(0xD2B48C)
.layoutWeight(this.secondTextLayoutWeight).key('Wrap_LayoutWeight02');
Text('3').width(150).height(200).backgroundColor(0xF5DEB3)
.layoutWeight(this.thirdTextLayoutWeight).key('Wrap_LayoutWeight03');
}
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
.key('Flex_Wrap_layoutWeight_Container01')
}.width('100%').height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_FlexPad_TextMarPad{
@State flexMargin: number = 0;
@State flexPadding: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_FlexPad_TextMarPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'flexMargin') {
this.flexMargin = message.value;
}
if (message.name == 'flexPadding') {
this.flexPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('Wrap_flex_pad1');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('Wrap_flex_pad2');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('Wrap_flex_pad3');
}
.width(500)
.height(300)
.padding(this.flexPadding)
.margin(this.flexMargin)
.backgroundColor(0xAFEEEE)
.key('Flex_Wrap_Pad_Container01')
}
.width('100%')
.height('100%')
.key('Column_Wrap_FlexPad_Container01')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_Position{
@State testPosition: object = {x:0, y:0};
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_Position onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'position') {
this.testPosition = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('Wrap_Position01').position(this.testPosition);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('Wrap_Position02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('Wrap_Position03');
}
.width(500)
.height(300)
.backgroundColor(0xAFEEEE)
.key('Flex_Wrap_Position_Container01')
}.width('100%').height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_TextSize{
@State testWidth: number = 100;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Flex_Wrap_TextSize onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'width') {
this.testWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:10}){
Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){
Text('1').width(this.testWidth).height(50).backgroundColor(0xF5DEB3).key('Wrap_flex_TextSize1');
Text('2').width(this.testWidth).height(100).backgroundColor(0xD2B48C).key('Wrap_flex_TextSize2');
Text('3').width(this.testWidth).height(150).backgroundColor(0xF5DEB3).key('Wrap_flex_TextSize3');
}
.width(500)
.height(300)
.backgroundColor(0xAFEEEE)
.key('Flex_Wrap_TextSize_Container01')
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Flex_Wrap_Visibility{
@State testVisibility: number = Visibility.Visible;
@State firstTextWidth: number = 150;
@State secondTextWidth: number = 150;
@State thirdTextWidth: number = 150;
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('Flex_Wrap_Visibility onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'visibility') {
this.testVisibility = message.value;
}
if (message.name == 'firstTextWidth') {
this.firstTextWidth = message.value;
}
if (message.name == 'secondTextWidth') {
this.secondTextWidth = message.value;
}
if (message.name == 'secondTextWidth') {
this.thirdTextWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
Text('1').width(this.firstTextWidth).height(100).backgroundColor(0xF5DEB3)
.visibility(this.testVisibility).key('Wrap_Text_Visibility1');
Text('2').width(this.secondTextWidth).height(150).backgroundColor(0xD2B48C).key('Wrap_Text_Visibility2');
Text('3').width(this.thirdTextWidth).height(200).backgroundColor(0xF5DEB3).key('Wrap_Text_Visibility3');
}
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
.key('Flex_Wrap_Visibility_Container01')
}.width('100%').height('100%')
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册