diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Badge.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Badge.ets index c92abe2ec7f46b7e52859e6a76ba93b9e438e9e1..66de6f8e3b9c0360931602dd25d1511878ac63ab 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Badge.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Badge.ets @@ -57,7 +57,7 @@ struct badge { count: this.counts, position: BadgePosition.RightTop, maxCount: 99, - style: { color: 0xFFFFFF, fontSize: 16, badgeSize: 20, badgeColor: Color.Red } + style: { color: 0xFFFFFF, fontSize: '16', badgeSize: '20', badgeColor: Color.Red } }) { Button('message') .onClick(() => { diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets index 5b7f5e65fa2656a5449ca4ff600205cebb051129..ac2271ea3a13664bbbb6afe4f173abae9e66f867 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets @@ -36,6 +36,9 @@ struct button_testcase { .fontSize(50) .fontWeight(FontWeight.Bold) Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect }) + .fontSize(12) + .fontWeight(FontWeight.Bold) + .fontColor(0xCCCCCC) .height(40) .width(40) .key('button') diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets index 05f614d2f6781aab8bc85c52639fcf27e42456d8..b9e5c84e21ccf25419be432d8f95418fac82070a 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets @@ -36,7 +36,7 @@ struct column { }.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column') Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%') - Column() { + Column({ space: '5' }) { Column().width('50%').height(50).backgroundColor(0xAFEEEE) Column().width('50%').height(50).backgroundColor(0x00FFFF) }.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1') diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets index 582af15e4c4bc90ff2d49cd590fddfd258ed475c..3c624848482b22998b2a1d137796ddaedbcf198c 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + import router from '@system.router' @Entry @@ -35,7 +35,7 @@ struct dataPanel_testcase { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text(`${this.content}`) .fontSize(50) - DataPanel({ values: [20, 40, 20], max: 100 }) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Line }) .width(this.width) .height(this.height) .key('DataPanel') @@ -44,7 +44,7 @@ struct dataPanel_testcase { }) .closeEffect(false) - DataPanel({ values: [20, 40, 20], max: 100 }) + DataPanel({ values: [20, 40, 20], max: 100, type: DataPanelType.Circle}) .width(this.width) .height(this.height) .key('DataPanel2') @@ -52,6 +52,14 @@ struct dataPanel_testcase { router.back() }) .closeEffect(true) + DataPanel({ values: [20, 40, 20], max: 100}) + .width(this.width) + .height(this.height) + .key('DataPanel3') + .onClick(() => { + router.back() + }) + .closeEffect(false) } .key('flex') .width('100%') diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets index 2224f05f1681f0e758c676d3bd10724acd59663e..a0e21251e80008c5be9f29aa52074acc5eb24a78 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets @@ -34,6 +34,7 @@ struct flex { direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center, + alignItems:ItemAlign.Start, alignContent: FlexAlign.Start, }) { Text('1').width('100%').height(20).backgroundColor(0xF5DEB3) @@ -51,6 +52,7 @@ struct flex { direction: FlexDirection.Row, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start, + alignItems:ItemAlign.Start, alignContent: FlexAlign.Center, }) { Text('1').width('20%').height(20).backgroundColor(0xF5DEB3) @@ -68,6 +70,7 @@ struct flex { direction: FlexDirection.RowReverse, wrap: FlexWrap.Wrap, justifyContent: FlexAlign.End, + alignItems:ItemAlign.End, alignContent: FlexAlign.End, }) { Text('1').width('50%').height(20).backgroundColor(0xF5DEB3) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets index 5e7a5e9627481cb5a43b137e3bce4d52e2bcfc93..57358110413406263e70a2a5f650cbfeb22a4387 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets @@ -76,7 +76,7 @@ struct gridContainer { }).backgroundColor(0x317aff) } - GridContainer({ columns: 12, sizeType: SizeType.MD, gutter: 10, margin: 20 }) { + GridContainer({ columns: "auto", sizeType: SizeType.MD, gutter: '10', margin: '20' }) { Row() { Text('1') .useSizeType({ diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets index 4b1d350a955d378d0529f6c103ed70d4b7992ef2..5cc583e931f51aa8e4f2bd55decfeeb14a40afb4 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets @@ -16,6 +16,17 @@ @Entry @Component struct image_textcase { + @State Width: number = 0 + @State height: number = 0 + + onPageShow() { + console.info('Image page show called'); + } + + onBuildDone() { + console.info('Image page build done called'); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Column() { @@ -23,10 +34,15 @@ struct image_textcase { .fontSize(50) .fontWeight(FontWeight.Bold) Image("/resources/rawfile/hand.png") + .matchTextDirection(false) + .fitOriginalSize(false) + .fillColor(0xCCCCCC) .objectFit(ImageFit.Cover) .objectRepeat(ImageRepeat.NoRepeat) .interpolation(ImageInterpolation.None) .renderMode(ImageRenderMode.Original) + .autoResize(false) + .syncLoad(false) .sourceSize({ width: 200, height: 100 }) .alt("/resources/rawfile/person.png") .key('image1') @@ -36,6 +52,20 @@ struct image_textcase { .interpolation(ImageInterpolation.High) .renderMode(ImageRenderMode.Template) .key('image2') + .height(180) + .width(180) + .onComplete((msg: { + width: number, + height: number + }) => { + this.Width = msg.width + this.height = msg.height + console.info('Width ----' + this.Width) + console.info('height ----' + this.height) + }) + .onError(() => { + console.info('load image fail') + }) Image("/resources/rawfile/hand.png") .objectFit(ImageFit.Fill) .objectRepeat(ImageRepeat.Y) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets index 1c217193f408e0d907b29d29d337aa0452280785..6c50769cf2ab045cbe48b52e294b4105a21e1c3d 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets @@ -19,6 +19,14 @@ struct navigator_testcase { @State active: boolean = false @State params: Object = { text: 'news' } + onPageShow() { + console.info('Navigator page show called'); + } + + onBuildDone() { + console.info('Navigator page build done called'); + } + build() { Column() { Navigator({ target: "pages/index", type: NavigationType.Back }) { diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets index 687288a52e0fb093aad35c9842318db72832b522..32ddabbd1ccbae3805dd462e6f04b28364d6a1e7 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets @@ -18,6 +18,14 @@ struct PanelExample { @State show: boolean = true + onPageShow() { + console.info('Panel page show called'); + } + + onBuildDone() { + console.info('Panel page build done called'); + } + build() { Column() { Text('2021-09-30 Today Calendar: 1.afternoon......Click for details') diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets index 6b3448a114248945a3b482c30f96b1d3cea52940..aa00c23094211b07a7f0a4cbb3fed9b6baddfea3 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets @@ -12,10 +12,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + @Entry @Component struct progress_testcase { + onPageShow() { + console.info('Progress page show called'); + } + + onBuildDone() { + console.info('Progress page build done called'); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Column() { @@ -27,6 +35,8 @@ struct progress_testcase { .color(Color.Blue) .width(50) .height(70) + .circularStyle({ strokeWidth: 10, scaleCount: 2, scaleWidth: 10 }) + .cricularStyle({ strokeWidth: 10, scaleCount: 2, scaleWidth: 10 }) .key('progress') Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse }) @@ -36,9 +46,30 @@ struct progress_testcase { .height(70) .key('progress2') + Progress({ value: 20, total: 40, style: ProgressStyle.Ring }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress3') + + Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress4') + + Progress({ value: 20, total: 40, style: ProgressStyle.Capsule }) + .value(3) + .color(Color.Blue) + .width(50) + .height(70) + .key('progress5') + } - .width(300) - .height(300) + .width(400) + .height(400) .borderColor(Color.Pink) .borderWidth(2) } diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets index da659444e8aa9f77b7f63e4f3c045a417ba9b57f..5c0dd84eff5a6653ee5fd940662d141025a1bb4e 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets @@ -16,6 +16,16 @@ @Entry @Component struct qrcode_textcase { + @State Color: Color = Color.Pink + + onPageShow() { + console.info('Qrcode page show called'); + } + + onBuildDone() { + console.info('Qrcode page build done called'); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text(`Qrcode page`) @@ -23,6 +33,7 @@ struct qrcode_textcase { .fontWeight(FontWeight.Bold) QRCode('hello world') .color("#FFFFC0CB") + .backgroundColor(this.Color) .width("200") .height("100") .key('qrcode') diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets index 184cac2978282b49e5cc89d5df5344dc2ae429fd..b29e26a392fca6f15a5b7f0eb4156dd3bc767c3f 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets @@ -16,6 +16,16 @@ @Entry @Component struct rating_testcase { + @State rating: number = 2 + + onPageShow() { + console.info('Rating page show called'); + } + + onBuildDone() { + console.info('Rating page build done called'); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Column() { @@ -30,6 +40,9 @@ struct rating_testcase { foregroundUri: '/resources/rawfile/star-1-3.png', secondaryUri: '/resources/rawfile/star-1-2.png' }) + .onChange((value: number) => { + this.rating = value + }) .key('rating1') Rating({ rating: 2, indicator: true }) .stepSize(0.5) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets index 3beb10248c1cdbccae2c69befc62746e54803113..363089d22580febed16b983d8a4b2877cde52bec 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets @@ -21,7 +21,7 @@ struct scroll_testcase { @State scrollBarColor: Color = Color.Pink @State scrollBar: BarState= BarState.On private value1: Array = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] - @State edge: Edge= Edge.Bottom + @State edge: Edge= Edge.Top private content: string = "Scroll Page"; scroller: Scroller = new Scroller(); @@ -60,19 +60,21 @@ struct scroll_testcase { .scrollBarColor(this.scrollBarColor) .scrollBarWidth(this.scrollBarWidth) .key('scroll') - .width(300) + .width(400) .height(200) .onScroll((xOffset: number, yOffset: number) => { - console.error(` current offset is ${xOffset} ${yOffset}`) + console.info(` current offset is ${xOffset} ${yOffset}`) }) .onScrollEnd(() => { - console.error(` now on scroll end`) + console.info(` now on scroll end`) + }) + .onScrollEdge((side: Edge) => { + console.info(`To the edge`) }) - Scroll() { Row() { Text('scroll uppppp') - .width(80) + .width(60) .height(100) .backgroundColor(Color.Yellow) .margin({ @@ -82,7 +84,7 @@ struct scroll_testcase { .key('text') Text('scroll to') - .width(100) + .width(60) .height(100) .backgroundColor(Color.Green) .margin({ @@ -96,7 +98,7 @@ struct scroll_testcase { }) }) Text('scroll page') - .width(100) + .width(60) .height(100) .backgroundColor(Color.Blue) .margin({ @@ -108,9 +110,45 @@ struct scroll_testcase { next: true }) }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + Text('scroll Edge') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.currentOffset() + }) + Text('scroll to index') + .width(60) + .height(100) + .backgroundColor(Color.Blue) + .margin({ + right: 5, + left: 5 + }) + .onClick(() => { + this.scroller.scrollToIndex(0) + console.info(` now on scroll end`) + }) } } - .height(100).scrollable(ScrollDirection.Horizontal) + .key('scroll1') + .height(100) + .scrollable(ScrollDirection.Horizontal) Scroll() { Column() { @@ -132,7 +170,7 @@ struct scroll_testcase { .scrollBarWidth(5) .width(300) .height(200) - .key('scroll1') + .key('scroll2') Scroll() { Column() { @@ -148,13 +186,13 @@ struct scroll_testcase { } } .padding(10) - .scrollable(ScrollDirection.Horizontal) + .scrollable(ScrollDirection.Free) .scrollBar(BarState.Off) .scrollBarColor(Color.Red) .scrollBarWidth(5) .width(300) .height(200) - .key('scroll2') + .key('scroll3') } .key('flex') diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets index cce0ba5530b811d2a025ee0021ac2258df77a296..625cd02874f16e9debb7638322624f890e08fa62 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets @@ -16,6 +16,19 @@ @Entry @Component struct slider { + @State inSetValue: number= 40 + @State outSetValue: number= 40 + @State direction: Axis= Axis.Horizontal + @State Begin: number = SliderChangeMode.Begin + + onPageShow() { + console.info('Slider page show called'); + } + + onBuildDone() { + console.info('Slider page build done called'); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Column() { @@ -23,18 +36,27 @@ struct slider { .fontSize(50) .fontWeight(FontWeight.Bold) Slider({ - value: 40, + value: this.outSetValue, min: 0, max: 100, step: 1, + direction: Axis.Horizontal, + reverse: false, style: SliderStyle.OutSet }) .blockColor('#FFFF0000') .selectedColor('#FF0000FF') .trackColor('#FF808080') + .minLabel('10') + .maxLabel('10') .showTips(false) .showSteps(false) - .width("200") + .onChange((value: number, mode: SliderChangeMode) => { + this.outSetValue = value + this.Begin = mode + console.info('value: ' + value + '---mode: ' + mode) + }) + .width("100") .height("100") .key('slider1') Slider({ diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets index 25b1d95fbe8216b8d76680689fe92ccb24a80b8b..df5a71043f1ae000b822646f6b56df7ae103fa1f 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets @@ -16,6 +16,15 @@ @Entry @Component struct span_textcase { + + onPageShow() { + console.info('Span page show called'); + } + + onBuildDone() { + console.info('Span page build done called'); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Column() { @@ -25,13 +34,16 @@ struct span_textcase { .textCase(TextCase.UpperCase) .fontColor(Color.Blue) .fontSize("20fp") + .letterSpacing(5) + .fontFamily("sans-serif") .fontWeight(FontWeight.Bold) .fontStyle(FontStyle.Italic) .key('span1') Span('The second test Span demo') .textCase(TextCase.LowerCase) .fontColor(Color.Black) - .fontSize("30fp") + .letterSpacing('5') + .fontSize(30) .key('span2') Span('The third test Span demo') .textCase(TextCase.Normal) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets index 151385713f1b14d56ecf737910c28c06d5b63c2f..fbd1415dc815b0f1966476c430f7d69e28e587ee 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets @@ -79,6 +79,9 @@ struct text_textcase { @State zIndex: number = 1 @State fontStyle: FontStyle = FontStyle.Italic @State fontSize: number = 15 + @State minFontSize: number = 15 + @State maxFontSize: number = 15 + @State letterSpacing: number= 10 @State fontWeight: FontWeight= FontWeight.Bold @State fontColor: Color= Color.Black @State active: boolean = false @@ -124,6 +127,9 @@ struct text_textcase { .zIndex(this.zIndex) .fontColor(this.fontColor) .fontSize(this.fontSize) + .minFontSize(this.minFontSize) + .letterSpacing(this.letterSpacing) + .maxFontSize(this.maxFontSize) .fontWeight(this.fontWeight) .fontStyle(this.fontStyle) .fontFamily("sans-serif") @@ -141,7 +147,7 @@ struct text_textcase { .size({ width: 100, height: 50 }) .padding({ bottom: 5, top: 5, right: 5, left: 10 }) .margin({ bottom: 15, top: 10, right: 10, left: 10 }) - .fontSize(13) + .fontSize('13') .textAlign(TextAlign.Start) .align(Alignment.Start) .direction(Direction.Ltr) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets index 7db4a5bbe1c96712d88c94741e162cd1ff46032f..9bdf7f2b5353a8bc81f7d7860cf77aef354e473b 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets @@ -64,6 +64,7 @@ export default function badgeJsunit() { console.info('new Badge0 START'); let strJson = getInspectorByKey('badge'); let obj = JSON.parse(strJson); + let style = JSON.parse(obj.$attrs.style) expect(obj.$type).assertEqual('Badge'); console.log(JSON.stringify(obj.$type)) console.info("yr badge0 type: " + JSON.stringify(obj.$type)); @@ -74,10 +75,9 @@ export default function badgeJsunit() { console.log("yr badge0 position-BadgePosition.Right" + JSON.stringify(obj.$attrs.position)) expect(obj.$attrs.maxCount).assertEqual('99'); console.log("yr badge0 maxCount-'99'" + JSON.stringify(obj.$attrs.maxCount)) - let style = JSON.parse(obj.$attrs.style) - console.log(style.color) - console.log(style.fontSize) - console.log(style.badgeSize) + console.log("yr badge0 style.color" + style.color); + console.log("yr badge0 style.fontSize" + style.fontSize); + console.log("yr badge0 style.badgeSize" + style.badgeSize); expect(style.color).assertEqual('#FFFFFFFF'); expect(style.fontSize).assertEqual('16.000000fp'); expect(style.badgeSize).assertEqual('20.000000fp'); @@ -95,9 +95,14 @@ export default function badgeJsunit() { console.info('new Badge1 START'); let strJson = getInspectorByKey('badge1'); let obj = JSON.parse(strJson); + let style = JSON.parse(obj.$attrs.style) console.info("component obj is: " + JSON.stringify(obj)); expect(obj.$attrs.position).assertEqual('BadgePosition.RightTop'); console.log("yr badge1 position-'BadgePosition.RightTop'" + JSON.stringify(obj.$attrs.position)) + console.log("yr badge0 style.fontSize" + style.fontSize); + console.log("yr badge0 style.badgeSize" + style.badgeSize); + expect(style.fontSize).assertEqual('16.000000fp'); + expect(style.badgeSize).assertEqual('20.000000fp'); console.info('new Badge1 END'); done(); }); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets index abd5a81aa7cf3efd2377d7e4f60f560840526a18..0b6c8f07e65d187e3d0b965cf4160b500917568a 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets @@ -64,15 +64,21 @@ export default function buttonJsunit() { console.info('testGetInspectorByKey START'); let strJson = getInspectorByKey('button'); let obj = JSON.parse(strJson); + let style = JSON.parse(obj.$attrs.style) + console.log(style.fontSize) console.info("cd button component obj is: " + JSON.stringify(obj)); console.log("cd button type" + JSON.stringify(obj.$type)); console.log("cd button Buttontype" + JSON.stringify(obj.$attrs.type)); console.log("cd button stateEffect" + JSON.stringify(obj.$attrs.stateEffect)); console.log("cd button label" + JSON.stringify(obj.$attrs.label)); + console.log("cd button fontSize" + JSON.stringify(obj.$attrs.fontSize)); + console.log("cd button fontWeight" + JSON.stringify(obj.$attrs.fontWeight)); + console.log("cd button fontColor" + JSON.stringify(obj.$attrs.fontColor)); expect(obj.$type).assertEqual('Button') expect(obj.$attrs.type).assertEqual('ButtonType.Circle') expect(obj.$attrs.stateEffect).assertEqual('true') expect(obj.$attrs.label).assertEqual('1.value') + expect(obj.$attrs.fontSize).assertEqual('12') console.info('cd buttonInspectorByKey END'); done(); }); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets index 4bb2c3192d10c54f49fca3c17872c0341b690c57..83cea32ee1f3ccf21bc7d139b6ee8f9499e90f23 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets @@ -69,10 +69,12 @@ export default function datapanelJsunit() { console.log("cd DataPanel values1 " + typeof ([20, 40, 20])); console.log("cd DataPanel values " + typeof (obj.$attrs.values)); console.log("cd DataPanel values" + JSON.stringify(obj.$attrs.values)); + console.log("cd DataPanel dataPanelType" + JSON.stringify(obj.$attrs.DataPanelType)); console.log("cd DataPanel max" + JSON.stringify(obj.$attrs.max)); console.log("panel closeEffect" + JSON.stringify(obj.$attrs.closeEffect)) expect(obj.$attrs.closeEffect).assertEqual("false") expect(obj.$type).assertEqual("DataPanel") + expect(obj.$attrs.DataPanelType).assertEqual("Line") expect(JSON.stringify(obj.$attrs.values)).assertEqual('[20,40,20]') expect(obj.$attrs.max).assertEqual(100.000000.toFixed(6)) console.info('cd dataPanelInspectorByKey END'); @@ -89,10 +91,37 @@ export default function datapanelJsunit() { let strJson = getInspectorByKey('DataPanel2'); let obj = JSON.parse(strJson); console.info("cd DatePanel component obj is: " + JSON.stringify(obj)); + console.log("cd DataPanel dataPanelType" + JSON.stringify(obj.$attrs)); + console.log("cd DataPanel Type" + JSON.stringify(obj.$attrs.type)); + expect(obj.$attrs.type).assertEqual("DataPanelType.Circle") console.log("panel closeEffect" + JSON.stringify(obj.$attrs.closeEffect)) expect(obj.$attrs.closeEffect).assertEqual("true") console.info('cd dataPanelInspectorByKey END'); done(); }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0740 + * @tc.name testDataPanelGetInspectorByKey020 + * @tc.desc aceEtsTest + */ + it('testDataPanelGetInspectorByKey030', 0, async function (done) { + console.info('testGetInspectorByKey START'); + let strJson = getInspectorByKey('DataPanel3'); + let obj = JSON.parse(strJson); + console.info("cd DatePanel component obj is: " + JSON.stringify(obj)); + console.log("cd DataPanel type " + JSON.stringify(obj.$type)); + console.log("cd DataPanel values1 " + typeof ([20, 40, 20])); + console.log("cd DataPanel values " + typeof (obj.$attrs.values)); + console.log("cd DataPanel values" + JSON.stringify(obj.$attrs.values)); + console.log("cd DataPanel max" + JSON.stringify(obj.$attrs.max)); + console.log("panel closeEffect" + JSON.stringify(obj.$attrs.closeEffect)) + expect(obj.$attrs.closeEffect).assertEqual("false") + expect(obj.$type).assertEqual("DataPanel") + expect(JSON.stringify(obj.$attrs.values)).assertEqual('[20,40,20]') + expect(obj.$attrs.max).assertEqual(100.000000.toFixed(6)) + console.info('cd dataPanelInspectorByKey END'); + done(); + }); }) } diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets index e743cdfba2b9ee0324a61a9897be47e00056450f..f9ef7d8250565ee5f4c1e5f32000227160cbc2f7 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets @@ -71,6 +71,8 @@ export default function flexJsunit() { expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap'); console.log("yr flex0 obj.$attrs.constructor.wrap-'FlexWrap.NoWrap':" + JSON.stringify(obj.$attrs.constructor.wrap)); expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center'); + console.log("yr flex0 obj.$attrs.constructor.alignItems-'FlexWrap.NoWrap':" + JSON.stringify(obj.$attrs.constructor.alignItems)); + expect(obj.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start'); console.log("yr flex0 obj.$attrs.constructor.justifyContent-'FlexAlign.Center':" + JSON.stringify(obj.$attrs.constructor.justifyContent)); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.Start"); console.log("yr flex0 obj.$attrs.constructor.alignContent-'FlexAlign.Start':" + JSON.stringify(obj.$attrs.constructor.alignContent)); @@ -92,6 +94,8 @@ export default function flexJsunit() { console.log("yr flex1 direction-'FlexDirection.Row':" + JSON.stringify(obj.$attrs.constructor.direction)); expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap') console.log("yr flex1 wrap-'FlexWrap.Wrap':" + JSON.stringify(obj.$attrs.constructor.wrap)); + expect(obj.$attrs.ItemAlign.Start).assertEqual('ItemAlign.Start') + console.log("yr flex1 alignItems-'ItemAlign.Start':" + JSON.stringify(obj.$attrs.ItemAlign.Start)); expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start'); console.log("yr flex1 justifyContent-'FlexAlign.Start':" + JSON.stringify(obj.$attrs.constructor.justifyContent)); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.Center"); @@ -112,6 +116,8 @@ export default function flexJsunit() { console.info("component obj is: " + JSON.stringify(obj)); expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.RowReverse'); console.log("yr flex2 direction-'FlexDirection.RowReverse':" + JSON.stringify(obj.$attrs.constructor.direction)); + expect(obj.$attrs.ItemAlign.Start).assertEqual('ItemAlign.Start') + console.log("yr flex1 alignItems-'ItemAlign.Start':" + JSON.stringify(obj.$attrs.ItemAlign.Start)); expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End'); console.log("yr flex2 justifyContent-'FlexAlign.End':" + JSON.stringify(obj.$attrs.constructor.justifyContent)); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.End"); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets index 2e998f47270384b1e4d549a17a0009865fa1362a..629f6fdd350ebe0704883ad92d64012a3c1b5da5 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets @@ -65,13 +65,22 @@ export default function imageJsunit() { let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); + console.log("image1 matchTextDirection" + JSON.stringify(obj.$attrs.matchTextDirection)); console.log("image1 objectFit" + JSON.stringify(obj.$attrs.objectFit)); + console.log("image1 fitOriginalSize" + JSON.stringify(obj.$attrs.fitOriginalSize)); + console.log("image1 fillColor" + JSON.stringify(obj.$attrs.fillColor)); + console.log("image1 autoResize" + JSON.stringify(obj.$attrs.autoResize)); + console.log("image1 syncLoad" + JSON.stringify(obj.$attrs.syncLoad)); console.log("image1 objectRepeat" + JSON.stringify(obj.$attrs.objectRepeat)); console.log("image1 interpolation" + JSON.stringify(obj.$attrs.interpolation)); console.log("image1 renderMode" + JSON.stringify(obj.$attrs.renderMode)); console.log("image1 sourceSize" + JSON.stringify(obj.$attrs.sourceSize)); console.log("image1 alt" + JSON.stringify(obj.$attrs.alt)); expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover') + expect(obj.$attrs.fitOriginalSize).assertEqual('false') + expect(obj.$attrs.fillColor).assertEqual('0xCCCCCC') + expect(obj.$attrs.autoResize).assertEqual('false') + expect(obj.$attrs.syncLoad).assertEqual('false') expect(obj.$attrs.objectRepeat).assertEqual('ImageRepeat.NoRepeat') expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.None') expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Original') diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets index 3110351ae2acf7c5accfb7c91499bfebc8ce0f3d..8b2706e148265306a423c3623d2373ea2cb87d45 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets @@ -98,5 +98,53 @@ export default function progressJsunit() { console.info('testGetProgressAttr2 END'); done(); }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0970 + * @tc.name testGetProgressAttr030 + * @tc.desc aceEtsTest + */ + it('testGetProgressAttr030', 0, async function (done) { + console.info('testGetProgressAttr3 START'); + let strJson = getInspectorByKey('progress3'); + let obj = JSON.parse(strJson); + console.info("component obj is: " + JSON.stringify(obj)); + console.log("progress style" + JSON.stringify(obj.$attrs.style)) + expect(obj.$attrs.style).assertEqual("ProgressStyle.Ring") + console.info('testGetProgressAttr3 END'); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0970 + * @tc.name testGetProgressAttr040 + * @tc.desc aceEtsTest + */ + it('testGetProgressAttr040', 0, async function (done) { + console.info('testGetProgressAttr4 START'); + let strJson = getInspectorByKey('progress4'); + let obj = JSON.parse(strJson); + console.info("component obj is: " + JSON.stringify(obj)); + console.log("progress style" + JSON.stringify(obj.$attrs.style)) + expect(obj.$attrs.style).assertEqual("ProgressStyle.ScaleRing") + console.info('testGetProgressAttr4 END'); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0970 + * @tc.name testGetProgressAttr050 + * @tc.desc aceEtsTest + */ + it('testGetProgressAttr020', 0, async function (done) { + console.info('testGetProgressAttr5 START'); + let strJson = getInspectorByKey('progress5'); + let obj = JSON.parse(strJson); + console.info("component obj is: " + JSON.stringify(obj)); + console.log("progress style" + JSON.stringify(obj.$attrs.style)) + expect(obj.$attrs.style).assertEqual("ProgressStyle.Capsule") + console.info('testGetProgressAttr5 END'); + done(); + }); }) } diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets index 123a8764384f2bb8e21409432b1b3b2358a1c06b..b56afc9402dd9a889f6b52d90461bf213c2a6422 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets @@ -65,6 +65,7 @@ export default function qrcodeJsunit() { let strJson = getInspectorByKey('qrcode'); let obj = JSON.parse(strJson); console.info("Qrcode component obj is: " + JSON.stringify(obj)); + console.info("qrcode backgroundColor" + JSON.stringify(obj.$attrs.backgroundColor)) console.info("qrcode width" + JSON.stringify(obj.$attrs.width)) console.info("qrcode height" + JSON.stringify(obj.$attrs.height)) console.info("qrcode value" + JSON.stringify(obj.$attrs.value)) diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets index 71afb201f5bd2b850c469bb027391985711cfc8d..9c6e7e4d3787b362645e5f73ed6d7ab14aba077d 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets @@ -88,7 +88,7 @@ export default function ScrollJsunit() { console.info("cd scroll1 component obj is: " + JSON.stringify(obj)); console.log("cd scroll1 scrollable" + JSON.stringify(obj.$attrs.scrollable)); console.log("cd scroll1 scrollBar" + JSON.stringify(obj.$attrs.scrollBar)); - expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.None') + expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.Horizontal') expect(obj.$attrs.scrollBar).assertEqual('BarState.Off') console.info('cd Scorll1GetInspectorByKey END'); done(); @@ -105,10 +105,27 @@ export default function ScrollJsunit() { console.info("cd scroll2 component obj is: " + JSON.stringify(obj)); console.log("cd scroll2 scrollable" + JSON.stringify(obj.$attrs.scrollable)); console.log("cd scroll2 scrollBar" + JSON.stringify(obj.$attrs.scrollBar)); - expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.Horizontal') + expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.None') expect(obj.$attrs.scrollBar).assertEqual('BarState.Off') console.info('cd Scorll2GetInspectorByKey END'); done(); }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_1050 + * @tc.name testScrollGetInspectorByKey040 + * @tc.desc aceEtsTest + */ + it('testScrollGetInspectorByKey040', 0, async function (done) { + let strJson = getInspectorByKey('scroll3'); + let obj = JSON.parse(strJson); + console.info("cd scroll3 component obj is: " + JSON.stringify(obj)); + console.log("cd scroll3 scrollable" + JSON.stringify(obj.$attrs.scrollable)); + console.log("cd scroll3 scrollBar" + JSON.stringify(obj.$attrs.scrollBar)); + expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.Free') + expect(obj.$attrs.scrollBar).assertEqual('BarState.Off') + console.info('cd Scorll3GetInspectorByKey END'); + done(); + }); }) } diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets index 458e7fb12cffbfd6c5134a63cb5745b0ddc507de..92cea8ef87d91e05305a6d844e872285cdbe08f5 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets @@ -64,19 +64,21 @@ export default function sliderJsunit() { let strJson = getInspectorByKey('slider1'); let obj = JSON.parse(strJson); console.info("component obj is Slider: " + JSON.stringify(obj)); - console.info("component obj is Slider: " + JSON.stringify(obj.$attrs.constructor)); - - console.info("slider1 blockColor " + JSON.stringify(obj.$attrs.constructor.blockColor)) - console.info("slider1 selectedColor " + JSON.stringify(obj.$attrs.constructor.selectedColor)) - console.info("slider1 trackColor " + JSON.stringify(obj.$attrs.constructor.trackColor)) - console.info("slider1 showTips " + JSON.stringify(obj.$attrs.constructor.showTips)) - console.info("slider1 showSteps " + JSON.stringify(obj.$attrs.constructor.showSteps)) - console.info("slider1 value " + JSON.stringify(obj.$attrs.constructor.value)) - console.info("slider1 min " + JSON.stringify(obj.$attrs.constructor.min)) - console.info("slider1 max " + JSON.stringify(obj.$attrs.constructor.max)) - console.info("slider1 step " + JSON.stringify(obj.$attrs.constructor.step)) - console.info("slider1 style " + JSON.stringify(obj.$attrs.constructor.style)) + console.info("slider1 blockColor" + JSON.stringify(obj.$attrs.constructor.blockColor)) + console.info("slider1 selectedColor" + JSON.stringify(obj.$attrs.constructor.selectedColor)) + console.info("slider1 trackColor" + JSON.stringify(obj.$attrs.constructor.trackColor)) + console.info("slider1 showTips" + JSON.stringify(obj.$attrs.constructor.showTips)) + console.info("slider1 showSteps" + JSON.stringify(obj.$attrs.constructor.showSteps)) + console.info("slider1 value" + JSON.stringify(obj.$attrs.constructor.value)) + console.info("slider1 direction" + JSON.stringify(obj.$attrs.constructor.direction)) + console.info("slider1 reverse" + JSON.stringify(obj.$attrs.constructor.reverse)) + console.info("slider1 minLabel" + JSON.stringify(obj.$attrs.constructor.minLabel)) + console.info("slider1 maxLabel" + JSON.stringify(obj.$attrs.constructor.maxLabel)) + console.info("slider1 min" + JSON.stringify(obj.$attrs.constructor.min)) + console.info("slider1 max" + JSON.stringify(obj.$attrs.constructor.max)) + console.info("slider1 step" + JSON.stringify(obj.$attrs.constructor.step)) + console.info("slider1 style" + JSON.stringify(obj.$attrs.constructor.style)) expect(obj.$attrs.constructor.blockColor).assertEqual('#FFFF0000') expect(obj.$attrs.constructor.selectedColor).assertEqual('#FF0000FF') expect(obj.$attrs.constructor.trackColor).assertEqual('#FF808080') @@ -101,9 +103,9 @@ export default function sliderJsunit() { let strJson = getInspectorByKey('slider2'); let obj = JSON.parse(strJson); console.info("component obj is Slider: " + JSON.stringify(obj)); - console.info("slider2 showTips " + JSON.stringify(obj.$attrs.constructor.showTips)) - console.info("slider2 showSteps " + JSON.stringify(obj.$attrs.constructor.showSteps)) - console.info("slider1 style " + JSON.stringify(obj.$attrs.constructor.style)) + console.info("slider2 showTips" + JSON.stringify(obj.$attrs.constructor.showTips)) + console.info("slider2 showSteps" + JSON.stringify(obj.$attrs.constructor.showSteps)) + console.info("slider1 style" + JSON.stringify(obj.$attrs.constructor.style)) expect(obj.$attrs.constructor.showTips).assertEqual("true") expect(obj.$attrs.constructor.showSteps).assertEqual("true") expect(obj.$attrs.constructor.style).assertEqual("SliderStyle.Inset") diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets index 4a529f325ebb873e797a4f97557562eac1a9a99e..d25cf7544a05a357ffc42e9b78758ccf4014fec7 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets @@ -64,12 +64,17 @@ export default function spanJsunit() { let strJson = getInspectorByKey('span1'); let obj = JSON.parse(strJson); console.info("component obj is: " + JSON.stringify(obj)); + console.info("span1 decoration" + JSON.stringify(obj.$attrs.decoration)) console.info("span1 textCase" + JSON.stringify(obj.$attrs.textCase)) console.info("span1 content" + JSON.stringify(obj.$attrs.content)) + console.info("span1 fontSize" + JSON.stringify(obj.$attrs.fontSize)) + console.info("span1 letterSpacing" + JSON.stringify(obj.$attrs.letterSpacing)) expect(obj.$attrs.decoration).assertEqual('{"Type":"TextDecorationType.LineThrough","Color":"#FFFF0000"}') expect(obj.$attrs.textCase).assertEqual('TextCase.UpperCase') expect(obj.$attrs.content).assertEqual('Test Span demo') + expect(obj.$attrs.fontSize).assertEqual('20fp') + expect(obj.$attrs.letterSpacing).assertEqual(5) console.info('testGetSpanAttr1 END'); done(); }); diff --git a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets index bc444b8bb636c392410c00db1268d07bf3bf337c..9d9cdc2bdb09b8b9f1ddec718b4044ff27bf3ad1 100644 --- a/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets +++ b/ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets @@ -95,6 +95,9 @@ export default function textJsunit() { console.log("cd text fontColor" + JSON.stringify(obj.$attrs.fontColor)); console.log("cd text visibility" + JSON.stringify(obj.$attrs.visibility)); console.log("cd text fontSize" + JSON.stringify(obj.$attrs.fontSize)); + console.log("cd text minFontSize" + JSON.stringify(obj.$attrs.minFontSize)); + console.log("cd text letterSpacing" + JSON.stringify(obj.$attrs.letterSpacing)); + console.log("cd text maxFontSize" + JSON.stringify(obj.$attrs.maxFontSize)); console.log("cd text fontWeight" + JSON.stringify(obj.$attrs.fontWeight)); console.log("cd text fontStyle" + JSON.stringify(obj.$attrs.fontStyle)); console.log("cd text fontFamily" + JSON.stringify(obj.$attrs.fontFamily)); @@ -135,7 +138,10 @@ export default function textJsunit() { expect(obj.$attrs.zIndex).assertEqual(1) expect(obj.$attrs.fontColor).assertEqual("#FF000000") expect(obj.$attrs.visibility).assertEqual("Visibility.Visible") - expect(obj.$attrs.fontSize).assertEqual("15.000000fp") + expect(obj.$attrs.fontSize).assertEqual("15.000000px") + expect(obj.$attrs.minFontSize).assertEqual("15") + expect(obj.$attrs.letterSpacing).assertEqual("15") + expect(obj.$attrs.maxFontSize).assertEqual("15") expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bold") expect(obj.$attrs.fontStyle).assertEqual("FontStyle.Italic") expect(obj.$attrs.fontFamily).assertEqual("sans-serif") diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets index 453bbfd0dc978ab74085396fd483a924b36d3d56..6496d52838e81179b7e1cb9c405bf3c25f7411fa 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + @Entry @Component struct alertdialog { @@ -31,14 +32,20 @@ struct alertdialog { AlertDialog.show({ title: 'Title', message: 'This is message', + autoCancel: true, primaryButton: { value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + alignment: 'DialogAlignment.Top', action: () => { this.currentTest = 'primaryButton' } }, secondaryButton: { value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', action: () => { this.currentTest = 'secondaryButton' } @@ -49,6 +56,281 @@ struct alertdialog { }) .key('alertDialog') }) + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.Center', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'secondaryButton' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog1') + }) + + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.Bottom', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'secondaryButton' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog2') + }) + + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.Default', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'secondaryButton' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog3') + }) + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.TopStart', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'secondaryButton' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog4') + }) + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.TopEnd', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'secondaryButton' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog5') + }) + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.CenterStart', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'secondaryButton' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog6') + }) + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.CenterEnd', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'secondaryButton' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog7') + }) + Button('Show Dialog With Two Buttons') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + alignment: 'DialogAlignment.BottomStart', + primaryButton: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'primaryButton' + } + }, + secondaryButton: { + value: 'cancle', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'BottomStart' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog8') + }) + + Button('Show Dialog With Confirm') + .width(300) + .margin(10) + .backgroundColor(Color.Blue) + .onClick(() => { + AlertDialog.show({ + title: 'Title', + message: 'This is message', + gridCount: '1', + alignment: 'DialogAlignment.BottomEnd', + confirm: { + value: '11111111111', + fontColor: '#FFFF0000', + backgroundColor: '#FFFFC0CB', + action: () => { + this.currentTest = 'confirm' + } + }, + cancel: () => { + this.currentTest = 'cancel' + } + }) + .key('alertDialog9') + }) } .width('100%') .height('100%') diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets index f38a58cc30212cd5579693555406b2425b0600e1..4acfe18f0a8799808133339519c045fbf273978f 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets @@ -36,6 +36,7 @@ struct alphabetIndexer { .fontWeight(FontWeight.Bold) Text("AlphabetIndexer0") AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .color('#FF00DDDD') .selectedColor(0xffffff) .key('alphabetIndexer') .popupColor('#FF737373') @@ -46,6 +47,9 @@ struct alphabetIndexer { .popupFont({ size: 30, weight: FontWeight.Bolder, style: FontStyle.Normal }) .itemSize(28) .alignStyle(IndexerAlign.Left) + .onSelected((index: number) => { + console.info(this.value[index] + ' on selected') + }) Text("AlphabetIndexer1") AlphabetIndexer({ arrayValue: this.value1, selected: 0 }) .selectedColor(0xffffff) @@ -59,6 +63,9 @@ struct alphabetIndexer { .itemSize(28) .alignStyle(IndexerAlign.Right) .margin({ left: 50 }) + .onSelected((index: number) => { + console.info(this.value[index] + ' on selected') + }) } } } diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets index a39ff4ae3fae857f622c125506754328958942cb..7d2c9bccc4f64278e93b784fe343e44d3f07920b 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + @Entry @Component struct calendar { @@ -47,31 +47,49 @@ struct calendar { preData: this.preMonth, nextData: this.nextMonth, controller: this.Controller - }) + .showLunar(true) .showHoliday(true) .needSlide(true) .offDays(Week.Tue | Week.Wed) .startOfWeek(Week.Sun) + .direction(Axis.Horizontal) .currentDayStyle({ dayColor: Color.Black, lunarColor: Color.Gray, + markLunarColor: Color.Black, dayFontSize: 15, lunarDayFontSize: 10, - boundaryColOffset: 10 - + boundaryColOffset: 10, }) .nonCurrentDayStyle({ nonCurrentMonthDayColor: Color.Black, - nonCurrentMonthLunarColor: Color.Gray - + nonCurrentMonthLunarColor: Color.Gray, + nonCurrentMonthWorkDayMarkColor: Color.Green, + nonCurrentMonthOffDayMarkColor: Color.Brown, }) .todayStyle({ focusedDayColor: Color.Red, focusedLunarColor: Color.Orange, focusedAreaBackgroundColor: Color.Blue, focusedAreaRadius: 20 - + }) + .weekStyle({ + weekColor: Color.Black, + weekendDayColor: Color.Orange, + weekendLunarColor: Color.Blue, + weekFontSize: 20, + weekHeight: 5, + weekWidth: 48, + }) + .workStateStyle({ + workDayMarkColor: Color.Red, + offDayMarkColor: Color.Orange, + workDayMarkSize: 10, + offDayMarkSize: 2, + workStateWidth: 12, + workStateHorizontalMovingDistance: 0, + workStateVerticalMovingDistance: 12, }) .onRequestData((request) => { switch (request.monthState) { @@ -88,9 +106,9 @@ struct calendar { lunarDay: this.lunarMonthDays[i % 30], dayMark: "work", dayMarkValue: "", - year: request.year; - month: request.month; - day: i + 1; + year: request.year, + month: request.month, + day: i + 1, isFirstOfLunar: false, hasSchedule: false, markLunarDay: false @@ -153,9 +171,22 @@ struct calendar { break; } }) + .onSelectChange((request) => { + this.year = request.year; + this.month = request.month; + console.info('On Select change: ' + this.year + '/' + this.month) + }) + Row() { + Button("back To Today").onClick(() => { + this.Controller.backToToday(); + console.info("back To Today") + }); + Button("go To").onClick(() => { + this.Controller.goTo({ year: 2021, month: 9, day: 10 }); + console.info("go To : 2021/9/10") + }); + } }.margin({ bottom: 10, right: 20, left: 20, top: 0 }) .height("50%") - - } } \ No newline at end of file diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets index 3517914ab88aa8b027ac6998de1c36171979465e..1aed06890cfa41b0e93b3ea76ad94b6abe05329c 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets @@ -27,44 +27,56 @@ struct CustomDialogExample { Flex({ justifyContent: FlexAlign.SpaceAround }) { Button('cancel') .onClick(() => { - this.controller.close() - this.cancel() - }).backgroundColor(0xffffff).fontColor(Color.Black) + this.controller.close() + this.cancel() + }).backgroundColor(0xffffff).fontColor(Color.Black) Button('confirm') .onClick(() => { - this.controller.close() - this.confirm() - }).backgroundColor(0xffffff).fontColor(Color.Red) + this.controller.close() + this.confirm() + }).backgroundColor(0xffffff).fontColor(Color.Red) }.margin({ bottom: 10 }) } } } +let Offset = { dx: 5, dy: 5 } + @Entry @Component struct CustomDialogUser { dialogController: CustomDialogController = new CustomDialogController({ builder: CustomDialogExample({ cancel: this.onCancel, confirm: this.onAccept }), cancel: this.existApp, - autoCancel: true + autoCancel: true, + offset: Offset, + alignment: DialogAlignment.Center, + customStyle: false, + gridCount: 5 }) onCancel() { console.info('Callback when the first button is clicked') } + onAccept() { console.info('Callback when the second button is clicked') } + existApp() { console.info('Click the callback in the blank area') } build() { - Column() { + Row() { + Button('click me') + .onClick(() => { + this.dialogController.open() + }).backgroundColor(0x317aff) Button('click me') .onClick(() => { - this.dialogController.open() - }).backgroundColor(0x317aff) + this.dialogController.close() + }).backgroundColor(0x317aff) }.width('100%').margin({ top: 5 }) } } \ No newline at end of file diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets index a42238edcea13742f300d8b5e29ced841e121cbb..de3c1440689fed5ee05702225ba629a3e0ed0093 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,18 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +let ItemDragInfo: { + x: 5, + y: 5 +} + @Entry @Component struct ListExample { - private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + private arr1: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + private arr2: number[] = ['a', 'b', 'c', 'd', 'e', 'f'] @State editFlag: boolean = false + @State bool1: boolean = false + @State bool2: boolean = false build() { Stack({ alignContent: Alignment.TopStart }) { Column() { List({ space: 20, initialIndex: 0 }) { - ForEach(this.arr, (item) => { + ForEach(this.arr1, (item) => { ListItem() { Text('' + item) .width('100%') @@ -44,14 +52,63 @@ struct ListExample { console.info('first' + firstIndex) console.info('last' + lastIndex) }) + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info('scrollOffset:' + scrollOffset) + console.info('ScrollState:' + scrollState) + }) .editMode(this.editFlag) .onItemDelete((index: number) => { - console.info(this.arr[index] + 'Delete') - this.arr.splice(index, 1) - console.info(JSON.stringify(this.arr)) + console.info(this.arr1[index] + 'Delete') + this.arr1.splice(index, 1) + console.info(JSON.stringify(this.arr1)) this.editFlag = false return true }) + .onReachStart(() => { + console.info("On Reach Start") + }) + .onReachEnd(() => { + console.info("On Reach End") + }) + .onScrollStop(() => { + console.info("On Scroll Stop") + }) + .onItemMove((from: number, to: number) => { + console.info(from + 'from') + console.info(to + 'to') + return true + }) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.bool1 = true + this.text = this.arr1[itemIndex] + console.log('onItemDragStart, itemIndex:' + itemIndex); + return this.pixelMapBuilder; + }) + .onItemDragEnter((event: ItemDragInfo) => { + console.log('onItemDragEnter'); + }) + .onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + console.log('onItemDragMove,itemIndex:' + itemIndex + 'insertIndex:' + insertIndex) + }) + .onItemDragLeave((event: ItemDragInfo, itemIndex: number) => { + console.log('onItemDragLeave, itemIndex:' + itemIndex); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + console.log('ItemDragInfo, itemIndex:' + itemIndex + 'insertIndex:' + insertIndex + 'isSuccess:' + isSuccess); + if (isSuccess) { + if (this.bool2) { + this.arr2.splice(itemIndex, 1) + this.arr1.splice(insertIndex, 0, this.text) + this.bool1 = false + this.bool2 = false + } else if (this.bool1) { + this.arr2.splice(itemIndex, 1) + this.arr1.splice(insertIndex, 0, this.text) + this.bool1 = false + this.bool2 = false + } + } + }) .width('90%') }.width('100%') diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets index 7d4d320468a7d6a7a0dfcf29c41455a508477a11..e031467a3b8941d38d052bde5af1ab4b0ebb6eb9 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + @Entry @Component struct listItem_testcase { @@ -25,22 +25,40 @@ struct listItem_testcase { Column() { List() { ListItem() { - Text('sticky:Normal , item1111') + Text('sticky:None , item1111') .width('100%') .height(40) .fontSize(12) - }.sticky(Sticky.Normal) + }.sticky(Sticky.None) .editable(true) .key('listitem') + ListItem() { + Text('sticky:Normal , item2222') + .width('100%') + .height(40) + .fontSize(12) + }.sticky(Sticky.Normal) + .editable(EditMode.Deletable) + .key('listitem2') + ListItem() { Text('sticky:Opacity , item3333') .width('100%') .height(40) .fontSize(12) }.sticky(Sticky.Opacity) - .editable(true) + .editable(EditMode.None) .key('listitem3') + + ListItem() { + Text('sticky:Opacity , item4444') + .width('100%') + .height(40) + .fontSize(12) + }.sticky(Sticky.Opacity) + .editable(EditMode.Movable) + .key('listitem4') } }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) }.width(300) diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets index d80e7c43d5799db1cad88c0b48cbe5cc3d5db609..2fd81eb014d5da5ee393a3a06b550e79bbfeb8a6 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets @@ -72,6 +72,7 @@ struct SwiperExample { .loop(false) .duration(1000) .vertical(false) + .disableSwipe(true) .itemSpace(0) .onChange((index: number) => { console.info(index.toString()) @@ -86,6 +87,10 @@ struct SwiperExample { .onClick(() => { this.swiperController.showPrevious() }) + Button('finishAnimation') + .onClick(() => { + this.swiperController.finishAnimation() + }) } }.margin({ top: 5 }) } diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets index 398f48c6c534c22171ad186b391146f7f86c25a6..9989c70d984aa26952ed40b784aec67f616448f8 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets @@ -20,6 +20,12 @@ struct TabsExample { build() { Column() { + Button('changeIndex') + .onClick(() => { + this.controller.changeIndex(0) + console.log('change Index ') + }) + Tabs({ barPosition: BarPosition.Start, index: 1, controller: this.controller }) { TabContent() { Column().width('100%').height('100%').backgroundColor(Color.Pink) diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets index 554b1b81d5e2e0ba14c912953bf513830668b63f..9f7abe79c1bededd66f553211301e174c4c30f03 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets @@ -40,6 +40,31 @@ struct VideoCreateComponent { .loop(true) .objectFit(ImageFit.Cover) .key('video') + .onStart(() => { + console.info("onStart"); + }) + .onPause(() => { + console.info("onPause"); + }) + .onFinish(() => { + console.info("onFinish"); + }) + .onPrepared(() => { + console.info("onPrepared"); + }) + .onSeeking(() => { + console.info("onSeeking"); + }) + .onSeeked(() => { + console.info("onSeeked"); + }) + .onUpdate(() => { + console.info("onUpdate"); + }) + .onError(() => { + console.info("onError"); + }) + Row() { Button("start").onClick(() => { this.myVideoController.start(); @@ -53,6 +78,18 @@ struct VideoCreateComponent { Button("setCurrentTime").onClick(() => { this.myVideoController.setCurrentTime(9); }); + Button("setCurrentTime").onClick(() => { + this.myVideoController.setCurrentTime(9, SeekMode.PreviousSync); + }); + Button("setCurrentTime").onClick(() => { + this.myVideoController.setCurrentTime(9, SeekMode.NextSync); + }); + Button("setCurrentTime").onClick(() => { + this.myVideoController.setCurrentTime(9, SeekMode.Closest); + }); + Button("setCurrentTime").onClick(() => { + this.myVideoController.setCurrentTime(9, SeekMode.ClosestSync); + }); } } } diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets index a8dbc04572a921e4ad6564c9d7f6887638322289..ac6ff7254b4c62af9903ca7b0e16be525d208f3e 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets @@ -70,7 +70,7 @@ export default function listItemJsunit() { console.log(JSON.stringify(obj.$attrs.type)) console.log('ListItem1‘s sticky is ' + JSON.stringify(obj.$attrs.sticky)) console.log('ListItem1‘s editable is ' + JSON.stringify(obj.$attrs.editable)) - expect(obj.$attrs.sticky).assertEqual('Sticky.Normal') + expect(obj.$attrs.sticky).assertEqual('Sticky.None') expect(obj.$attrs.editable).assertEqual('true') console.info('++++++++++++++++ ListItem TestCase 1 End ++++++++++++++++'); done(); @@ -83,7 +83,7 @@ export default function listItemJsunit() { */ it('listItemTest002', 0, async function (done) { console.info('++++++++++++++++ ListItem TestCase 2 START ++++++++++++++++'); - let strJson = getInspectorByKey('listitem3'); + let strJson = getInspectorByKey('listitem2'); let obj = JSON.parse(strJson); console.info("get inspector value is: " + JSON.stringify(obj)); console.log(JSON.stringify(obj.$type)) @@ -92,10 +92,54 @@ export default function listItemJsunit() { console.log('ListItem2‘s sticky is ' + JSON.stringify(obj.$attrs.sticky)) console.log('ListItem2‘s editable is ' + JSON.stringify(obj.$attrs.editable)) await sleep(1) - expect(obj.$attrs.sticky).assertEqual('Sticky.Opacity') - expect(obj.$attrs.editable).assertEqual('true') + expect(obj.$attr.sticky).assertEqual('Sticky.Normal') + expect(obj.$attr.editable).assertEqual('EditMode.Deletable') + console.info('++++++++++++++++ ListItem TestCase 2 End ++++++++++++++++'); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0410 + * @tc.name listItemTest003 + * @tc.desc aceEtsTest + */ + it('listItemTest003', 0, async function (done) { + console.info('++++++++++++++++ ListItem TestCase 3 START ++++++++++++++++'); + let strJson = getInspectorByKey('listitem3'); + let obj = JSON.parse(strJson); + console.info("get inspector value is: " + JSON.stringify(obj)); + console.log(JSON.stringify(obj.$type)) + expect(obj.$type).assertEqual('ListItem') + console.log(JSON.stringify(obj.$attrs.type)) + console.log('ListItem3‘s sticky is ' + JSON.stringify(obj.$attrs.sticky)) + console.log('ListItem3‘s editable is ' + JSON.stringify(obj.$attrs.editable)) + await sleep(1) + expect(obj.$attr.sticky).assertEqual('Sticky.Opacity') + expect(obj.$attr.editable).assertEqual('EditMode.None') console.info('++++++++++++++++ ListItem TestCase 3 End ++++++++++++++++'); done(); }); + + /** + * @tc.number SUB_ACE_BASIC_ETS_API_0420 + * @tc.name listItemTest004 + * @tc.desc aceEtsTest + */ + it('listItemTest004', 0, async function (done) { + console.info('++++++++++++++++ ListItem TestCase 4 START ++++++++++++++++'); + let strJson = getInspectorByKey('listitem4'); + let obj = JSON.parse(strJson); + console.info("get inspector value is: " + JSON.stringify(obj)); + console.log(JSON.stringify(obj.$type)) + expect(obj.$type).assertEqual('ListItem') + console.log(JSON.stringify(obj.$attrs.type)) + console.log('ListItem4‘s sticky is ' + JSON.stringify(obj.$attrs.sticky)) + console.log('ListItem4‘s editable is ' + JSON.stringify(obj.$attrs.editable)) + await sleep(1) + expect(obj.$attr.sticky).assertEqual('Sticky.Opacity') + expect(obj.$attr.editable).assertEqual('EditMode.Movable') + console.info('++++++++++++++++ ListItem TestCase 4 End ++++++++++++++++'); + done(); + }); }) } diff --git a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets index 1eb5ab2bb4cea34cf2ae30f710e7b7113555f925..adf3c932920c1d3b19dcb66badf679aab0ef9333 100644 --- a/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets +++ b/ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets @@ -100,6 +100,7 @@ export default function swiperJsunit() { console.log('Swiper‘s duration is ' + JSON.stringify(obj.$attrs.duration)) console.log('Swiper‘s vertical is ' + JSON.stringify(obj.$attrs.vertical)) console.log('Swiper‘s itemSpace is ' + JSON.stringify(obj.$attrs.itemSpace)) + console.log('Swiper‘s disableSwipe is ' + JSON.stringify(obj.$attrs.disableSwipe)) expect(obj.$attrs.index).assertEqual('1') expect(obj.$attrs.autoPlay).assertEqual('true') expect(obj.$attrs.interval).assertEqual('4000') diff --git a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets index 065430cec7d0c80703be945bb2aa1afd69919823..5757bcd3da778441b692d521709fcda6579e954b 100644 --- a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets +++ b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets @@ -69,6 +69,9 @@ struct NavigationExample { { value: 'add' }, { value: 'collect' } ] }) + .onTitleModeChanged((titleModel: NavigationTitleMode) => { + console.log('titleMode:' + titleModel) + }) Navigation() { Search({ value: '', placeholder: '' }).width('90%').margin(0) diff --git a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets index f3f99498154176c33ab65a7d24e845db02c15852..2f19a6fe970472749deaf6067ac35bdee20be18f 100644 --- a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets +++ b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets @@ -61,6 +61,12 @@ struct StepperExample { .onChange((prevIndex: number, index: number) => { this.currentIndex = index }) + .onNext((index: number, pendingIndex: number) => { + console.info('pendingIndex:' + pendingIndex) + }) + .onPrevious((index: number, pendingIndex: number) => { + console.info('pendingIndex:' + pendingIndex) + }) .align(Alignment.Center) } } diff --git a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets index b8e5a9353ef8bce194968c6b48412db00466bae4..ccb6ee2fe5bf5b2f8b7a83714eea460463bb5317 100644 --- a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets +++ b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets @@ -46,6 +46,8 @@ struct TextAreaExample { .onChange((value: string) => { this.text1 = value }) + .onCopy((value: string) => { + }) .key('textArea1') Text(this.text2).width('90%').height(60).fontSize(40) diff --git a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets index 220765c59268671c7c3d534570afeec878c8a365..ae58053494a795a065095952d39e227b0eb1ff83 100644 --- a/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets +++ b/ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets @@ -46,6 +46,15 @@ struct TextInputExample { .onChange((value: string) => { this.textNew = value }) + .onSubmit((enterKey) => { + this.textNew = 'onSubmit' + }) + .onEditChanged((isEditing) => { + this.textNew = 'onEditChanged' + }) + .onCopy((value: string) => { + }) + .key('textInput1') TextInput({ placeholder: 'textInput 2', text: this.text })