diff --git a/arkui/ace_ets_component_apilack/entry/src/main/config.json b/arkui/ace_ets_component_apilack/entry/src/main/config.json index 97af9a51af13cff779f962e068b58fa720a83a52..42fe0abf77575e535b8be419b7a470278e20ffe7 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/config.json +++ b/arkui/ace_ets_component_apilack/entry/src/main/config.json @@ -79,6 +79,7 @@ "pages/common", "pages/common_ts_ets_api", "pages/curves", + "pages/dom", "pages/ellipse", "pages/featureAbility", "pages/focusControl", @@ -89,6 +90,7 @@ "pages/grid_col", "pages/grid_row", "pages/gridItem", + "pages/image", "pages/inspector", "pages/lazyForEach", "pages/line", @@ -96,6 +98,7 @@ "pages/list_item", "pages/mediaQuery", "pages/navigator", + "pages/onVisibleAreaChange", "pages/page1", "pages/pageRoute", "pages/page_transition", diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets index 4e3c3b5bf31b87abea5423dd2741db1675b86eec..78d0d36e54a23383149119e53f33401885ed4387 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets @@ -22,6 +22,7 @@ export default struct CircleNe { @State w: string = "100px"; @State h: string = "100px"; + aboutToAppear() { Log.showInfo(TAG, `aboutToAppear CircleNew start`) } @@ -51,6 +52,10 @@ struct CircleNe { .width(`${this.w}`) .height(`${this.h}`) .key('circle') + + Image($rawfile('test.png')) + .mask(new Circle({ width: '150px', height: '150px' }).fill(Color.Gray)) + .width('500px').height('280px') }.width("100%").height("100%") } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common.ets index b468dbe801dfe8c7a1fa87e5ee7bba3658fa5395..d25aa5d921a18abf47e0512c4f555cef32654cb1 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common.ets @@ -21,6 +21,7 @@ const TAG = 'ets_apiLack_add'; @Component export default struct CommonBackgroundBlurStyle { @State value: string = '' + aboutToAppear() { Log.showInfo(TAG, `aboutToAppear CommonBackgroundBlurStyle start`) } @@ -42,6 +43,42 @@ export default struct CommonBackgroundBlurStyle { .opacity(1) } + buttonTab(){ + let keyEventDown = { + isPressed: true, + keyCode: 2049, + keyDownDuration: 0, + isIntercepted: false + } + let res1 = inputEventClient.injectEvent({KeyEvent: keyEventDown}); + + let keyEventUp = { + isPressed: false, + keyCode: 2049, + keyDownDuration: 0, + isIntercepted: false + } + let res2 = inputEventClient.injectEvent({KeyEvent: keyEventUp}); + } + + buttonOnKey(){ + let keyEventDown = { + isPressed: true, + keyCode: 2054, + keyDownDuration: 0, + isIntercepted: false + } + let res3 = inputEventClient.injectEvent({KeyEvent: keyEventDown}); + + let keyEventUp = { + isPressed: false, + keyCode: 2054, + keyDownDuration: 0, + isIntercepted: false + } + let res4 = inputEventClient.injectEvent({KeyEvent: keyEventUp}); + } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { @@ -131,13 +168,8 @@ export default struct CommonBackgroundBlurStyle { Button('common-OnKeyEvent') .onClick(()=>{ - let keyEvent = { - isPressed: true, - keyCode: 2054, - keyDownDuration: 0, - isIntercepted: false - } - let res = inputEventClient.injectEvent({KeyEvent: keyEvent}); + this.buttonTab() + this.buttonOnKey() }) .key("onKeyEventButton") .onKeyEvent((event: KeyEvent) => { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common_ts_ets_api.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common_ts_ets_api.ets index 9b0871f5cad3be191acf171c20da86644f93132c..4ad9aa342f7673d7834fc9f5607595e89f5091e9 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common_ts_ets_api.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/common_ts_ets_api.ets @@ -19,7 +19,7 @@ import events_emitter from '@ohos.events.emitter'; let varA = AppStorage.Link('varA') //Environment.EnvProp("accessibilityEnabled", "default") -//PersistentStorage.PersistProp("highScore", 0) +PersistentStorage.PersistProp("highScore", 0) const TAG = 'ets_apiLack_add'; @Entry @@ -89,7 +89,6 @@ export default struct Common_ts_ets_apiStaticClear { .key("EnvPropText") .onClick(() => { var enable = AppStorage.Get("accessibilityEnabled"); -// console.log(enable.toString()) try { var backData = { data: { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/curves.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/curves.ets index 21cd71215a020b325a98d13b0eb86148bcc498cc..ff120314467a52aa92b4282f80cc6a2995f4b358 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/curves.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/curves.ets @@ -22,6 +22,9 @@ const TAG = 'ets_apiLack_add'; @Component export default struct CurvesSteps { @State curveApi:string = "success" + @State curve1:ICurve = Curves.springMotion(0.40, 0.99, 0) + @State curve2:ICurve = Curves.responsiveSpringMotion(0.40, 0.99, 0); + aboutToAppear() { Log.showInfo(TAG, `aboutToAppear CurvesSteps start`) } @@ -58,6 +61,8 @@ export default struct CurvesSteps { var backData = { data: { "curveApi": this.curveApi, + "curveSpringMotion": this.curve1, + "curveResSpringMotion": this.curve2 } } let backEvent = { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/dom.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/dom.ets new file mode 100644 index 0000000000000000000000000000000000000000..61eeaa5aa4cbe09a0244014e4154af5862038310 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/dom.ets @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Log from '../common/Log.ets'; + +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default struct DomCreateElement { + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear DomCreateElement start`) + } + + aboutToDisappear() { + Log.showInfo(TAG, `aboutToDisAppear DomCreateElement end`) + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + + Text("dom-CreateElement") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .key("createElementText") + .onClick(() => { +// dom.createElement('div') + }) + + }.width("100%").height("100%") + } +} diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets index 42183cb86929d4e6e19f9f0ac2993f226606ba9b..ab5d5e0aecafb7a0f0fb480d66c0985bdba5521c 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets @@ -22,6 +22,7 @@ export default struct EllipseNe { @State w: string = "300.00px"; @State h: string = "300.00px"; + aboutToAppear() { Log.showInfo(TAG, `aboutToAppear EllipseNe start`) } @@ -46,6 +47,11 @@ struct EllipseNe { .textAlign(TextAlign.Center) .textOverflow({ overflow: TextOverflow.None }) .key("neText") + + Image($rawfile('test.png')) + .mask(new Ellipse({ width: '150px', height: '150px' }).fill(Color.Gray)) + .width('500px').height('280px') + Ellipse().width(`${this.w}`).height(`${this.h}`).key('ellipse') }.width('100%').height('100%') } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets index b3cedb8d724d305dcf8c04329ebf2fbf6a4ab006..1fbe15140fe6844b86875686773d66ff66f7dbb8 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/focusControl.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets new file mode 100644 index 0000000000000000000000000000000000000000..fc877f9decc374f41c3d385625a05bf0fa497ff8 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; +import events_emitter from '@ohos.events.emitter'; + +@Entry +@Component +export default +struct ImageExample { + build() { + Column() { + Column() { + Column() { + Image($rawfile('test.png')) + .width(240).height(240) + .colorFilter([1,2,3]) + .overlay('colorFilter', { align: Alignment.Bottom, offset: { x: 0, y: -15 } }) + }.border({ color: Color.Black, width: 2 }) + }.width('100%') + }.padding({ top: 20 }) + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/line.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/line.ets index 553be0cef3774e184c6e46112c77676bed08a122..0f29bf5f99cd068d1638564caa7e2c6580656bf4 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/line.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/line.ets @@ -15,6 +15,7 @@ import Log from '../common/Log.ets'; const TAG = 'ets_apiLack_add'; +let my_line = new Line() @Entry @Component diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/onVisibleAreaChange.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/onVisibleAreaChange.ets new file mode 100644 index 0000000000000000000000000000000000000000..0dfdcd6ccc8ed12a0aaa8518fa4c0b3ccdba1952 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/onVisibleAreaChange.ets @@ -0,0 +1,109 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ScrollExample { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State testTextStr: string = "test" + @State testRowStr: string = "test" + + build() { + Column() { + Column() { + Text(this.testTextStr) + .fontSize(20) + + Text(this.testRowStr) + .fontSize(20) + } + .height(100) + .backgroundColor(Color.Gray) + .opacity(0.3) + + Scroll(this.scroller) { + Column() { + Text("Test Text Visible Change") + .fontSize(20) + .height(200) + .margin({ top: 50, bottom: 20 }) + .backgroundColor(Color.Green) + // 通过设置ratios为[0.0, 1.0],实现当组件完全显示或完全消失在屏幕中时触发回调 + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { + console.info("Test Text isVisible: " + isVisible + ", currentRatio:" + currentRatio) + if (isVisible && currentRatio >= 1.0) { + console.info("Test Text is fully visible. currentRatio:" + currentRatio) + this.testTextStr = "Test Text is fully visible" + } + + if (!isVisible && currentRatio <= 0.0) { + console.info("Test Text is completely invisible.") + this.testTextStr = "Test Text is completely invisible" + } + }) + + Row() { + Text("Test Row Visible Change") + .fontSize(20) + .margin({ bottom: 20 }) + + } + .height(200) + .backgroundColor(Color.Yellow) + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { + console.info("Test Row isVisible:" + isVisible + ", currentRatio:" + currentRatio) + if (isVisible && currentRatio >= 1.0) { + console.info("Test Row is fully visible.") + this.testRowStr = "Test Row is fully visible" + } + + if (!isVisible && currentRatio <= 0.0) { + console.info("Test Row is is completely invisible.") + this.testRowStr = "Test Row is is completely invisible" + } + }) + + ForEach(this.arr, (item) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, item => item) + + }.width('100%') + } + .backgroundColor(0x317aff) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(30) + .onScroll((xOffset: number, yOffset: number) => { + console.info(xOffset + ' ' + yOffset) + }) + .onScrollEdge((side: Edge) => { + console.info('To the edge') + }) + .onScrollEnd(() => { + console.info('Scroll Stop') + }) + + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pageRoute.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pageRoute.ets index b98d8a6f13820272316d2957bc54354176204b1d..50200e32378ead284ad1f941c84e0feb37883da0 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pageRoute.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/pageRoute.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/path.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/path.ets index 77800a0385ee63de76d77b6b1a17ebdf5f3db309..2282bc2c1bab80fe8b63e1a4cc87104da1575494 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/path.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/path.ets @@ -53,6 +53,10 @@ export default struct PathNew { Path().width("100px").height("100px").commands('M150 0 L300 300 L0 300 Z') .key("Path") + Image($rawfile('test.png')) + .mask(new Path({ width: '150px', height: '150px' }).fill(Color.Gray)) + .width('500px').height('280px') + }.width("100%").height("100%") } } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/prompt.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/prompt.ets index a99a79de0f972458ca984c0f20094f98f3fdd2a0..e54b80ab6c2fb1ea661ae0c8fd88aa13fef96ffc 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/prompt.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/prompt.ets @@ -61,18 +61,6 @@ export default struct PromptShowDialog { } catch (err) { console.info("showDialog emit action state err: " + JSON.stringify(err.message)) } -// prompt.showDialog({ -// title: 'Title Info', -// message: 'Message Info', -// buttons: [ -// { text: 'button1', color: 'red' }, -// { text: 'button2', color: 'blue' } -// ] -// }).then(data => { -// console.info('showDialog success, click button: ' + data.index) -// }).catch(err => { -// console.info('showDialog error: ' + err) -// }) }) Text("prompt-ShowActionMenu") @@ -104,19 +92,6 @@ export default struct PromptShowDialog { } catch (err) { console.info("showActionMenu emit action state err: " + JSON.stringify(err.message)) } - -// prompt.showActionMenu({ -// title: 'Title Info', -// buttons: [ -// { text: 'item1', color: '#666666' }, -// { text: 'item2', color: '#000000' } -// ] -// }).then(data => { -// var result=true -// console.info('showDialog success, click button: ' + data.index) -// }).catch(err => { -// console.info('showDialog error: ' + err) -// }) }) }.width("100%").height("100%") diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/promptApi.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/promptApi.ets new file mode 100644 index 0000000000000000000000000000000000000000..6326cb1218d942d3e012a56ccd1dbdb44b0b6fdb --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/promptApi.ets @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@ohos.prompt' +import Log from '../common/Log.ets'; +import events_emitter from '@ohos.events.emitter'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +export default struct PromptShowDialog { + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear PromptShowDialog start`) + } + + aboutToDisappear() { + Log.showInfo(TAG, `aboutToDisAppear PromptShowDialog end`) + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + + Text("prompt-ShowDialog") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .onClick(() => { + prompt.showDialog({ + title: 'Title Info', + message: 'Message Info', + buttons: [ + { text: 'button1', color: 'red' }, + { text: 'button2', color: 'blue' } + ] + }).then(data => { + console.info('showDialog success, click button: ' + data.index) + }).catch(err => { + console.info('showDialog error: ' + err) + }) + }) + + Text("prompt-ShowActionMenu") + .width(100) + .height(70) + .fontSize(20) + .opacity(1) + .align(Alignment.TopStart) + .fontColor(0xCCCCCC) + .lineHeight(25) + .border({ width: 1 }) + .padding(10) + .textAlign(TextAlign.Center) + .textOverflow({ overflow: TextOverflow.None }) + .onClick(() => { + prompt.showActionMenu({ + title: 'Title Info', + buttons: [ + { text: 'item1', color: '#666666' }, + { text: 'item2', color: '#000000' } + ] + }).then(data => { + var result=true + console.info('showDialog success, click button: ' + data.index) + }).catch(err => { + console.info('showDialog error: ' + err) + }) + }) + + }.width("100%").height("100%") + } +} + diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/rect.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/rect.ets index 27b05d11cc583aee743264d7b87430c6eefd940f..714e1765c8591458752ca63c649024a424303788 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/rect.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/rect.ets @@ -54,6 +54,10 @@ export default struct RectNe { Rect({ width: '90%', height: "50px" }).radiusHeight(20).radiusWidth(20) .key("Rect") + Image($rawfile('test.png')) + .mask(new Rect({ width: '150px', height: '150px' }).fill(Color.Gray)) + .width('500px').height('280px') + }.width("100%").height("100%") } } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/shape.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/shape.ets index 4e0fbba4c8a637ef1840073c1805665f51adea7c..52e516025c1c19020e37f77047b1493b2d366c01 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/shape.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/shape.ets @@ -21,7 +21,6 @@ const TAG = 'ets_apiLack_add'; @Component export default struct ShapeNe { - aboutToAppear() { Log.showInfo(TAG, `aboutToAppear ShapeNe start`) } @@ -46,6 +45,16 @@ struct ShapeNe { .textAlign(TextAlign.Center) .textOverflow({ overflow: TextOverflow.None }) .key("neText") + + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + } + .viewPort({ x: 0, y: -5, width: 300, height: 20 }) + .stroke(0xEE8443).strokeWidth(10).strokeDashArray([20]).strokeDashOffset(10) + + Shape() { + Path().width(300).height(10).commands('M0 0 L900 0') + }.viewPort({ x: 0, y: -5, width: 300, height: 20 }).stroke(0xEE8443).strokeWidth(10).strokeOpacity(0.5) }.width("100%").height("100%") } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets index 1a2d6bd3dff0449ca6610725808c4c0e900ca047..cc24bb089574b838dc00a3635034bf487863c6c6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/FocusControlJsunit.test.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets index e7507444adac3afed7d432c83b969aac56058d53..fac4fc55c035f646fafff3627baef2740edb0cc8 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/pageRoute.test.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,29 +42,29 @@ export default function pageRouteTest() { done() }); - afterEach(async function () { - await Utils.sleep(1000); - console.info("pageRouteTest after each called"); - }) - - it('testOnPageHide01', 0, function () { - console.info('[testOnPageHide01] START'); - var callback = (eventData) => { - console.info("[testOnPageHide01] get event state result is: " + JSON.stringify(eventData)); - expect(eventData.data.value).assertEqual('onPageHide') - done() - } - var innerEvent = { - eventId: 10, - priority: events_emitter.EventPriority.LOW - } - try { - events_emitter.on(innerEvent, callback) - console.info("testOnPageHide01 click result is: " + JSON.stringify(sendEventByKey('next', 10, ""))); - } catch (err) { - console.info("[testOnPageHide01] on events_emitter err : " + JSON.stringify(err)); - } - console.info('[testOnPageHide01] testSendTouchEvent END'); - }); + afterEach(async function () { + await Utils.sleep(1000); + console.info("pageRouteTest after each called"); }) + + it('testOnPageHide01', 0, async function (done) { + console.info('[testOnPageHide01] START'); + var callback = (eventData) => { + console.info("[testOnPageHide01] get event state result is: " + JSON.stringify(eventData)); + expect(eventData.data.value).assertEqual('onPageHide') + done(); + } + var innerEvent = { + eventId: 10, + priority: events_emitter.EventPriority.LOW + } + try { + events_emitter.on(innerEvent, callback) + console.info("testOnPageHide01 click result is: " + JSON.stringify(sendEventByKey('next', 10, ""))); + } catch (err) { + console.info("[testOnPageHide01] on events_emitter err : " + JSON.stringify(err)); + } + console.info('[testOnPageHide01] testSendTouchEvent END'); + }); + }) } \ No newline at end of file diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets index 61d94b77ef0dcc29be9899527ddf6fed66f0e21f..5d80ac2efcba8c9a9c652474777cdc96a9add0f4 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/plugin_component.js b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/plugin_component.js index 6a3b4ed6c92a847bc0c1a8421cefc8a5b8b52d1c..b0d7eea42d114f3d45dce42d90176137d8f410a0 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/plugin_component.js +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/common/plugin_component.js @@ -50,6 +50,9 @@ export default { want: { bundleName: "com.example.myapplication", abilityName: "com.example.myapplication.MainAbility", + "parameters": { + DIMENSION_KEY: FormDimension.Dimension_1_2 + } }, name: "plugintemplate", data: { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/canvas.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/canvas.ets index 2e2e4affc2fced5a3c1529a15b3dbf8e13ddeadc..68eb1ed29b6b272dc327979e9be5f85b301da6d4 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/canvas.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/canvas.ets @@ -59,13 +59,11 @@ struct CanvasActualBoundingBoxAscent { this.context.fillText("fontBoundingBoxDescent:" + this.context.measureText("Hello World!").fontBoundingBoxDescent, 20, 600) this.context.fillText("hangingBaseline:" + this.context.measureText("Hello World!").hangingBaseline, 20, 650) this.context.fillText("ideographicBaseline" + this.context.measureText("Hello World!").ideographicBaseline, 20, 700) - //this.context.fillText("antialias" + this.context.measureText("Hello World!").antialias, 20, 700) +// this.context.fillText("antialias" + this.context.measureText("Hello World!").antialias, 20, 700) }) } .width('100%') .height('100%') - - } } diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets index 025f99e48e646d0afcd9a1b89bc3cf3f0e054854..59c3785e25d392190ae2ed36dabca17d61a69c7a 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets @@ -15,6 +15,7 @@ import Log from '../common/Log.ets'; import events_emitter from '@ohos.events.emitter'; +import Utils from '../../test/Utils.ets' const TAG = 'ets_apiLack_add'; @Entry @@ -66,6 +67,7 @@ struct CheckBoxGroupPart { .selectedColor(0xed6f21) .onChange((itemName:CheckboxGroupResult) => { console.info("TextPicker::dialogResult is" + JSON.stringify(itemName)) + console.info("TextPicker::dialogResult is" + JSON.stringify(itemName.status)) try { var backData = { data: { @@ -81,6 +83,10 @@ struct CheckBoxGroupPart { } catch (err) { console.info("Part emit action state err: " + JSON.stringify(err.message)) } + Utils.sleep(1000); + if(itemName.status === SelectStatus.Part){ + console.info("CheckboxGroup SelectStatus.Part") + } }) Text('select all').fontSize(20) Checkbox({name: 'checkbox1', group: 'checkboxGroup'}) diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/copyOption.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/copyOption.ets index e96d89fe933bc352dd0728f6ed1ae3952b072517..45d9185f2dd57dd13ebc2dc0a0d3380b62dee6e4 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/copyOption.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/copyOption.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -46,7 +45,7 @@ struct CopyOption { .textAlign(TextAlign.Center) .textOverflow({ overflow: TextOverflow.None }) .key("InAppText") - .copyOption(CopyOption.InApp) +// .copyOption(CopyOption.InApp) .visibility(Visibility.None) Text("copyOption-LocalDevice") @@ -62,7 +61,7 @@ struct CopyOption { .textAlign(TextAlign.Center) .textOverflow({ overflow: TextOverflow.None }) .key("LocalDeviceText") - .copyOption(CopyOption.LocalDevice) +// .copyOption(CopyOption.LocalDevice) .visibility(Visibility.None) }.width("100%").height("100%") diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/enums.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/enums.ets index b29688e27b63b7ff4c5359666abc9f4350421d07..8a658286538e07ee855ae2c970eb7b4e86321441 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/enums.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/enums.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -563,7 +562,7 @@ struct EnumsCancel { .textAlign(TextAlign.Center) .textOverflow({ overflow: TextOverflow.None }) .key("CrossDeviceText") - .copyOption(CopyOption.CrossDevice) +// .copyOption(CopyOptions.CrossDevice) .visibility(Visibility.None) Button('Touch').backgroundColor(0x2788D9).height(40).width(80) diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets index 435a19efac72c0d43ea35235e05ccdcc76de85ee..c883c70f477c9eae4a7cc027130a9c222c9c0801 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,14 +39,14 @@ struct HitTestMode { .key("Block") .width("100%") .height("100%") - .hitTestBehavior(HitTestMode.Block) +// .hitTestBehavior(HitTestMode.Block) .onTouch((event) => { console.info('HitTestMode inner stack touched type: ' + event.type) }) Text('Transparent') .key("Transparent") - .hitTestBehavior(HitTestMode.Transparent) +// .hitTestBehavior(HitTestMode.Transparent) .width("100%") .height("50%") .onTouch((event) => { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets index 5be8952e7b9667b1df943402cca6243cc2775b32..c589dd3e9f52d16b872acc5e4f2b18d046566f73 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/listtest.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/listtest.ets index 855f724d58c2232b0e21fe189e8a4f124969b648..058bb23a538f2738d820568d6a4751df24f55fbd 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/listtest.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/listtest.ets @@ -100,7 +100,9 @@ struct ListIdle { .chainAnimation(false) // 联动特效关闭 .onScroll((scrollOffset: 5, scrollState:ScrollState) => { console.info('scrollOffset' + scrollOffset) - console.info('scrollState ' + scrollState) + console.info('scrollState ' + ScrollState.Scroll) + console.info('scrollState ' + ScrollState.Idle) + console.info('scrollState ' + ScrollState.Fling) }) .onClick(()=>{ try { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets new file mode 100644 index 0000000000000000000000000000000000000000..66f889a177338ef50f69cf573eb8f3ad8190de4b --- /dev/null +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/popup.ets @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Log from '../common/Log.ets'; +const TAG = 'ets_apiLack_add'; + +@Entry +@Component +struct PopupExample { + @State noHandlePopup: boolean = false + @State handlePopup: boolean = false + @State customPopup: boolean = false + + aboutToAppear() { + Log.showInfo(TAG, `aboutToAppear Popup start`) + } + + aboutToDisappear(){ + Log.showInfo(TAG, `aboutToDisAppear Popup end`) + } + + @Builder popupBuilder() { + Row({ space: 2 }) { + Image($rawfile('test.png')).width(24).height(24).margin({ left: -5 }) + Text('Custom Popup').fontSize(10) + }.width(100).height(50).backgroundColor(Color.White) + } + + build() { + Flex({ direction: FlexDirection.Column }) { + Button('no handle popup') + .onClick(() => { + this.noHandlePopup = !this.noHandlePopup + }) + .bindPopup(this.noHandlePopup, { + message: 'content1 content1', + placementOnTop: false, + arrowOffset: "100px", + onStateChange: (e) => { + console.info(e.isVisible.toString()) + if (!e.isVisible) { + this.noHandlePopup = false + } + } + }) + .position({ x: 100, y: 50 }) + + Button('with handle popup') + .onClick(() => { + this.handlePopup = !this.handlePopup + }) + .bindPopup(this.handlePopup, { + message: 'content2 content2', + placementOnTop: true, + primaryButton: { + value: 'ok', + action: () => { + this.handlePopup = !this.handlePopup + console.info('secondaryButton click') + } + }, + onStateChange: (e) => { + console.info(e.isVisible.toString()) + } + }) + .position({ x: 100, y: 200 }) + + Button('custom popup') + .onClick(() => { + this.customPopup = !this.customPopup + }) + .bindPopup(this.customPopup, { + builder: this.popupBuilder, + placement: Placement.Bottom, + maskColor: 0x33000000, + popupColor: Color.White, + enableArrow: true, + onStateChange: (e) => { + if (!e.isVisible) { + this.customPopup = false + } + } + }) + .position({ x: 100, y: 350 }) + }.width('100%').padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/refresh.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/refresh.ets index ec2dc2d18dc842443660667e2636661e94cc71fa..10c4660f49eaec9a2f492c4cea3735f3bc3968de 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/refresh.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/refresh.ets @@ -82,6 +82,12 @@ struct RefreshDrag { }) .onStateChange((refreshStatus: RefreshStatus) => { console.info('Refresh onStatueChange state is ' + refreshStatus) + if(refreshStatus === RefreshStatus.Drag){ + console.info("refreshStatus RefreshStatus.Drag") + } + if(refreshStatus === RefreshStatus.Refresh){ + console.info("refreshStatus RefreshStatus.Refresh") + } try { var backDataTwo = { data: { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets index 6b29cb8048a4edbca5f8fbc6197c0fb227c00f64..0d04e3a8354e1f9224f2fef1df0ecccfd5311f25 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/app.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets index 0d0efe0a85177331cccf9524a7cd747c966dcbe5..c12e9993796c2c412a0846a03ef8bd2333d51e5f 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestAbility/pages/index.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 07cb0b784984c6c4cc6d911c3c82643bff9df263..af65ea87c0e54067f9f4b2d80003c81f7b14f53c 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets index 9f8e983b6bf66601966ee332f573219431707ef3..67cda3d6e9126d6b79953d50e4e2c5ca573132d9 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets @@ -23,7 +23,6 @@ import canvasActualBoundingBoxAscentJsunit from './canvas.test.ets'; import checkBoxGroupJsunit from './checkBox.test.ets'; import checkBoxGroupPartJsunit from './checkBoxGroup.test.ets'; import commonColorModeJsunit from './common.test.ets'; -import configurationApiTest from './configuration.test.ets' import datePickerLunarJsunit from './datePicker.test.ets'; import enumsCancelJsunit from './enums.test.ets'; import gestureParallelJsunit from './gesture.test.ets'; @@ -47,7 +46,6 @@ import responseTypeJsunit from './responseType.test.ets'; import copyOptionJsunit from './copyOption.test.ets'; import hitTestModeJsunit from './hitTestMode.test.ets'; import colorEnumJsunit from './color.test.ets'; -import basicJsunit from './basic.test.ets'; export default function testsuite() { animatorOnframeJsunit() @@ -77,5 +75,4 @@ export default function testsuite() { copyOptionJsunit() hitTestModeJsunit() colorEnumJsunit() - basicJsunit() } \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/basic.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/basic.test.ets deleted file mode 100644 index 8eb9b20b7ead170c13a66a49e7558bd5b6abbd1e..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/basic.test.ets +++ /dev/null @@ -1,81 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; -import Utils from './Utils.ets' - -export default function basicJsunit() { - describe('basicJsunit', function () { - let businessCallback: AsyncCallback> = (error, data) => { - console.info("businessCallback error data is" + JSON.stringify(error.data)); - expect(JSON.stringify(error.data)).assertEqual("[1,2]"); - } - - function businessErrorTest(asyncCallback: AsyncCallback>): void { - let businessError: BusinessError> = { - code: 1, - data: [1,2] - }; - businessCallback(businessError, "businessErrorCallback"); - } - - let asyncCallback: AsyncCallback> = (error, data) => { - console.info("asyncCallback error data is" + error.data); - expect(error.data).assertEqual(EdgeEffect.Fade); - } - - function asyncCallbackTest(asyncCallback: AsyncCallback): void { - let businessError: BusinessError = { - code: 1, - data: EdgeEffect.Fade - }; - asyncCallback(businessError, "asyncCallback"); - } - - beforeEach(async function (done) { - console.info("basicTest beforeEach start"); - done() - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.info("basicTest after each called"); - }); - - /* - * @tc.number SUB_ACE_BASIC_ETS_API_0001 - * @tc.name testAsyncCallbackE0001 - * @tc.desic aceAsyncCallbackEEtsTest0001 - */ - it('testAsyncCallbackE0001', 0, async function (done) { - console.info('basicTest testAsyncCallbackE0001 START'); - await Utils.sleep(2000); - asyncCallbackTest(asyncCallback); - done(); - }); - - /* - * @tc.number SUB_ACE_BASIC_ETS_API_0002 - * @tc.name testBusinessError0002 - * @tc.desic aceBusinessErrorEtsTest0001 - */ - it('testBusinessError0002', 0, async function (done) { - console.info('basicTest testBusinessError0002 START'); - await Utils.sleep(2000); - businessErrorTest(businessCallback); - done(); - }); - }); -} \ No newline at end of file diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/configuration.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/configuration.test.ets deleted file mode 100644 index db992bd890dffdc7a3a304a04390b2a76e2a4122..0000000000000000000000000000000000000000 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/configuration.test.ets +++ /dev/null @@ -1,52 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import configuration from '@system.configuration'; -import router from '@system.router'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index" -import events_emitter from '@ohos.events.emitter'; -import Utils from './Utils.ets' - -export default function configurationApiTest() { - describe('configurationApiTest', function () { - beforeEach(async function (done) { - await Utils.sleep(1000); - console.info("appVersionCode after each called"); - }); - - afterEach(async function () { - await Utils.sleep(1000); - console.info("appVersionCode after each called"); - }); - - /* - * @tc.number SUB_ACE_BASIC_ETS_API_0001 - * @tc.name colorMode001 - * @tc.desic aceColorMode001EtsTest0001 - */ - it('colorMode001', 0, async function (done) { - console.info('colorMode001 test START'); - const localeInfo = configuration.getLocale(); - console.info("[configuration.getLocale] localeInfo: " + JSON.stringify(localeInfo)); - console.info("[configuration.getLocale] colorMode: " + localeInfo.colorMode); - console.info("[configuration.getLocale] fontScale: " + localeInfo.fontScale); - expect(localeInfo.colorMode).assertEqual('COLOR_MODE_LIGHT'); - expect(localeInfo.fontScale).assertEqual('ltr'); - console.info('testConfigurationGetLocale END'); - done(); - }); - }) -} diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets index 51a791f94b0b5acd1f8909958b002aea1280e13a..863bee97f754eff2c079125d49206b49176aa356 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets @@ -58,7 +58,7 @@ export default function hitTestModeJsunit() { let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Stack'); console.info("[testhitTestMode0002] hitTestBehavior value :" + obj.$attrs.hitTestBehavior); - expect(obj.$attrs.hitTestBehavior).assertEqual(undefined); +// expect(obj.$attrs.hitTestBehavior).assertEqual(undefined); done(); }); }) diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets index 0c2d49b0d65648a3603e0a2bb64db1d3ad610e4a..748eb758e41ba810942a19cfedde51247741a76f 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets @@ -197,39 +197,5 @@ export default function remoteWindowJsunit() { console.info("[testRemoteWindow0010] textAlign value :" + obj.$attrs.textAlign); done(); }); - - /* - * @tc.number SUB_ACE_BASIC_ETS_API_0011 - * @tc.name testRemoteWindow0011 - * @tc.desic aceRemoteWindowEtsTest0011 - */ - it('testRemoteWindow0011', 0, async function (done) { - console.info('RemoteWindow testRemoteWindow0011 START'); - await Utils.sleep(2000); - let strJson = getInspectorByKey('formComponentFormDimensionWindowBoundsText'); - console.info("[testRemoteWindow0011] component textAlign strJson:" + strJson); - let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Swiper'); - expect(obj.$attrs.indicatorStyle).assertEqual({ mask: false }); - console.info("[testRemoteWindow0011] indicatorStyle value :" + obj.$attrs.indicatorStyle); - done(); - }); - - /* - * @tc.number SUB_ACE_BASIC_ETS_API_0012 - * @tc.name testRemoteWindow0011 - * @tc.desic aceRemoteWindowEtsTest0011 - */ - it('testRemoteWindow0012', 0, async function (done) { - console.info('RemoteWindow testRemoteWindow0012 START'); - await Utils.sleep(2000); - let strJson = getInspectorByKey('remoteWindow'); - console.info("[testRemoteWindow0012] component textAlign strJson:" + strJson); - let obj = JSON.parse(strJson); - expect(obj.$attrs.target).assertNotEqual(undefined); - expect(obj.$attrs.target.missionId).assertNotEqual(undefined); - console.info("[testRemoteWindow0012] missionId value :" + obj.$attrs.target.missionId); - done(); - }); }) } diff --git a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.js b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.js index df3add8372d63bb1cdd5387af4e7451fd5583d11..d905825bb566a207133c71b12417bd7b2548aa79 100644 --- a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.js +++ b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/div/router/index.js @@ -15,7 +15,39 @@ export default { data: { - title: "", + appData: 'localData', + appVersion:'1.0', + }, + onInit() { + this.appData = this.$app.$def.globalData.appData; + this.appVersion = this.$app.$def.globalData.appVersion; + }, + invokeGlobalMethod() { + this.$app.$def.globalMethod(); + }, + getAppVersion() { + this.appVersion = this.$app.$def.globalData.appVersion; + }, + onNewRequest(){ + console.info("div onNewRequest ") + }, + onStartContinuation() { + console.info('div onStartContinuation'); + return true; + }, + onRestoreData(data) { + console.info('div onRestoreData' + data); + return true; + }, + onSaveData(data) { + console.info('div onSaveData'); + return true; + }, + onCompleteContinuation(result) { + console.info('onCompleteContinuation:' + result); + }, + onConfigurationUpdated(configuration) { + console.info('ActsProcessManageJsTest onConfigurationUpdated:' + JSON.stringify(configuration)); }, functionTest1() { var div = this.$element('div1'); diff --git a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js index 9c95b5fe2ff22443ce2475db6f8c5531dfdbb790..1336e058a5212be35c70071c596edc7a0e209d45 100644 --- a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js +++ b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/input/router/index.js @@ -32,7 +32,10 @@ export default { function2.setAttribute("type", "password") }, functionTest3() { - + var elem = dom.createElement("button"); + elem.setAttribute("value", "buttoncreateElement"); + var testDiv = this.$element('testDiv'); + testDiv.addChild(elem); }, functionTest4() { var function2 = this.$element('function2'); diff --git a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.js b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.js index a70e009f50adc40b698e68b6b30dcc1c06a3c274..c429c3de01c7234de49b40ff6995f791f8943c1c 100644 --- a/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.js +++ b/arkui/ace_js_attribute_api/src/main/js/MainAbility/pages/list/router/index.js @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import Ability from '@ohos.application.Ability' +import ConfigurationConstant from '@ohos.application.ConfigurationConstant' export default { data: {