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..422df360b1d6fd27992873ea599b750c47f57120 --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/dom.ets @@ -0,0 +1,54 @@ +// @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 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/image.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets new file mode 100644 index 0000000000000000000000000000000000000000..795bfe66958cce157822e2b217c45064fcaa2fdb --- /dev/null +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/image.ets @@ -0,0 +1,37 @@ +// @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 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/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/List.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets index ead1df032237f27f1495b033b71e891db91813bf..e48e2ede23bc4b4d4bee80e39dfc4644a328028d 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,47 +62,47 @@ import webGetTitleJsunit from './web.test.ets'; import xcomponentGetXComponentContextJsunit from './xcomponent.test.ets'; export default function testsuite() { - lazyForEachOnDataAddJsunit() - alphabetIndexerOnSelectJsunit() - checkBoxGroupSelectAllJsunit() - circleNewJsunit() - curvesStepsJsunit() +// lazyForEachOnDataAddJsunit() +// alphabetIndexerOnSelectJsunit() +// checkBoxGroupSelectAllJsunit() +// circleNewJsunit() +// curvesStepsJsunit() common_ts_ets_apiStaticClearJsunit() commonBackgroundBlurStyleJsunit() - ellipseNeJsunit() - featureAbilityStartAbilityJsunit() - gaugeColorsJsunit() - gestureSetDirectionJsunit() - globalJsunit() - gridMaxCountJsunit() - gridItemOnSelectJsunit() - inspectorJsunit() - lineNeJsunit() - listNewJsunit() - list_itemOnSelectJsunit() - mediaQueryOffJsunit() - navigatorTargetJsunit() - pageRouteTest() - panelBackgroundMaskJsunit() - pathNewTest() - polygonNewJsunit() - polyLineNeJsunit() - progressScaleCountJsunit() - promptShowDialogJsunit() - rectNeJsunit() - scrollOnScrollBeginJsunit() - searchOnCutJsunit() - selectOnSelectJsunit() - sideBarShowSideBarJsunit() - stackAlignContentJsunit() - stateManagementGetSharedJsunit() - swiperCurveJsunit() - tabsBarPositionJsunit() - textMinFontSizeJsunit() - textAreaOnCutJsunit() - textInputOnEditChangeJsunit() - textPickerDefaultPickerItemHeightJsunit() - videoOnFullscreenChangeJsunit() - webGetTitleJsunit() - xcomponentGetXComponentContextJsunit() +// ellipseNeJsunit() +// featureAbilityStartAbilityJsunit() +// gaugeColorsJsunit() +// gestureSetDirectionJsunit() +// globalJsunit() +// gridMaxCountJsunit() +// gridItemOnSelectJsunit() +// inspectorJsunit() +// lineNeJsunit() +// listNewJsunit() +// list_itemOnSelectJsunit() +// mediaQueryOffJsunit() +// navigatorTargetJsunit() +// pageRouteTest() +// panelBackgroundMaskJsunit() +// pathNewTest() +// polygonNewJsunit() +// polyLineNeJsunit() +// progressScaleCountJsunit() +// promptShowDialogJsunit() +// rectNeJsunit() +// scrollOnScrollBeginJsunit() +// searchOnCutJsunit() +// selectOnSelectJsunit() +// sideBarShowSideBarJsunit() +// stackAlignContentJsunit() +// stateManagementGetSharedJsunit() +// swiperCurveJsunit() +// tabsBarPositionJsunit() +// textMinFontSizeJsunit() +// textAreaOnCutJsunit() +// textInputOnEditChangeJsunit() +// textPickerDefaultPickerItemHeightJsunit() +// videoOnFullscreenChangeJsunit() +// webGetTitleJsunit() +// xcomponentGetXComponentContextJsunit() } \ No newline at end of file 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..ad17b70d8fd379370b7384642456203b07cdeaeb 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 @@ -1,3 +1,4 @@ +// @ts-nocheck /** * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -59,7 +60,7 @@ 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%') 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..3dca1c94c331f75e4b160343712dbd8b6ab4e744 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 @@ -66,6 +66,10 @@ struct CheckBoxGroupPart { .selectedColor(0xed6f21) .onChange((itemName:CheckboxGroupResult) => { console.info("TextPicker::dialogResult is" + JSON.stringify(itemName)) + console.info("TextPicker::dialogResult is" + JSON.stringify(itemName.status)) + if(itemName.status === SelectStatus.Part){ + console.info("CheckboxGroup SelectStatus.Part") + } try { var backData = { data: { 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_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: { diff --git a/local.properties b/local.properties new file mode 100644 index 0000000000000000000000000000000000000000..2f915f6a201447f7a48d56d2b93ba2e29c475fe1 --- /dev/null +++ b/local.properties @@ -0,0 +1,10 @@ +# This file is automatically generated by DevEco Studio. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file should *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# For customization when using a Version Control System, please read the header note. +sdk.dir=D:/beta3Sdk +nodejs.dir=D:/software/DevEco Studio 3.0.0.900/tools/nodejs +npm.dir=D:/software/DevEco Studio 3.0.0.900/tools/nodejs \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..48e341a0954d5f8c2accf3a6731be28e5bb9c0de --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3 @@ +{ + "lockfileVersion": 1 +}