提交 7427ad9e 编写于 作者: W wmlih

test:Revision review comments about ace_ets_layout_test

Signed-off-by: Nwmlih <wmlih@isoftstone.com>
上级 6c7300dc
......@@ -13,19 +13,19 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../common/MessageManager';
import { MessageManager, Callback } from './../../../common/MessageManager';
@Entry
@Component
struct Column_Space {
@State addSpace: number = 10
messageManager:MessageManager = new MessageManager()
@State addSpace: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Column_Space onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
......@@ -34,9 +34,9 @@ struct Column_Space {
}
build() {
Column({space:this.addSpace}) {
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('Column_Space_011')
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_Space_012')
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('Column_Space_013')
Column(){Text('1')}.width(300).height(50).backgroundColor(0xF5DEB3).key('Column_Space_011');
Column(){Text('2')}.width(300).height(100).backgroundColor(0xD2B48C).key('Column_Space_012');
Column(){Text('3')}.width(300).height(150).backgroundColor(0xF5DEB3).key('Column_Space_013');
}.key('Column_Space_01').width(350).height(400).backgroundColor(0xAFEEEE)
}
}
......@@ -61,8 +61,8 @@ struct Flex_NoWrap_FlexMarPad_TextMarPad{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.NoWrap}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.NoWrap }){
Text('1').width(150).height(100).backgroundColor(0xF5DEB3).margin(this.firstTextMargin)
.padding(this.firstTextPadding).key('NoWrap_FlexMarPad_TextPad1');
Text('2').width(150).height(150).backgroundColor(0xD2B48C).margin(this.secondTextMargin)
......
......@@ -26,7 +26,7 @@ struct Flex_NoWrap_FlexMar_TextMarPad{
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('Flex_NoWrap_FlexMar_TextMarPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
......
......@@ -57,8 +57,8 @@ struct Flex_NoWrap_FlexPad_TextMarPad{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.NoWrap}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.NoWrap }){
Text('1').width(150).height(100).backgroundColor(0xF5DEB3).margin(this.firstTextMargin)
.padding(this.firstTextPadding).key('NoWrap_FlexPad_TextMarPad1');
Text('2').width(150).height(150).backgroundColor(0xD2B48C).margin(this.secondTextMargin)
......
......@@ -41,9 +41,8 @@ struct Flex_Wrap_DisplayPriority{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
// 子组件设置DisplayPriority
Flex({wrap:FlexWrap.Wrap}){
Column({ space:30 }){
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)
......
......@@ -61,8 +61,8 @@ struct Flex_Wrap_FlexMarPad_TextMarPad{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
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)
......
......@@ -57,8 +57,8 @@ struct Flex_Wrap_FlexMar_TextMarPad{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
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)
......
......@@ -57,8 +57,8 @@ struct Flex_Wrap_FlexPad_TextMarPad{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
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)
......
......@@ -37,8 +37,8 @@ struct Flex_Wrap_FlexSize{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:10}){
Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){
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');
......
......@@ -41,8 +41,8 @@ struct Flex_Wrap_layoutWeight{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
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)
......
......@@ -37,8 +37,8 @@ struct Flex_Wrap_FlexPad_TextMarPad{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){
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');
......
......@@ -33,8 +33,8 @@ struct Flex_Wrap_Position{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
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');
......
......@@ -33,8 +33,8 @@ struct Flex_Wrap_TextSize{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:10}){
Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){
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');
......
......@@ -47,8 +47,8 @@ struct Flex_Wrap_Visibility{
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap}){
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');
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_04{
@State testMargin: number = 0
struct FlexAlign_SpaceAround_FlexMar{
@State testMargin: number = 0;
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('FlexAlign_SpaceAround_FlexMar onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
......@@ -33,12 +33,12 @@ struct FlexAlignContent_SpaceAround_04{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMar01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMar02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMar03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMar04')
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMar01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMar02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMar03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMar04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_03{
struct FlexAlign_SpaceAround_FlexMarPad{
@State testPadding: number = 0;
@State testMargin: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('FlexAlign_SpaceAround_FlexMarPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
......@@ -36,12 +36,12 @@ struct FlexAlignContent_SpaceAround_03{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMarPad01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMarPad02')
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMarPad03')
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMarPad04')
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMarPad01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMarPad02');
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexMarPad03');
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexMarPad04');
}
.width(200)
.height(540)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_02{
@State testPadding: number = 0
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceAround_FlexPad{
@State testPadding: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_02 onPageShow');
console.info('FlexAlign_SpaceAround_FlexPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
......@@ -33,12 +33,12 @@ struct FlexAlignContent_SpaceAround_02{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexPad01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexPad02')
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexPad03')
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexPad04')
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexPad01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexPad02');
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexPad03');
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexPad04');
}
.width(200)
.height(540)
......
......@@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_01{
@State testWidth: number = 400
@State testHeight: number = 100
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceAround_FlexSize{
@State testWidth: number = 400;
@State testHeight: number = 100;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('FlexAlign_SpaceAround_FlexSize onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'width') {
this.testWidth = message.value;
}
......@@ -37,12 +37,12 @@ struct FlexAlignContent_SpaceAround_01{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexSize01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexSize02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexSize03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexSize04')
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexSize01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexSize02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_FlexSize03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_FlexSize04');
}
.width(this.testWidth)
.height(this.testHeight)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_04{
struct FlexAlign_SpaceAround_TextMar{
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('FlexAlign_SpaceAround_TextMar onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
......@@ -33,17 +33,17 @@ struct FlexAlignContent_SpaceAround_04{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.margin(this.testMargin)
.key('AlignContent_SpaceAround_TextMar01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextMar02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextMar03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextMar04')
.key('AlignContent_SpaceAround_TextMar01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextMar02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextMar03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextMar04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_05{
@State testOffset: object = {x:0, y:0}
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceAround_TextOffset{
@State testOffset: object = { x:0, y:0 };
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('FlexAlign_SpaceAround_TextOffset onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'offset') {
this.testOffset = message.value;
}
......@@ -33,17 +33,17 @@ struct FlexAlignContent_SpaceAround_05{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.offset(this.testOffset)
.key('AlignContent_SpaceAround_TextOffset01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextOffset02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextOffset03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextOffset04')
.key('AlignContent_SpaceAround_TextOffset01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextOffset02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextOffset03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextOffset04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_06{
@State testHeight: number = 50
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceAround_TextSize{
@State testHeight: number = 50;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('FlexAlign_SpaceAround_TextSize onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'height') {
this.testHeight = message.value;
}
......@@ -33,16 +33,16 @@ struct FlexAlignContent_SpaceAround_06{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1')
.width(150)
.height(this.testHeight)
.backgroundColor(0xD2B48C)
.key('AlignContent_SpaceAround_TextSize01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextSize02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextSize03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextSize04')
.key('AlignContent_SpaceAround_TextSize01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextSize02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextSize03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextSize04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceAround_07{
@State testVisibility: number = Visibility.Visible
messageManager:MessageManager = new MessageManager()
struct AlignContent_SpaceAround_TextVisibility{
@State testVisibility: number = Visibility.Visible;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceAround_01 onPageShow');
console.info('AlignContent_SpaceAround_TextVisibility onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'visibility') {
this.testVisibility = message.value;
}
......@@ -33,17 +33,17 @@ struct FlexAlignContent_SpaceAround_07{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent:FlexAlign.SpaceAround }){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.key('AlignContent_SpaceAround_TextVisibility01')
.visibility(this.testVisibility)
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextVisibility02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextVisibility03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextVisibility04')
.visibility(this.testVisibility);
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextVisibility02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceAround_TextVisibility03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceAround_TextVisibility04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_04{
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceBetween_FlexMar{
@State testMargin: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_FlexMar onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
......@@ -35,10 +35,10 @@ struct FlexAlignContent_SpaceBetween_04{
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMar01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMar02')
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMar03')
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMar04')
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMar01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMar02');
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMar03');
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMar04');
}
.width(200)
.height(540)
......
......@@ -15,17 +15,17 @@
import {MessageManager,Callback} from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_03{
struct FlexAlign_SpaceBetween_FlexMarPad{
@State testPadding: number = 0;
@State testMargin: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_FlexMarPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
......@@ -36,12 +36,12 @@ struct FlexAlignContent_SpaceBetween_03{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMarPad01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMarPad02')
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMarPad03')
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMarPad04')
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMarPad01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMarPad02');
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexMarPad03');
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexMarPad04');
}
.width(200)
.height(540)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_02{
@State testPadding: number = 0
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceBetween_FlexPad{
@State testPadding: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_FlexPad onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
......@@ -34,11 +34,11 @@ struct FlexAlignContent_SpaceBetween_02{
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexPad01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexPad02')
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexPad03')
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexPad04')
Flex({ wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexPad01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexPad02');
Text('3').width(150).height(150).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexPad03');
Text('4').width(150).height(200).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexPad04');
}
.width(200)
.height(540)
......
......@@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_01{
struct FlexAlign_SpaceBetween_FlexSize{
@State testWidth: number = 400
@State testHeight: number = 100
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_FlexSize onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'width') {
this.testWidth = message.value;
}
......@@ -37,12 +37,12 @@ struct FlexAlignContent_SpaceBetween_01{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexSize01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexSize02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexSize03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexSize04')
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }){
Text('1').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexSize01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexSize02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_FlexSize03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_FlexSize04');
}
.width(this.testWidth)
.height(this.testHeight)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_04{
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceBetween_TextMar{
@State testMargin: number = 0;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_TextMar onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
......@@ -33,17 +33,17 @@ struct FlexAlignContent_SpaceBetween_04{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.margin(this.testMargin)
.key('AlignContent_SpaceBetween_TextMar01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextMar02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextMar03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextMar04')
.key('AlignContent_SpaceBetween_TextMar01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextMar02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextMar03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextMar04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_05{
struct FlexAlign_SpaceBetween_TextOffset{
@State testOffset: object = {x:0, y:0}
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_TextOffset onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'offset') {
this.testOffset = message.value;
}
......@@ -33,17 +33,17 @@ struct FlexAlignContent_SpaceBetween_05{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.offset(this.testOffset)
.key('AlignContent_SpaceBetween_TextOffset01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextOffset02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextOffset03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextOffset04')
.key('AlignContent_SpaceBetween_TextOffset01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextOffset02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextOffset03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextOffset04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_06{
@State testHeight: number = 50
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceBetween_TextSize{
@State testHeight: number = 50;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_TextSize onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'height') {
this.testHeight = message.value;
}
......@@ -33,16 +33,16 @@ struct FlexAlignContent_SpaceBetween_06{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }){
Text('1')
.width(150)
.height(this.testHeight)
.backgroundColor(0xD2B48C)
.key('AlignContent_SpaceBetween_TextSize01')
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextSize02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextSize03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextSize04')
.key('AlignContent_SpaceBetween_TextSize01');
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextSize02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextSize03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextSize04');
}
.width(200)
.height(400)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexAlignContent_SpaceBetween_07{
@State testVisibility: number = Visibility.Visible
messageManager:MessageManager = new MessageManager()
struct FlexAlign_SpaceBetween_TextVisibility{
@State testVisibility: number = Visibility.Visible;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('FlexAlignContent_SpaceBetween_01 onPageShow');
console.info('FlexAlign_SpaceBetween_TextVisibility onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'visibility') {
this.testVisibility = message.value;
}
......@@ -33,17 +33,17 @@ struct FlexAlignContent_SpaceBetween_07{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
Flex({wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween}){
Column({ space:30 }){
Flex({ wrap:FlexWrap.Wrap, alignContent: FlexAlign.SpaceBetween }){
Text('1')
.width(150)
.height(50)
.backgroundColor(0xD2B48C)
.key('AlignContent_SpaceBetween_TextVisibility01')
.visibility(this.testVisibility)
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextVisibility02')
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextVisibility03')
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextVisibility04')
.visibility(this.testVisibility);
Text('2').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextVisibility02');
Text('3').width(150).height(50).backgroundColor(0xD2B48C).key('AlignContent_SpaceBetween_TextVisibility03');
Text('4').width(150).height(100).backgroundColor(0xF5DEB3).key('AlignContent_SpaceBetween_TextVisibility04');
}
.width(200)
.height(400)
......
......@@ -16,9 +16,9 @@
@Entry
@Component
struct FlexAlignSelf_Auto {
private content: string = "FlexAlignSelf_Auto Page"
private content: string = "FlexAlignSelf_Auto Page";
onPageShow() {
console.info('FlexAlignSelf_Center page show called');
console.info('FlexAlignSelf_Auto page show called');
}
onBuildDone() {
......@@ -28,15 +28,15 @@ struct FlexAlignSelf_Auto {
build() {
Column() {
Column() {
Text('FlexTest12').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexTest12').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).alignSelf(ItemAlign.End).key('textAlignSelf01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textAlignSelf02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textAlignSelf03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).alignSelf(ItemAlign.End).key('textAlignSelf01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textAlignSelf02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textAlignSelf03');
}
.key('flexAlignSelf')
.height(150)
......
......@@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexBase_Auto {
@State testHeight: number = 150
@State testWidth: number = 450
messageManager:MessageManager = new MessageManager()
private content: string = "FlexBase_Auto Page"
@State testHeight: number = 150;
@State testWidth: number = 450;
messageManager:MessageManager = new MessageManager();
private content: string = "FlexBase_Auto Page";
onPageShow() {
console.info('FlexBase_Center onPageShow');
console.info('FlexBase_Auto onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'height') {
this.testHeight = message.value;
}
......@@ -45,15 +45,15 @@ struct FlexBase_Auto {
build() {
Column() {
Column() {
Text('FlexBase_1').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexBase_1').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textFlex01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textFlex02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textFlex03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textFlex01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textFlex02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textFlex03');
}
.key('flex01')
.height(this.testHeight)
......
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexExceed_Auto {
......@@ -21,12 +21,12 @@ struct FlexExceed_Auto {
messageManager:MessageManager = new MessageManager()
private content: string = "FlexExceed_Auto Page"
onPageShow() {
console.info('FlexBase_Center onPageShow');
console.info('FlexExceed_Auto onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
......@@ -44,15 +44,15 @@ struct FlexExceed_Auto {
build() {
Column() {
Column() {
Text('FlexExceed_1').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexExceed_1').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textExceed01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textExceed02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textExceed03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textExceed01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textExceed02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textExceed03');
}
.key('flexExceed01')
.height(200)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexHeightModify_Auto {
@State testHeight: number = 50
messageManager:MessageManager = new MessageManager()
private content: string = "FlexHeightModify_Auto Page"
@State testHeight: number = 50;
messageManager:MessageManager = new MessageManager();
private content: string = "FlexHeightModify_Auto Page";
onPageShow() {
console.info('FlexHeightModify_Auto onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'height') {
this.testHeight = message.value;
}
......@@ -40,15 +40,15 @@ struct FlexHeightModify_Auto {
build() {
Column() {
Column() {
Text('FlexHeightModify').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexHeightModify').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(this.testHeight).backgroundColor(0xF5DEB3).key('textHeightModify01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textHeightModify02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textHeightModify03')
Text('1').width(150).height(this.testHeight).backgroundColor(0xF5DEB3).key('textHeightModify01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textHeightModify02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textHeightModify03');
}
.key('flexHeightModify')
.height(150)
......
......@@ -17,7 +17,7 @@
@Component
struct FlexMargin_Auto {
private content: string = "FlexMargin_Auto Page"
private content: string = "FlexMargin_Auto Page";
onPageShow() {
console.info('FlexMargin_Center page show called');
}
......@@ -29,15 +29,15 @@ struct FlexMargin_Auto {
build() {
Column() {
Column() {
Text('FlexTest05').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexTest05').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textFlexMargin01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textFlexMargin02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textFlexMargin03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textFlexMargin01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textFlexMargin02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textFlexMargin03');
}
.key('flexMargin')
.height(200)
......
......@@ -16,7 +16,7 @@
@Entry
@Component
struct FlexOffset_Auto {
private content: string = "FlexOffset_Auto Page"
private content: string = "FlexOffset_Auto Page";
onPageShow() {
console.info('FlexOffset_Auto page show called');
......@@ -29,15 +29,15 @@ struct FlexOffset_Auto {
build() {
Column() {
Column() {
Text('FlexTest09').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexTest09').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).offset({ x: 15, y: 30 }).key('textOffset01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textOffset02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textOffset03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).offset({ x: 15, y: 30 }).key('textOffset01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textOffset02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textOffset03');
}
.key('flexOffset')
.height(150)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexPadding_Auto {
@State testPadding: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexPadding_Auto Page"
@State testPadding: number = 0;
messageManager:MessageManager = new MessageManager();
private content: string = "FlexPadding_Auto Page";
onPageShow() {
console.info('FlexBase_Center onPageShow');
console.info('FlexPadding_Auto onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'padding') {
this.testPadding = message.value;
}
......@@ -40,15 +40,15 @@ struct FlexPadding_Auto {
build() {
Column() {
Column() {
Text('FlexPadding_1').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexPadding_1').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textFlexPadding01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textFlexPadding02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textFlexPadding03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textFlexPadding01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textFlexPadding02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textFlexPadding03');
}
.key('flexPadding01')
.height(200)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexTextMargin_Auto {
@State testMargin: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "FlexTextMargin_Auto Page"
@State testMargin: number = 0;
messageManager:MessageManager = new MessageManager();
private content: string = "FlexTextMargin_Auto Page";
onPageShow() {
console.info('FlexBase_Center onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'margin') {
this.testMargin = message.value;
}
......@@ -40,15 +40,15 @@ struct FlexTextMargin_Auto {
build() {
Column() {
Column() {
Text('FlexTextMargin_1').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexTextMargin_1').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.testMargin).key('textMargin01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textMargin02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textMargin03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.testMargin).key('textMargin01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textMargin02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textMargin03');
}
.key('flexTextMargin01')
.height(150)
......
......@@ -12,20 +12,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct FlexVisibility_Auto {
@State testVisibility: number = Visibility.Visible
messageManager:MessageManager = new MessageManager()
private content: string = "FlexVisibility_Auto Page"
@State testVisibility: number = Visibility.Visible;
messageManager:MessageManager = new MessageManager();
private content: string = "FlexVisibility_Auto Page";
onPageShow() {
console.info('FlexVisibility_Auto onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'visibility') {
this.testVisibility = message.value;
}
......@@ -39,15 +39,15 @@ struct FlexVisibility_Auto {
build() {
Column() {
Column() {
Text('FlexTest10').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('FlexTest10').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({
direction: FlexDirection.Row,
alignItems: ItemAlign.Auto,
wrap: FlexWrap.NoWrap,
}) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).visibility(this.testVisibility).key('textVisible01')
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textVisible02')
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textVisible03')
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).visibility(this.testVisibility).key('textVisible01');
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textVisible02');
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textVisible03');
}
.key('flexVisible')
.height(150)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager'
import { MessageManager, Callback } from './../../../../common/MessageManager'
@Entry
@Component
struct AlignCenter_AddAlign {
@State DadAddAlign: number = Alignment.TopStart
messageManager:MessageManager = new MessageManager()
@State DadAddAlign: number = Alignment.TopStart;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow')
console.info('AlignCenter_AddAlign onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAddAlign') {
this.DadAddAlign = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Center
@State justifyContent: FlexAlign = FlexAlign.Center;
build() {
Column() {
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddAlign_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddAlign_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddAlign_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddAlign_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddAlign_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddAlign_013");
}
.key("Center_AddAlign_01")
.width(500)
......
......@@ -13,32 +13,32 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddAllSpace {
@State DadAllSpace: number = 10
messageManager:MessageManager = new MessageManager()
@State DadAllSpace: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddAllSpace onPageShow');
console.info('AlignCenter_AddAllSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAllSpace') {
this.DadAllSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Center
@State justifyContent: FlexAlign = FlexAlign.Center;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddAllSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddAllSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_013");
}
.key("Center_AddAllSpace_01")
.width(500)
......
......@@ -13,21 +13,21 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddLayoutWeight {
@State OneLayoutWeight1: number = 1;
@State OneLayoutWeight2: number = 1;
@State OneLayoutWeight3: number = 1;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddLayoutWeight onPageShow');
console.info('AlignCenter_AddLayoutWeight onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneLayoutWeight1') {
this.OneLayoutWeight1 = message.value;
}
......@@ -43,18 +43,18 @@ struct AlignCenter_AddLayoutWeight {
@State justifyContent: FlexAlign = FlexAlign.Center
build() {
Column() {
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("Center_AddLayoutWeight_011")
.layoutWeight(this.OneLayoutWeight1)
.layoutWeight(this.OneLayoutWeight1);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddLayoutWeight_012")
.layoutWeight(this.OneLayoutWeight2)
.layoutWeight(this.OneLayoutWeight2);
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddLayoutWeight_013")
.layoutWeight(this.OneLayoutWeight3)
.layoutWeight(this.OneLayoutWeight3);
}
.key("Center_AddLayoutWeight_01")
.width(500)
......
......@@ -13,19 +13,19 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddMargin {
@State DadMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State DadMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddMargin onPageShow');
console.info('AlignCenter_AddMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadMargin') {
this.DadMargin = message.value;
}
......@@ -36,9 +36,9 @@ struct AlignCenter_AddMargin {
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddMargin_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddMargin_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddMargin_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddMargin_013");
}
.key("Center_AddMargin_01")
.width(500)
......
......@@ -13,19 +13,19 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddOffset {
@State OneOffset: object = { x: 0, y: 0 }
messageManager:MessageManager = new MessageManager()
@State OneOffset: object = { x: 0, y: 0 };
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOffset onPageShow');
console.info('AlignCenter_AddOffset onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneOffset') {
this.OneOffset = message.value;
}
......@@ -35,12 +35,12 @@ struct AlignCenter_AddOffset {
@State justifyContent: FlexAlign = FlexAlign.Center
build() {
Column() {
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddOffset_011")
.offset(this.OneOffset)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddOffset_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddOffset_013")
.offset(this.OneOffset);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddOffset_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddOffset_013");
}
.key("Center_AddOffset_01")
.width(500)
......
......@@ -13,19 +13,19 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddOneMargin {
@State OneMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State OneMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOneMargin onPageShow');
console.info('AlignCenter_AddOneMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneMargin') {
this.OneMargin = message.value;
}
......@@ -41,9 +41,9 @@ struct AlignCenter_AddOneMargin {
.height(50)
.backgroundColor(0xF5DEB3)
.key("Center_AddOneMargin_011")
.margin(this.OneMargin)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddOneMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddOneMargin_013")
.margin(this.OneMargin);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddOneMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddOneMargin_013");
}
.key("Center_AddOneMargin_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddOneWidth {
@State OneWidth: number = 100
messageManager:MessageManager = new MessageManager()
@State OneWidth: number = 100;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOneWidth onPageShow');
console.info('AlignCenter_AddOneWidth onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneWidth') {
this.OneWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Center
@State justifyContent: FlexAlign = FlexAlign.Center;
build() {
Column() {
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("Center_AddOneWidth_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddOneWidth_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddOneWidth_013")
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("Center_AddOneWidth_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddOneWidth_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddOneWidth_013");
}
.key("Center_AddOneWidth_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddPadding {
@State DadPadding: number = 10
messageManager:MessageManager = new MessageManager()
@State DadPadding: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddPadding onPageShow');
console.info('AlignCenter_AddPadding onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadPadding') {
this.DadPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Center
@State justifyContent: FlexAlign = FlexAlign.Center;
build() {
Column() {
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddPadding_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddPadding_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddPadding_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddPadding_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddPadding_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddPadding_013");
}.key("Center_AddPadding_01")
.width(500)
.height(200)
......
......@@ -13,38 +13,38 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_AddVisibility {
@State OneVisibility: number = Visibility.Visible;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddVisibility onPageShow');
console.info('AlignCenter_AddVisibility onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneVisibility') {
this.OneVisibility = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Center
@State justifyContent: FlexAlign = FlexAlign.Center;
build() {
Column() {
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("Center_AddVisibility_011")
.visibility(this.OneVisibility)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddVisibility_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddVisibility_013")
.visibility(this.OneVisibility);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddVisibility_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddVisibility_013");
}
.key("Center_AddVisibility_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignCenter_NoSpace {
@State DadWidth: number = 200
messageManager:MessageManager = new MessageManager()
@State DadWidth: number = 200;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignCenter_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadWidth') {
this.DadWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Center
@State justifyContent: FlexAlign = FlexAlign.Center;
build() {
Column() {
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_NoSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_NoSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_NoSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_NoSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_NoSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_NoSpace_013");
}
.key("Center_NoSpace_01")
.width(this.DadWidth)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddAlign {
@State DadAddAlign: number = Alignment.TopStart
messageManager:MessageManager = new MessageManager()
@State DadAddAlign: number = Alignment.TopStart;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddAlign onPageShow');
console.info('AlignEnd_AddAlign onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAddAlign') {
this.DadAddAlign = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddAlign_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddAlign_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddAlign_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddAlign_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddAlign_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddAlign_013");
}
.key("End_AddAlign_01")
.width(500)
......
......@@ -13,32 +13,32 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddAllSpace {
@State DadAllSpace: number = 10
messageManager:MessageManager = new MessageManager()
@State DadAllSpace: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddAllSpace onPageShow');
console.info('AlignEnd_AddAllSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAllSpace') {
this.DadAllSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddAllSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddAllSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddAllSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddAllSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddAllSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddAllSpace_013");
}
.key("End_AddAllSpace_01")
.width(500)
......
......@@ -13,21 +13,21 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddLayoutWeight {
@State OneLayoutWeight1: number = 1;
@State OneLayoutWeight2: number = 1;
@State OneLayoutWeight3: number = 1;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddLayoutWeight onPageShow');
console.info('AlignEnd_AddLayoutWeight onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneLayoutWeight1') {
this.OneLayoutWeight1 = message.value;
}
......@@ -41,21 +41,21 @@ struct AlignEnd_AddLayoutWeight {
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("End_AddLayoutWeight_011")
.layoutWeight( this.OneLayoutWeight1)
.layoutWeight( this.OneLayoutWeight1);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddLayoutWeight_012")
.layoutWeight( this.OneLayoutWeight2)
.layoutWeight( this.OneLayoutWeight2);
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddLayoutWeight_013")
.layoutWeight( this.OneLayoutWeight3)
.layoutWeight( this.OneLayoutWeight3);
}
.key("End_AddLayoutWeight_01")
.width(500)
......
......@@ -13,32 +13,32 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddMargin {
@State DadMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State DadMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddMargin onPageShow');
console.info('AlignEnd_AddMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadMargin') {
this.DadMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddMargin_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddMargin_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddMargin_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddMargin_013");
}
.key("End_AddMargin_01")
.width(500)
......
......@@ -13,34 +13,34 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddOffset {
@State OneOffset: object = { x: 0, y: 0 }
messageManager:MessageManager = new MessageManager()
@State OneOffset: object = { x: 0, y: 0 };
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOffset onPageShow');
console.info('AlignEnd_AddOffset onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneOffset') {
this.OneOffset = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddOffset_011")
.offset(this.OneOffset)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOffset_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOffset_013")
.offset(this.OneOffset);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOffset_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOffset_013");
}
.key("End_AddOffset_01")
.width(500)
......
......@@ -13,26 +13,26 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddOneMargin {
@State OneMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State OneMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOneMargin onPageShow');
console.info('AlignEnd_AddOneMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneMargin') {
this.OneMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
......@@ -41,9 +41,9 @@ struct AlignEnd_AddOneMargin {
.height(50)
.backgroundColor(0xF5DEB3)
.key("End_AddOneMargin_011")
.margin(this.OneMargin)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOneMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOneMargin_013")
.margin(this.OneMargin);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOneMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOneMargin_013");
}
.key("End_AddOneMargin_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddOneWidth {
@State OneWidth: number = 100
messageManager:MessageManager = new MessageManager()
@State OneWidth: number = 100;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOneWidth onPageShow');
console.info('AlignEnd_AddOneWidth onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneWidth') {
this.OneWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("End_AddOneWidth_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOneWidth_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOneWidth_013")
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("End_AddOneWidth_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddOneWidth_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddOneWidth_013");
}
.key("End_AddOneWidth_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddPadding {
@State DadPadding: number = 10
messageManager:MessageManager = new MessageManager()
@State DadPadding: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddPadding onPageShow');
console.info('AlignEnd_AddPadding onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadPadding') {
this.DadPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddPadding_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddPadding_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddPadding_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_AddPadding_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddPadding_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddPadding_013");
}.key("End_AddPadding_01")
.width(500)
.height(200)
......
......@@ -13,38 +13,38 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_AddVisibility {
@State OneVisibility: number = Visibility.Visible;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddVisibility onPageShow');
console.info('AlignEnd_AddVisibility onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneVisibility') {
this.OneVisibility = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("End_AddVisibility_011")
.visibility(this.OneVisibility)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddVisibility_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddVisibility_013")
.visibility(this.OneVisibility);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_AddVisibility_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_AddVisibility_013");
}
.key("End_AddVisibility_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignEnd_NoSpace {
@State DadWidth: number = 200
messageManager:MessageManager = new MessageManager()
@State DadWidth: number = 200;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignEnd_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadWidth') {
this.DadWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.End
@State justifyContent: FlexAlign = FlexAlign.End;
build() {
Column() {
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.End').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_NoSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_NoSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_NoSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("End_NoSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("End_NoSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("End_NoSpace_013");
}
.key("End_NoSpace_01")
.width(this.DadWidth)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddAlign {
@State DadAddAlign: number = Alignment.TopStart;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignSpaceEvenly_AddAlign onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAddAlign') {
this.DadAddAlign = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAlign_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddAlign_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAlign_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAlign_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddAlign_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAlign_013");
}
.key("SpaceEvenly_AddAlign_01")
.width(500)
......
......@@ -13,32 +13,32 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddAllSpace {
@State DadAllSpace: number = 10
messageManager:MessageManager = new MessageManager()
@State DadAllSpace: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddAllSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAllSpace') {
this.DadAllSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAllSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddAllSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAllSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAllSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddAllSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddAllSpace_013");
}
.key("SpaceEvenly_AddAllSpace_01")
.width(500)
......
......@@ -13,21 +13,21 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddLayoutWeight {
@State OneLayoutWeight1: number = 1;
@State OneLayoutWeight2: number = 1;
@State OneLayoutWeight3: number = 1;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignSpaceEvenly_AddLayoutWeight onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneLayoutWeight1') {
this.OneLayoutWeight1 = message.value;
}
......@@ -40,7 +40,7 @@ struct AlignSpaceEvenly_AddLayoutWeight {
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
......@@ -49,19 +49,19 @@ struct AlignSpaceEvenly_AddLayoutWeight {
.height(50)
.backgroundColor(0xF5DEB3)
.key("SpaceEvenly_AddLayoutWeight_011")
.layoutWeight(this.OneLayoutWeight1)
.layoutWeight(this.OneLayoutWeight1);
Text('2')
.width(150)
.height(100)
.backgroundColor(0xD2B48C)
.key("SpaceEvenly_AddLayoutWeight_012")
.layoutWeight(this.OneLayoutWeight2)
.layoutWeight(this.OneLayoutWeight2);
Text('3')
.width(150)
.height(150)
.backgroundColor(0xF5DEB3)
.key("SpaceEvenly_AddLayoutWeight_013")
.layoutWeight(this.OneLayoutWeight3)
.layoutWeight(this.OneLayoutWeight3);
}
.key("SpaceEvenly_AddLayoutWeight_01")
.width(500)
......
......@@ -13,32 +13,32 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddMargin {
@State DadMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State DadMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadMargin') {
this.DadMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddMargin_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddMargin_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddMargin_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddMargin_013");
}
.key("SpaceEvenly_AddMargin_01")
.width(500)
......
......@@ -13,34 +13,34 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddOffset {
@State OneOffset: object = { x: 0, y: 0 }
messageManager:MessageManager = new MessageManager()
@State OneOffset: object = { x: 0, y: 0 };
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignSpaceEvenly_AddOffset onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneOffset') {
this.OneOffset = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOffset_011")
.offset(this.OneOffset)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddOffset_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOffset_013")
.offset(this.OneOffset);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddOffset_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOffset_013");
}
.key("SpaceEvenly_AddOffset_01")
.width(500)
......
......@@ -13,26 +13,26 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddOneMargin {
@State OneMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State OneMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOneMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneMargin') {
this.OneMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
......@@ -41,9 +41,9 @@ struct AlignSpaceEvenly_AddOneMargin {
.height(50)
.backgroundColor(0xF5DEB3)
.key("SpaceEvenly_AddOneMargin_011")
.margin(this.OneMargin)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddOneMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOneMargin_013")
.margin(this.OneMargin);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddOneMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOneMargin_013");
}
.key("SpaceEvenly_AddOneMargin_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import { MessageManager,Callback } from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddOneWidth {
@State OneWidth: number = 100
messageManager:MessageManager = new MessageManager()
@State OneWidth: number = 100;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneWidth') {
this.OneWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOneWidth_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddOneWidth_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOneWidth_013")
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOneWidth_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddOneWidth_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddOneWidth_013");
}
.key("SpaceEvenly_AddOneWidth_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddPadding {
@State DadPadding: number = 10
messageManager:MessageManager = new MessageManager()
@State DadPadding: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddPadding onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadPadding') {
this.DadPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddPadding_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddPadding_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddPadding_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddPadding_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddPadding_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddPadding_013");
}
.key("SpaceEvenly_AddPadding_01")
.width(500)
......
......@@ -13,38 +13,38 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_AddVisibility {
@State OneVisibility: number = Visibility.Visible;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddVisibility onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneVisibility') {
this.OneVisibility = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("SpaceEvenly_AddVisibility_011")
.visibility(this.OneVisibility)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddVisibility_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddVisibility_013")
.visibility(this.OneVisibility);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_AddVisibility_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_AddVisibility_013");
}
.key("SpaceEvenly_AddVisibility_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignSpaceEvenly_NoSpace {
@State DadWidth: number = 200
messageManager:MessageManager = new MessageManager()
@State DadWidth: number = 200;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadWidth') {
this.DadWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly
@State justifyContent: FlexAlign = FlexAlign.SpaceEvenly;
build() {
Column() {
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.SpaceEvenly').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_NoSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_NoSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_NoSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("SpaceEvenly_NoSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("SpaceEvenly_NoSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("SpaceEvenly_NoSpace_013");
}
.key("SpaceEvenly_NoSpace_01")
.width(this.DadWidth)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddAlign {
@State DadAddAlign: number = Alignment.TopStart
messageManager:MessageManager = new MessageManager()
@State DadAddAlign: number = Alignment.TopStart;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignStart_AddAlign onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAddAlign') {
this.DadAddAlign = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddAlign_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddAlign_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddAlign_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddAlign_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddAlign_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddAlign_013");
}
.key("Start_AddAlign_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddAllSpace {
@State DadAllSpace: number = 10
messageManager: MessageManager = new MessageManager()
@State DadAllSpace: number = 10;
messageManager: MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddAllSpace onPageShow');
console.info('AlignStart_AddAllSpace onPageShow');
globalThis.value = {
name: 'messageManager', message: this.messageManager
}
let callback: Callback = (message: any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadAllSpace') {
this.DadAllSpace = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddAllSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddAllSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddAllSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddAllSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddAllSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddAllSpace_013");
}
.key("Start_AddAllSpace_01")
.width(500)
......
......@@ -13,21 +13,21 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddLayoutWeight {
@State OneLayoutWeight1: number = 1;
@State OneLayoutWeight2: number = 1;
@State OneLayoutWeight3: number = 1;
messageManager:MessageManager = new MessageManager()
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignStart_AddLayoutWeight onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneLayoutWeight1') {
this.OneLayoutWeight1 = message.value;
}
......@@ -43,18 +43,18 @@ struct AlignStart_AddLayoutWeight {
@State justifyContent: FlexAlign = FlexAlign.Start
build() {
Column() {
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("Start_AddLayoutWeight_011")
.layoutWeight(this.OneLayoutWeight1)
.layoutWeight(this.OneLayoutWeight1);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddLayoutWeight_012")
.layoutWeight(this.OneLayoutWeight2)
.layoutWeight(this.OneLayoutWeight2);
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddLayoutWeight_013")
.layoutWeight(this.OneLayoutWeight3)
.layoutWeight(this.OneLayoutWeight3);
}
.key("Start_AddLayoutWeight_01")
.width(500)
......
......@@ -13,32 +13,32 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddMargin {
@State DadMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State DadMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddMargin onPageShow');
console.info('AlignStart_AddMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadMargin') {
this.DadMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddMargin_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddMargin_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddMargin_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddMargin_013");
}
.key("Start_AddMargin_01")
.width(500)
......
......@@ -13,34 +13,34 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddOffset {
@State OneOffset: object = { x: 0, y: 0 }
messageManager:MessageManager = new MessageManager()
@State OneOffset: object = { x: 0, y: 0 };
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOffset onPageShow');
console.info('AlignStart_AddOffset onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneOffset') {
this.OneOffset = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddOffset_011")
.offset(this.OneOffset)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddOffset_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddOffset_013")
.offset(this.OneOffset);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddOffset_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddOffset_013");
}
.key("Start_AddOffset_01")
.width(500)
......
......@@ -13,26 +13,26 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddOneMargin {
@State OneMargin: number = 10
messageManager:MessageManager = new MessageManager()
@State OneMargin: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddOneMargin onPageShow');
console.info('AlignStart_AddOneMargin onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneMargin') {
this.OneMargin = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
......@@ -41,9 +41,9 @@ struct AlignStart_AddOneMargin {
.height(50)
.backgroundColor(0xF5DEB3)
.key("Start_AddOneMargin_011")
.margin(this.OneMargin)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddOneMargin_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddOneMargin_013")
.margin(this.OneMargin);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddOneMargin_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddOneMargin_013");
}
.key("Start_AddOneMargin_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddOneWidth {
@State OneWidth: number = 100
messageManager:MessageManager = new MessageManager()
@State OneWidth: number = 100;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignStart_AddOneWidth onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneWidth') {
this.OneWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("Start_AddOneWidth_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddOneWidth_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddOneWidth_013")
Text('1').width(this.OneWidth).height(50).backgroundColor(0xF5DEB3).key("Start_AddOneWidth_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddOneWidth_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddOneWidth_013");
}
.key("Start_AddOneWidth_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddPadding {
@State DadPadding: number = 10
messageManager:MessageManager = new MessageManager()
@State DadPadding: number = 10;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddPadding onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadPadding') {
this.DadPadding = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddPadding_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddPadding_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddPadding_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddPadding_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddPadding_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddPadding_013");
}.key("Start_AddPadding_01")
.width(500)
.height(200)
......
......@@ -13,19 +13,19 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_AddVisibility {
@State OneVisibility: number = Visibility.Visible;
messageManager: MessageManager = new MessageManager()
messageManager: MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_AddVisibility onPageShow');
console.info('AlignStart_AddVisibility onPageShow');
globalThis.value = {
name: 'messageManager', message: this.messageManager
}
let callback: Callback = (message: any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'OneVisibility') {
this.OneVisibility = message.value;
}
......@@ -33,20 +33,20 @@ struct AlignStart_AddVisibility {
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("Start_AddVisibility_011")
.visibility(this.OneVisibility)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddVisibility_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddVisibility_013")
.visibility(this.OneVisibility);
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddVisibility_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddVisibility_013");
}
.key("Start_AddVisibility_01")
.width(500)
......
......@@ -13,33 +13,33 @@
* limitations under the License.
*/
import {MessageManager,Callback} from './../../../../common/MessageManager';
import { MessageManager, Callback } from './../../../../common/MessageManager';
@Entry
@Component
struct AlignStart_NoSpace {
@State DadWidth: number = 200
messageManager:MessageManager = new MessageManager()
@State DadWidth: number = 200;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('AlignSpaceEvenly_NoSpace onPageShow');
console.info('AlignStart_NoSpace onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'DadWidth') {
this.DadWidth = message.value;
}
}
this.messageManager.registerCallback(callback);
}
@State justifyContent: FlexAlign = FlexAlign.Start
@State justifyContent: FlexAlign = FlexAlign.Start;
build() {
Column() {
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%');
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_NoSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_NoSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_NoSpace_013")
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_NoSpace_011");
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_NoSpace_012");
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_NoSpace_013");
}
.key("Start_NoSpace_01")
.width(this.DadWidth)
......
......@@ -12,22 +12,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Grid_RowCol_Gap{
@State addColumnGap: number = 5;
@State addRowGap: number = 0;
messageManager:MessageManager = new MessageManager()
private content: string = "Grid_RowCol_Gap Page"
messageManager:MessageManager = new MessageManager();
private content: string = "Grid_RowCol_Gap Page";
onPageShow() {
console.info('Grid_RowCol_Gap page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'addColumnGap') {
this.addColumnGap = message.value;
}
......@@ -46,16 +46,16 @@ struct Grid_RowCol_Gap{
Column() {
Grid() {
GridItem() {
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%')
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%');
}.key('Grid_RowCol_Gap_011')
GridItem() {
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%')
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%');
}.key('Grid_RowCol_Gap_012')
GridItem() {
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%')
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%');
}.key('Grid_RowCol_Gap_013')
GridItem() {
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%')
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%');
}.key('Grid_RowCol_Gap_014')
}
.columnsTemplate("1fr 1fr")
......
......@@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Grid_RowCol_GridSize {
@State changeHeight: number = 200;
messageManager:MessageManager = new MessageManager()
private content: string = "Grid_RowCol_GridSize Page"
messageManager:MessageManager = new MessageManager();
private content: string = "Grid_RowCol_GridSize Page";
onPageShow() {
console.info('Grid_RowCol_GridSize page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'changeHeight') {
this.changeHeight = message.value;
}
......@@ -42,16 +42,16 @@ struct Grid_RowCol_GridSize {
Column() {
Grid() {
GridItem() {
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%')
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%');
}.key('Grid_RowCol_GridSize_011')
GridItem() {
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%')
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%');
}.key('Grid_RowCol_GridSize_012')
GridItem() {
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%')
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%');
}.key('Grid_RowCol_GridSize_013')
GridItem() {
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%')
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%');
}.key('Grid_RowCol_GridSize_014')
}
.columnsTemplate("1fr 1fr")
......
......@@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Grid_RowCol_LayoutDirection {
@State addLayoutDirection: number = GridDirection.RowReverse;
messageManager:MessageManager = new MessageManager()
private content: string = "Grid_RowCol_LayoutDirection Page"
messageManager:MessageManager = new MessageManager();
private content: string = "Grid_RowCol_LayoutDirection Page";
onPageShow() {
console.info('Grid_RowCol_LayoutDirection page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'addLayoutDirection') {
this.addLayoutDirection = message.value;
}
......@@ -42,16 +42,16 @@ struct Grid_RowCol_LayoutDirection {
Column() {
Grid() {
GridItem() {
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%')
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%');
}.key('Grid_RowCol_LayoutDirection_011')
GridItem() {
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%')
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%');
}.key('Grid_RowCol_LayoutDirection_012')
GridItem() {
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%')
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%');
}.key('Grid_RowCol_LayoutDirection_013')
GridItem() {
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%')
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%');
}.key('Grid_RowCol_LayoutDirection_014')
}
.columnsTemplate('1fr 1fr')
......
......@@ -12,22 +12,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Grid_RowCol_PadMar {
@State addPadding: number = 10
@State addMargin: number = 0
messageManager:MessageManager = new MessageManager()
private content: string = "Grid_RowCol_PadMar Page"
@State addPadding: number = 10;
@State addMargin: number = 0;
messageManager:MessageManager = new MessageManager();
private content: string = "Grid_RowCol_PadMar Page";
onPageShow() {
console.info('Grid_RowCol_PadMar page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'addPadding') {
this.addPadding = message.value;
}
......@@ -46,16 +46,16 @@ struct Grid_RowCol_PadMar {
Column() {
Grid() {
GridItem() {
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%')
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%');
}.key('Grid_RowCol_PadMar_011')
GridItem() {
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%')
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%');
}.key('Grid_RowCol_PadMar_012')
GridItem() {
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%')
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%');
}.key('Grid_RowCol_PadMar_013')
GridItem() {
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%')
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%');
}.key('Grid_RowCol_PadMar_014')
}
.columnsTemplate("1fr 1fr")
......
......@@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Grid_RowCol_cellLength {
@State addCellLength: number = 50;
messageManager:MessageManager = new MessageManager()
private content: string = "Grid_RowCol_cellLength Page"
messageManager:MessageManager = new MessageManager();
private content: string = "Grid_RowCol_cellLength Page";
onPageShow() {
console.info('Grid_RowCol_cellLength page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'addCellLength') {
this.addCellLength = message.value;
}
......@@ -42,16 +42,16 @@ struct Grid_RowCol_cellLength {
Column() {
Grid() {
GridItem() {
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%')
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%');
}.key('Grid_RowCol_cellLength_011')
GridItem() {
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%')
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%');
}.key('Grid_RowCol_cellLength_012')
GridItem() {
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%')
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%');
}.key('Grid_RowCol_cellLength_013')
GridItem() {
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%')
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%');
}.key('Grid_RowCol_cellLength_014')
}
.columnsTemplate('1fr 1fr')
......
......@@ -12,21 +12,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Grid_RowCol_maxCount {
@State addMaxCount: number = 1;
messageManager:MessageManager = new MessageManager()
private content: string = "Grid_RowCol_maxCount Page"
messageManager:MessageManager = new MessageManager();
private content: string = "Grid_RowCol_maxCount Page";
onPageShow() {
console.info('Grid_RowCol_maxCount page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'addMaxCount') {
this.addMaxCount = message.value;
}
......@@ -42,16 +42,16 @@ struct Grid_RowCol_maxCount {
Column() {
Grid() {
GridItem() {
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%')
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%');
}.key('Grid_RowCol_maxCount_011')
GridItem() {
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%')
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%');
}.key('Grid_RowCol_maxCount_012')
GridItem() {
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%')
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%');
}.key('Grid_RowCol_maxCount_013')
GridItem() {
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%')
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%');
}.key('Grid_RowCol_maxCount_014')
}
.columnsTemplate('1fr 1fr')
......
......@@ -12,22 +12,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../../common/MessageManager';
import { MessageManager, Callback } from '../../../../common/MessageManager';
@Entry
@Component
struct Grid_RowCol_TemplateChange {
@State testColumnsTemplate: string = '1fr 1fr'
@State testRowsTemplate: string = '1fr 1fr'
messageManager:MessageManager = new MessageManager()
private content: string = "Grid_RowCol_TemplateChange Page"
@State testColumnsTemplate: string = '1fr 1fr';
@State testRowsTemplate: string = '1fr 1fr';
messageManager:MessageManager = new MessageManager();
private content: string = "Grid_RowCol_TemplateChange Page";
onPageShow() {
console.info('Grid_RowCol_TemplateChange page show called');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'testColumnsTemplate') {
this.testColumnsTemplate = message.value;
}
......@@ -46,16 +46,16 @@ struct Grid_RowCol_TemplateChange {
Column() {
Grid() {
GridItem() {
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%')
Text('1').fontSize(16).backgroundColor(0xF9CF93).width('100%').height('100%');
}.key('GridTemplateChange_Grid_011')
GridItem() {
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%')
Text('2').fontSize(16).backgroundColor(0xF5DEB3).width('100%').height('100%');
}.key('GridTemplateChange_Grid_012')
GridItem() {
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%')
Text('3').fontSize(16).backgroundColor(0xD2B48C).width('100%').height('100%');
}.key('GridTemplateChange_Grid_013')
GridItem() {
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%')
Text('4').fontSize(16).backgroundColor(0xffa500).width('100%').height('100%');
}.key('GridTemplateChange_Grid_014')
}
.columnsTemplate(this.testColumnsTemplate)
......
......@@ -25,7 +25,7 @@ struct List_SpaceChange{
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'Space') {
this.testSpace = message.value;
}
......@@ -33,8 +33,8 @@ struct List_SpaceChange{
this.messageManager.registerCallback(callback);
}
build(){
Column({space:30}){
List({space:this.testSpace}){
Column({ space:30 }){
List({ space:this.testSpace }){
ListItem() {
Text('1').width('100%').height('100%').backgroundColor(0xF5DEB3);
}
......
......@@ -12,19 +12,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../../../common/MessageManager';
import { MessageManager, Callback } from '../../../common/MessageManager';
@Entry
@Component
struct Row_Space{
@State addSpace: number = 5
messageManager:MessageManager = new MessageManager()
@State addSpace: number = 5;
messageManager:MessageManager = new MessageManager();
onPageShow() {
console.info('Row_Space onPageShow');
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'addSpace') {
this.addSpace = message.value;
}
......@@ -33,9 +33,9 @@ struct Row_Space{
}
build(){
Row({space:this.addSpace}){
Text('1').width(100).height(50).backgroundColor(0xF5DEB3).key('Row_Space_011')
Text('2').width(100).height(100).backgroundColor(0xD2B48C).key('Row_Space_012')
Text('3').width(100).height(150).backgroundColor(0xF5DEB3).key('Row_Space_013')
Text('1').width(100).height(50).backgroundColor(0xF5DEB3).key('Row_Space_011');
Text('2').width(100).height(100).backgroundColor(0xD2B48C).key('Row_Space_012');
Text('3').width(100).height(150).backgroundColor(0xF5DEB3).key('Row_Space_013');
}
.width(350)
.height(200)
......
......@@ -29,7 +29,7 @@ struct Tabs_WidHei {
name:'messageManager',message:this.messageManager
};
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value);
console.log('message = ' + message.name + "--" + message.value);
if (message.name == 'width') {
this.testWidth = message.value;
}
......
......@@ -48,7 +48,7 @@ struct Tabs_Index {
build() {
Column() {
Tabs({index: this.currentIndex, controller: this.controller}) {
Tabs({ index: this.currentIndex, controller: this.controller }) {
TabContent() {
Column().width('100%').height('100%').backgroundColor('#00CB87').key("Tabs_Index_001");
}.tabBar(this.TabBuilder(0, 'Green')).key("Tabs_Index_011")
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../MainAbility/common/MessageManager';
export default function Column_Space() {
describe('column_SpaceTest', function () {
beforeEach(async function (done) {
console.info("Column_Space beforeEach start");
console.info("column_SpaceTest beforeEach start");
let options = {
url: "MainAbility/pages/Column/spaceChanged/Column_Space",
}
......@@ -38,6 +37,7 @@ export default function Column_Space() {
console.error("push Column_Space page error " + JSON.stringify(err));
expect().assertFail();
}
console.info("column_SpaceTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -46,11 +46,11 @@ export default function Column_Space() {
});
/**
* @tc.number SUB_ACE_COLUMN_SPACE_TEST_0100
* @tc.name Column_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
* @tc.name testColumnSpaceToThirty
* @tc.desc The value of space set to 30, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_COLUMN_SPACE_TEST_0100', 0, async function (done) {
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0100] START');
it('testColumnSpaceToThirty', 0, async function (done) {
console.info('[testColumnSpaceToThirty] START');
globalThis.value.message.notify({name:'addSpace', value:30});
await CommonFunc.sleep(3000);
let Column_Space_011 = CommonFunc.getComponentRect('Column_Space_011');
......@@ -74,16 +74,16 @@ export default function Column_Space() {
expect(Math.round(Column_Space_011.right - Column_Space_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_012.right - Column_Space_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_013.right - Column_Space_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0100] END');
console.info('[testColumnSpaceToThirty] END');
done();
});
/**
* @tc.number SUB_ACE_COLUMN_SPACE_TEST_0200
* @tc.name Column_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
* @tc.name testColumnSpaceToFifty
* @tc.desc The value of space set to 50, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_COLUMN_SPACE_TEST_0200', 0, async function (done) {
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0200] START');
it('testColumnSpaceToFifty', 0, async function (done) {
console.info('[testColumnSpaceToFifty] START');
globalThis.value.message.notify({name:'addSpace', value:50});
await CommonFunc.sleep(3000);
let Column_Space_011 = CommonFunc.getComponentRect('Column_Space_011');
......@@ -107,16 +107,16 @@ export default function Column_Space() {
expect(Math.round(Column_Space_011.right - Column_Space_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_012.right - Column_Space_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_013.right - Column_Space_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0200] END');
console.info('[testColumnSpaceToFifty] END');
done();
});
/**
* @tc.number SUB_ACE_COLUMN_SPACE_TEST_0300
* @tc.name Column_Space
* @tc.desc The value of space changes, and the layout size of the parent and child components is fixed
* @tc.name testColumnSpaceToSeventy
* @tc.desc The value of space set to 70, and the layout size of the parent and child components is fixed
*/
it('SUB_ACE_COLUMN_SPACE_TEST_0300', 0, async function (done) {
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0300] START');
it('testColumnSpaceToSeventy', 0, async function (done) {
console.info('[testColumnSpaceToSeventy] START');
globalThis.value.message.notify({name:'addSpace', value:70});
await CommonFunc.sleep(3000);
let Column_Space_011 = CommonFunc.getComponentRect('Column_Space_011');
......@@ -140,7 +140,7 @@ export default function Column_Space() {
expect(Math.round(Column_Space_011.right - Column_Space_011.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_012.right - Column_Space_012.left)).assertEqual(vp2px(300));
expect(Math.round(Column_Space_013.right - Column_Space_013.left)).assertEqual(vp2px(300));
console.info('[SUB_ACE_COLUMN_SPACE_TEST_0300] END');
console.info('[testColumnSpaceToSeventy] END');
done();
});
})
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_FlexMarTest() {
describe('Flex_AlignContent_SpaceAround_FlexMarTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexMar beforeEach start");
console.info("Flex_AlignContent_SpaceAround_FlexMarTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMar',
}
......@@ -37,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_FlexMarTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexMar page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_FlexMarTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -45,12 +45,12 @@ export default function flex_AlignContent_SpaceAround_FlexMarTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100
* @tc.name alignContent_SpaceAround_FlexMargin
* @tc.name testFlexAlignContentSpaceAroundFlexMargin
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the height and width of parent component changed
* of the child components when the margin of parent component set to 10
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100] START');
it('testFlexAlignContentSpaceAroundFlexMargin', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexMargin] START');
globalThis.value.message.notify({name:'margin', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexMar01');
......@@ -68,7 +68,7 @@ export default function flex_AlignContent_SpaceAround_FlexMarTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(10)); //margin =10
expect(firstText.left).assertEqual(secondText.left);
......@@ -77,11 +77,13 @@ export default function flex_AlignContent_SpaceAround_FlexMarTest() {
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(firstText.top - flexContainer.top)).assertEqual(Math.round(flexContainer.bottom - fourthText.bottom));
expect(Math.round(firstText.top - flexContainer.top)).assertEqual(Math.round((secondText.top - firstText.bottom) / 2)); //上下间距是组件间距的一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0100] END');
expect(Math.round(firstText.top - flexContainer.top))
.assertEqual(Math.round(flexContainer.bottom - fourthText.bottom));
expect(Math.round(firstText.top - flexContainer.top))
.assertEqual(Math.round((secondText.top - firstText.bottom) / 2));
console.info('[testFlexAlignContentSpaceAroundFlexMargin] END');
done();
});
})
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_FlexMarPadTest() {
describe('Flex_AlignContent_SpaceAround_FlexMarPadTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexMarPad beforeEach start");
console.info("Flex_AlignContent_SpaceAround_FlexMarPadTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexMarPad',
}
......@@ -37,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexMarPad page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_FlexMarPadTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -45,12 +45,13 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200
* @tc.name alignContent_SpaceAround_FlexMarPad
* @tc.name testFlexAlignContentSpaceAroundFlexMarPadOverflow
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the padding and margin of parent component was changed
* of the child components when the padding of parent component set to 50 and the margin
* of parent component set to 20
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200] START');
it('testFlexAlignContentSpaceAroundFlexMarPadOverflow', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexMarPadOverflow] START');
globalThis.value.message.notify({name:'padding', value:50});
globalThis.value.message.notify({name:'margin', value:20});
......@@ -69,7 +70,7 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200));
expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(20)); //margin =20
expect(Math.round(firstText.top - flexContainer.top)).assertEqual(vp2px(50));
expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(50)); //padding =50
......@@ -79,19 +80,20 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() {
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0200] END');
expect(thirdText.bottom).assertEqual(fourthText.top);
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10));
console.info('[testFlexAlignContentSpaceAroundFlexMarPadOverflow] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300
* @tc.name alignContent_SpaceAround_FlexMarPad
* @tc.name testFlexAlignContentSpaceAroundFlexMarPadMeet
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the padding and margin of parent component was changed
* of the child components when the padding of parent component set to 10 and the margin
* of parent component set to 30
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300] START');
it('testFlexAlignContentSpaceAroundFlexMarPadMeet', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexMarPadMeet] START');
globalThis.value.message.notify({name:'margin', value:30})
globalThis.value.message.notify({name:'padding', value:10})
await CommonFunc.sleep(3000);
......@@ -110,7 +112,7 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200));
expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //padding =10
expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(30)); //margin =30
......@@ -118,12 +120,12 @@ export default function flex_AlignContent_SpaceAround_FlexMarPadTest() {
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(Math.round(flexContainer.bottom - fourthText.bottom))
.assertEqual(Math.round(firstText.top - flexContainer.top)); //行首行尾间距相等
.assertEqual(Math.round(firstText.top - flexContainer.top));
expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom));
expect(Math.round((thirdText.top - secondText.bottom) / 2))
.assertEqual(Math.round(firstText.top - flexContainer.top - vp2px(10)))
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0300] END');
console.info('[testFlexAlignContentSpaceAroundFlexMarPadMeet] END');
done();
});
})
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_FlexPadTest() {
describe('Flex_AlignContent_SpaceAround_FlexPadTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexPad beforeEach start");
console.info("Flex_AlignContent_SpaceAround_FlexPadTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexPad',
}
......@@ -37,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexPad page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_FlexPadTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -45,12 +45,12 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400
* @tc.name alignContent_SpaceAround_FlexPad
* @tc.name testFlexAlignContentSpaceAroundFlexPadOverflow
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the padding and margin of parent component was changed
* of the child components when the padding of parent component set to 50
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400] START');
it('testFlexAlignContentSpaceAroundFlexPadOverflow', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexPadOverflow] START');
globalThis.value.message.notify({name:'padding', value:50})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad01');
......@@ -66,7 +66,7 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200));
expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(50)); //padding =50
expect(firstText.left).assertEqual(secondText.left);
......@@ -75,19 +75,19 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() {
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0400] END');
expect(thirdText.bottom).assertEqual(fourthText.top);
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(10));
console.info('[testFlexAlignContentSpaceAroundFlexPadOverflow] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500
* @tc.name alignContent_SpaceAround_FlexPad
* @tc.name testFlexAlignContentSpaceAroundFlexPadMeet
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the padding of parent component was changed
* of the child components when the padding of parent component set to 10
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500] START');
it('testFlexAlignContentSpaceAroundFlexPadMeet', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexPadMeet] START');
globalThis.value.message.notify({name:'padding', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_FlexPad01');
......@@ -104,19 +104,20 @@ export default function flex_AlignContent_SpaceAround_FlexPadTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200));
expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //padding =10
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(Math.round(flexContainer.bottom - fourthText.bottom)).assertEqual(Math.round(firstText.top - flexContainer.top)); //行首行尾间距相等
expect(Math.round(flexContainer.bottom - fourthText.bottom))
.assertEqual(Math.round(firstText.top - flexContainer.top));
expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round((thirdText.top - secondText.bottom) / 2))
.assertEqual(Math.round(firstText.top - flexContainer.top - vp2px(10)));
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0500] END');
console.info('[testFlexAlignContentSpaceAroundFlexPadMeet] END');
done();
});
})
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_FlexSizeTest() {
describe('Flex_AlignContent_SpaceAround_FlexSizeTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_FlexSize beforeEach start");
console.info("Flex_AlignContent_SpaceAround_FlexSizeTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_FlexSize',
}
......@@ -37,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_FlexSize page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_FlexSizeTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -45,12 +45,12 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600
* @tc.name alignContent_SpaceAround_FlexSize
* @tc.name testFlexAlignContentSpaceAroundFlexSizeMeet
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600] START');
it('testFlexAlignContentSpaceAroundFlexSizeMeet', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexSizeMeet] START');
globalThis.value.message.notify({name:'width', value:200})
globalThis.value.message.notify({name:'height', value:400})
await CommonFunc.sleep(3000);
......@@ -68,7 +68,7 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
......@@ -76,22 +76,22 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() {
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(firstText.top - flexContainer.top))
.assertEqual(Math.round(flexContainer.bottom - fourthText.bottom));
expect(Math.round(firstText.top - flexContainer.top))
.assertEqual(Math.round((secondText.top - firstText.bottom) / 2)); //上下间距是组件间距的一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0600] END');
.assertEqual(Math.round((secondText.top - firstText.bottom) / 2));
console.info('[testFlexAlignContentSpaceAroundFlexSizeMeet] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700
* @tc.name alignContent_SpaceAround_FlexSize
* @tc.name testFlexAlignContentSpaceAroundFlexSizeOverflow
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700] START');
it('testFlexAlignContentSpaceAroundFlexSizeOverflow', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexSizeOverflow] START');
globalThis.value.message.notify({name:'width', value:200})
globalThis.value.message.notify({name:'height', value:250})
await CommonFunc.sleep(3000);
......@@ -109,19 +109,19 @@ export default function flex_AlignContent_SpaceAround_FlexSizeTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(thirdText.bottom).assertEqual(fourthText.top);
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(firstText.top).assertEqual(flexContainer.top);
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0700] END');
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50));
console.info('[testFlexAlignContentSpaceAroundFlexSizeOverflow] END');
done();
});
})
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_TextMarTest() {
describe('Flex_AlignContent_SpaceAround_TextMarTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextMar beforeEach start");
console.info("Flex_AlignContent_SpaceAround_TextMarTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextMar',
}
......@@ -37,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextMar page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_TextMarTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -45,12 +45,12 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800
* @tc.name alignContent_SpaceAround_TextMargin
* @tc.name testFlexAlignContentSpaceAroundTextMarginOverflow
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the padding and margin of parent component was changed
* of the child components when the margin of parent component set to 65
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800] START');
it('testFlexAlignContentSpaceAroundTextMarginOverflow', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundTextMarginOverflow] START');
globalThis.value.message.notify({name:'margin', value:65})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar01');
......@@ -66,7 +66,7 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(Math.round((firstText.left - flexContainer.left)*10)/10).assertEqual(Math.round(vp2px(65)*10)/10); //margin =65
expect(flexContainer.left).assertEqual(secondText.left);
......@@ -75,19 +75,19 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() {
expect(Math.round((secondText.top - firstText.bottom)*10)/10).assertEqual(Math.round(vp2px(65)*10)/10);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(30)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0800] END');
expect(thirdText.bottom).assertEqual(fourthText.top);
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(30));
console.info('[testFlexAlignContentSpaceAroundTextMarginOverflow] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900
* @tc.name alignContent_SpaceAround_TextMargin
* @tc.name testFlexAlignContentSpaceAroundTextMarginMeet
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the padding of parent component was changed
* of the child components when the margin of parent component set 10
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900] START');
it('testFlexAlignContentSpaceAroundTextMarginMeet', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundTextMarginMeet] START');
globalThis.value.message.notify({name:'margin', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextMar01');
......@@ -104,9 +104,9 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10)); //margin =10
expect(Math.round(firstText.left - flexContainer.left)).assertEqual(vp2px(10));
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(Math.round(firstText.top - flexContainer.top - vp2px(10)))
......@@ -114,10 +114,10 @@ export default function flex_AlignContent_SpaceAround_TextMarTest() {
expect(Math.round(secondText.top - firstText.bottom - vp2px(10)))
.assertEqual(Math.round(thirdText.top - secondText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(flexContainer.bottom - fourthText.bottom))
.assertEqual(Math.round((fourthText.top - thirdText.bottom) / 2)); //行首行尾距离是组件间距的一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_0900] END');
.assertEqual(Math.round((fourthText.top - thirdText.bottom) / 2));
console.info('[testFlexAlignContentSpaceAroundTextMarginMeet] END');
done();
});
})
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_TextOffsetTest() {
describe('Flex_AlignContent_SpaceAround_TextOffsetTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextOffset beforeEach start");
console.info("Flex_AlignContent_SpaceAround_TextOffsetTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextOffset',
}
......@@ -37,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_TextOffsetTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextOffset page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_TextOffsetTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -45,12 +45,11 @@ export default function flex_AlignContent_SpaceAround_TextOffsetTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000
* @tc.name alignContent_SpaceAround_TextOffset
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when position of first child component was changed
* @tc.name testFlexAlignContentSpaceAroundTextOffset
* @tc.desc The offset of first subcomponent set to {x:10, y:10}
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000] START');
it('testFlexAlignContentSpaceAroundTextOffset', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundTextOffset] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextOffset02');
let distanceBefore = secondText.top - firstText.bottom;
......@@ -73,7 +72,7 @@ export default function flex_AlignContent_SpaceAround_TextOffsetTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为50、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(Math.round(firstText.top - firstTextTop)).assertEqual(vp2px(10));
expect(Math.round(firstText.left - firstTextLeft)).assertEqual(vp2px(10)); //offset =10
......@@ -85,8 +84,8 @@ export default function flex_AlignContent_SpaceAround_TextOffsetTest() {
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(distanceBefore));
expect(Math.round(flexContainer.bottom - fourthText.bottom)).assertEqual(Math.round(distanceBefore / 2)); //其余组件行间距相等,未改变
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1000] END');
expect(Math.round(flexContainer.bottom - fourthText.bottom)).assertEqual(Math.round(distanceBefore / 2));
console.info('[testFlexAlignContentSpaceAroundTextOffset] END');
done();
});
})
......
......@@ -16,11 +16,10 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_TextSizeTest() {
describe('Flex_AlignContent_SpaceAround_TextSizeTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextSize beforeEach start");
console.info("Flex_AlignContent_SpaceAround_TextSizeTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextSize',
}
......@@ -37,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextSize page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_TextSizeTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -45,12 +45,12 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100
* @tc.name alignContent_SpaceAround_TextSize
* @tc.name testFlexAlignContentSpaceAroundTextSizeMeet
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100] START');
it('testFlexAlignContentSpaceAroundTextSizeMeet', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundTextSizeMeet] START');
globalThis.value.message.notify({name:'height', value:70})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize01');
......@@ -67,7 +67,7 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(70));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为70、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
......@@ -75,23 +75,23 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() {
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(firstText.top - flexContainer.top))
.assertEqual(Math.round(flexContainer.bottom - fourthText.bottom));
expect(Math.round(firstText.top - flexContainer.top))
.assertEqual(Math.round((secondText.top - firstText.bottom) / 2));
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1100] END');
console.info('[testFlexAlignContentSpaceAroundTextSizeMeet] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200
* @tc.name alignContent_SpaceAround_TextSize
* @tc.name testFlexAlignContentSpaceAroundTextSizeOverflow
* @tc.desc The size of the parent component in the cross direction is not enough for the layout
* of the child components when the height and width of parent component changed
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200] START');
it('testFlexAlignContentSpaceAroundTextSizeOverflow', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundTextSizeOverflow] START');
globalThis.value.message.notify({name:'height', value:200})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextSize01');
......@@ -108,20 +108,20 @@ export default function flex_AlignContent_SpaceAround_TextSizeTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(200));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //四个子组件的高度分别为200、100、50、100
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(firstText.bottom).assertEqual(secondText.top);
expect(secondText.bottom).assertEqual(thirdText.top);
expect(thirdText.bottom).assertEqual(fourthText.top); //无行间距
expect(thirdText.bottom).assertEqual(fourthText.top);
expect(firstText.left).assertEqual(secondText.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left); //子组件靠左
expect(fourthText.left).assertEqual(flexContainer.left);
expect(firstText.top).assertEqual(flexContainer.top);
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50)); //行首贴边行尾溢出
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1200] END');
expect(Math.round(fourthText.bottom - flexContainer.bottom)).assertEqual(vp2px(50));
console.info('[testFlexAlignContentSpaceAroundTextSizeOverflow] END');
done();
});
})
......
......@@ -19,7 +19,7 @@ import CommonFunc from '../../../../MainAbility/common/Common';
export default function flex_AlignContent_SpaceAround_TextVisibilityTest() {
describe('Flex_AlignContent_SpaceAround_TextVisibilityTest', function () {
beforeEach(async function (done) {
console.info("Flex_AlignContent_SpaceAround_TextVisibility beforeEach start");
console.info("Flex_AlignContent_SpaceAround_TextVisibilityTest beforeEach start");
let options = {
url: 'MainAbility/pages/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility',
}
......@@ -36,6 +36,7 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() {
} catch (err) {
console.error("push Flex_AlignContent_SpaceAround_TextVisibility page error:" + err);
}
console.info("Flex_AlignContent_SpaceAround_TextVisibilityTest beforeEach end");
done();
});
afterEach(async function () {
......@@ -129,7 +130,7 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() {
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(distanceBefore); //行距大于设置前
expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(distanceBefore);
expect(Math.round(secondText.top - flexContainer.top))
.assertEqual(Math.round(flexContainer.bottom - fourthText.bottom));
......
......@@ -16,7 +16,6 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceBetween_FlexMarTest() {
describe('Flex_AlignContent_SpaceBetween_FlexMarTest', function () {
beforeEach(async function (done) {
......@@ -45,12 +44,11 @@ export default function flex_AlignContent_SpaceBetween_FlexMarTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0100
* @tc.name alignContent_SpaceAround_FlexMargin
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the child components when the height and width of parent component changed
* @tc.name testFlexAlignContentSpaceAroundFlexMargin
* @tc.desc the margin of parent component set to 10
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0100', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0100] START');
it('testFlexAlignContentSpaceAroundFlexMargin', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundFlexMargin] START');
globalThis.value.message.notify({name:'margin', value:10})
await CommonFunc.sleep(3000);
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_FlexMar01');
......@@ -68,7 +66,7 @@ export default function flex_AlignContent_SpaceBetween_FlexMarTest() {
expect(Math.round(firstText.bottom - firstText.top)).assertEqual(vp2px(50));
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(150));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200)); //四个子组件的高度分别为50、100、150、200
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(200));
expect(Math.round(flexContainer.top - columnContainer.top)).assertEqual(vp2px(10)); //margin =10
expect(firstText.left).assertEqual(flexContainer.left);
......@@ -77,11 +75,11 @@ export default function flex_AlignContent_SpaceBetween_FlexMarTest() {
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(firstText.top).assertEqual(flexContainer.top);
expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边
expect(fourthText.bottom).assertEqual(flexContainer.bottom);
expect(Math.round(secondText.top - firstText.bottom)).assertEqual(Math.round(thirdText.top - secondText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //行间距相等
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_0100] END');
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
console.info('[testFlexAlignContentSpaceAroundFlexMargin] END');
done();
});
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册