diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..597eac9fd2fed18f7684644472a5b0ccb46676bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test.ets @@ -0,0 +1,1341 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function ArkUIScrollbarScroll() { + + describe('ArkUIScrollbarScroll', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0030 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0030', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0030 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll30')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0030 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0040 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0040', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0040 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll40')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0040 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0050 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0050', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0050 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll50')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0050 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0130 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0130', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0130 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll130')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0130 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0140 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0140', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0140 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll140')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0140 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0150 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0150', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0150 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll150')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0150 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0230 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0230', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0230 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll230')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0230 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0240 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0240 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0240', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0240 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll240')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0240 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0250 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0250 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0250', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0250 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll250')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0250 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0360 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0360', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0360 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll360')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0360 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0370 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0370', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0370 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll370')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0370 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0380 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0380', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0380 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll380')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0380 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0460 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0460', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0460 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll460')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0460 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0470 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0470', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0470 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll470')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0470 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0480 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0480', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0480 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll480')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0480 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0560 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0560', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0560 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll560')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0560 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0570 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0570', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0570 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll570')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0570 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0580', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0580 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll580')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0580 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0790', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0790 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll790')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0790 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0260 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0260 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0260', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0260 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll260')) + await button.click() + await Utils.sleep(500) + let button1: Component = await driver.findComponent(ON.id('index3')) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0260 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0270 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0270', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0270 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll270')) + await button.click() + await Utils.sleep(500) + let button1: Component = await driver.findComponent(ON.id('index3')) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0270 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0280 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0280', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0280 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll280')) + await button.click() + await Utils.sleep(500) + let button1: Component = await driver.findComponent(ON.id('index2')) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0280 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0300 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0300', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0300 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll300')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y:center.y},{x: center.x, y: info.bottom},5,20000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0300 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0830 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0830 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0830', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0830 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll830')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0830 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0840 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0840 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0840', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0840 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll840')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0840 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0850 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0850 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0850', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0850 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll850')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0850 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0860 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0860 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0860', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0860 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Scroll: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll860')); + let info = await Scroll.getBounds(); + let center = await Scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0860 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0870 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0870 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0870', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0870 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll870')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0870 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0880 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0880 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0880', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0880 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll880')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0880 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0500 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0500', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0500 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll500')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0500 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0600 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0600', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0600 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll600')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0600 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0490 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0490 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0490', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0490 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll490')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0490 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0590 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0590', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0590 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll590')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.y,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0590 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0290 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0290', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0290 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll290')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0290 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0390 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0390', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0390 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll390')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.y,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0390 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0400 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0400', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0400 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll400')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0400 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0060 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0060', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0060 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll60')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0060 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0070 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0070', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0070 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll70')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0070 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0160 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0160', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0160 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll160')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.y,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0160 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0170 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0170', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0170 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll170')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},20,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0170 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0660 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0660 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0660', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0660 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll660')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0660 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0740 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0740 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0740', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0740 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll740')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0740 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0670 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0670', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0670 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll670')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.x,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0670 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0750 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0750 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0750', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0750 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll750')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},20,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0750 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0320 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0320', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0320 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll320')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0320 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0330 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0330', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0330 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll330_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll330_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0330 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0420 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0420', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0420 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll420')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0420 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0430 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0430', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0430 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll430_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll430_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0430 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0520 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0520', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0520 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll520')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0520 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0530 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0530 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0530', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0530 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll530_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll530_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0530 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0620 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0620', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0620 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll620')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0620 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0630 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0630', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0630 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll630_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll630_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0630 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0090 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0090', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0090 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll90')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0090 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0100 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0100', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0100 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll100_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll100_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0100 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0190 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0190', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0190 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll190')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0190 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0200 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0200', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0200 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll200_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll200_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0200 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0700 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0700', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0700 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll700')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0700 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0710 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0710 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0710', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0710 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll710_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll710_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0710 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0770 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0770 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0770', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0770 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll770')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0770 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0780 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0780 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0780', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0780 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll780_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll780_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0780 finish.`); + done() + }) + + + /* + * @tc.number ARKUI_SCROLLBAR_SCROLL_0890 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0890 + * @tc.desc scroll test + */ + it('ARKUI_SCROLLBAR_SCROLL_0890', 0, async (done: Function) => { + Logger.info('TEST', 'ARKUI_SCROLLBAR_SCROLL_0890 start.'); + Settings.createWindow("testability/pages/ArkuiScrollbarScroll/ArkuiScrollbarScroll0890"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let listItem: Component = await driver.findComponent(ON.id("ArkuiScrollbarScroll0890_001")); + let pos = await listItem.getBoundsCenter(); + await driver.swipe(pos.x,pos.y,pos.x,pos.y-400); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', 'ARKUI_SCROLLBAR_SCROLL_0890 finish.'); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..913dd18b5fc9a4723f96feca1d8ed9e3b98d5cfc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkuiGridLayoutOption() { + + describe('ArkuiGridLayoutOption', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0190_779', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0190_779 start.`); + Settings.createWindow("testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779"); + await Utils.sleep(1000); + + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let list20 :Component = await driver.findComponent(ON.id('list20')); + let list14 :Component = await driver.findComponent(ON.id('list14')); + await Utils.sleep(1000); + let list1Point = await list14.getBoundsCenter(); + let list2Point = await list20.getBoundsCenter(); + await Utils.sleep(1000); + await driver.drag(list2Point.x, list2Point.y, list1Point.x, list1Point.y) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0190_779 finish.`); + done(); + }) + + + it('SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0050_409', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0050_409 start.`); + Settings.createWindow("testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409"); + await Utils.sleep(1000); + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkuiGridLayoutOption0050409_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0050_409 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets index 0860e1238b7d5125d3247205585c174e61e3e827..14871b69d57e01826062dc2ea95321e7059badf6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -150,6 +150,89 @@ import UIComponentPopupBoxToastStyleInterface001 import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import UIComponentListandgridGridInterface + from './UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test' +import UIComponentListandgridXommonSmooth + from './UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test' +import UIComponentGridModifier + from './UIComponentGridModifierTest/UIComponentGridModifier.test' +import UIComponentScrollScrollExtra + from './UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test' +import UIComponentScrollAlphabetindexermodifier + from './UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test' +import UIComponentListandgridModifier + from './UIComponentListandgridModifierTest/UIComponentListandgridModifier.test' +import ArkUIScrollbarScroll + from './ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test' +import UIComponentListandgridXommonScrollto + from './UIComponentListandgridXommonScrolltoTest/UIComponentListandgridXommonScrollto.test' +import UIComponentListandgridXommonOnscroll + from './UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test' +import UiComponentAlphabetindexerAttributeAutocollapse + from './UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test' +import UIComponentOtherAlphabetindexerInterface + from './UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test' +import UIComponentOtherAlphabetindexerWidth + from './UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test' +import UIComponentOtherAlphabetindexerAttribute + from './UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test' +import UIComponentListandgridGridEvents + from './UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test' +import UIComponentListandgridXommonReport + from './UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test' +import UIComponentOtherAlphabetindexerImprove from './UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test' +import UIAbilityMouseevents from './UIAbilityMouseeventsTest/UIAbilityMouseevents.test'; +import UIComponentOtherAlphabetindexerArrayvalue from './UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test'; +import UIComponentListandgridListInterface + from './UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test' +import UIComponentListandgridListHirror + from './UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test' +import UIComponentGridAlignitems from './UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test'; +import UIComponentGridAccessible from './UIComponentGridAccessibleTest/UIComponentGridAccessible.test' +import UIComponentScrollScrollLog from './UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test'; +import UIComponentOtherListPerformance from './UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test'; +import UIComponentListandgridXommonDts from './UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test'; +import UIComponentListandcridGridUxconsistency from './UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test' +import UIComponentListandgridGridHouse from './UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test' +import UICoypokentScrollScrollGetitenrect from './UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test' +import UIComponentGridAlignltems from './UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test' +import UIComponentListandgridListScrolltoindex from './UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test' +import UIComponentScrollScrollCetitemrect from './UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test' +import UIComponentListandgridListInterfaceCachedcount from './UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test' +import UIComponentListandgridListFramemode from './UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test' +import UIComponentListandgridListMirror from './UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test' +import UIComponentListandgridListitencroupMirror from './UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test' + +import UIComponentListandgridXonhofOnscroll from './UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test' +import ArkuiGridLayoutOption from './ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test' +import UIComponentListAndGridGridAutoStretch from './UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test' +import UIComponentListAndGridListMouse from './UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test' +import UIComponentListandgridGridEventEnhancement from './UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test' + +import UIComponentAlphabetIndexer001 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test' +import UIComponentAlphabetIndexer002 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test' +import UIComponentAlphabetIndexer003 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test' +import UIComponentAlphabetIndexer004 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test' +import UIComponentAlphabetIndexer005 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test' +import UIComponentAlphabetIndexer006 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test' +import UIComponentAlphabetIndexer007 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test' +import UIComponentGrid001 from './UIComponentGrid/UIComponentGrid001.test' +import UIComponentGrid002 from './UIComponentGrid/UIComponentGrid002.test' +import UIComponentGrid003 from './UIComponentGrid/UIComponentGrid003.test' +import UIComponentGrid004 from './UIComponentGrid/UIComponentGrid004.test' +import UIComponentGrid005 from './UIComponentGrid/UIComponentGrid005.test' +import UIComponentGrid006 from './UIComponentGrid/UIComponentGrid006.test' +import UIComponentGrid007 from './UIComponentGrid/UIComponentGrid007.test' +import UIComponentGrid008 from './UIComponentGrid/UIComponentGrid008.test' +import UIComponentGrid009 from './UIComponentGrid/UIComponentGrid009.test' +import UIComponentGrid010 from './UIComponentGrid/UIComponentGrid010.test' +import UIComponentGrid011 from './UIComponentGrid/UIComponentGrid011.test' +import UIComponentSwiper002 from './UIComponentSwiperTest/UIComponentSwiper002.test' +import UIComponentAlphabetindexerAttributePopupselected + from './UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test' +import UIComponentListandgridGridInteraction + from './UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test' +import UiComponentCanvasModifier from './UiComponentCanvasModifierTest/UiComponentCanvasModifier.test' export default function testsuite() { ComponentTextRicheditorFontfeatures(); ComponentTextRicheditorCustomColors(); @@ -239,6 +322,70 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + UIComponentListandgridGridInterface(); + UIComponentListandgridXommonSmooth(); + UIComponentGridModifier(); + UIComponentScrollScrollExtra(); + UIComponentScrollAlphabetindexermodifier(); + UIComponentListandgridModifier(); + ArkUIScrollbarScroll(); + UIComponentListandgridXommonScrollto(); + UIComponentListandgridXommonOnscroll(); + UiComponentAlphabetindexerAttributeAutocollapse(); + UIComponentOtherAlphabetindexerInterface(); + UIComponentOtherAlphabetindexerWidth(); + UIComponentOtherAlphabetindexerAttribute(); + UIComponentListandgridGridEvents(); + UIComponentListandgridXommonReport(); + UIComponentOtherAlphabetindexerImprove(); + UIAbilityMouseevents(); + UIComponentOtherAlphabetindexerArrayvalue(); + UIComponentListandgridListInterface(); + UIComponentListandgridListHirror(); + UIComponentGridAlignitems(); + UIComponentGridAccessible(); + UIComponentScrollScrollLog(); + UIComponentOtherListPerformance(); + UIComponentListandgridXommonDts(); + UIComponentListandcridGridUxconsistency(); + UIComponentListandgridGridHouse() ; + UICoypokentScrollScrollGetitenrect() ; + UIComponentGridAlignltems(); + UIComponentListandgridListScrolltoindex(); + UIComponentScrollScrollCetitemrect(); + UIComponentListandgridListInterfaceCachedcount(); + UIComponentListandgridListFramemode(); + UIComponentListandgridListMirror(); + UIComponentListandgridListitencroupMirror(); + + UIComponentListandgridXonhofOnscroll(); + ArkuiGridLayoutOption(); + UIComponentListAndGridGridAutoStretch(); + UIComponentListAndGridListMouse(); + UIComponentListandgridGridEventEnhancement(); + UIComponentAlphabetIndexer001(); + UIComponentAlphabetIndexer002(); + UIComponentAlphabetIndexer003(); + UIComponentAlphabetIndexer004(); + UIComponentAlphabetIndexer005(); + UIComponentAlphabetIndexer006(); + UIComponentAlphabetIndexer007(); + UIComponentGrid001(); + UIComponentGrid002(); + UIComponentGrid003(); + UIComponentGrid004(); + UIComponentGrid005(); + UIComponentGrid006(); + UIComponentGrid007(); + UIComponentGrid008(); + UIComponentGrid009(); + UIComponentGrid010(); + UIComponentGrid011(); + UIComponentSwiper002(); + + UIComponentAlphabetindexerAttributePopupselected(); + UIComponentListandgridGridInteraction(); + UiComponentCanvasModifier(); } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAbilityMouseeventsTest/UIAbilityMouseevents.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAbilityMouseeventsTest/UIAbilityMouseevents.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a6e750bbd43c2fdb40bc49515d179dbb878c10a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAbilityMouseeventsTest/UIAbilityMouseevents.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIAbilityMouseevents() { + describe('UIAbilityMouseevents', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 + * @tc.name SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 + * @tc.desc + */ + it('SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 start.`); + Settings.createWindow("testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('UIAbilityMouseevents2370_001')); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 + * @tc.name SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 + * @tc.desc + */ + it('SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 start.`); + Settings.createWindow("testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIAbilityMouseevents2370_002')); + await button.click(); + await Utils.sleep(2000); + let list: Component = await driver.findComponent(ON.id('UIAbilityMouseevents2370_001')); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..ddc491120ec1d1936e46499746be64f18c7b6c52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test.ets @@ -0,0 +1,166 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentAlphabetIndexer001() { + + describe('UIComponentAlphabetIndexer001', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0450 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0450 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0390 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0390 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0420 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0420 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0430 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn04")); + await SliderCom1.click() + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0430 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0440 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn06")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0440 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0410 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0410 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f5124c52e26f880116ab783a7f628639ad32b4a6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test.ets @@ -0,0 +1,302 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + + +export default function UIComponentAlphabetIndexer002() { + describe('UIComponentAlphabetIndexer002', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0010 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0050 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0090 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn04")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0090 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0110 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn05")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0110 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0130 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn06")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0150 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0150 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0160 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0160 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0170 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0170 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0180 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0180 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0200 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0210 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0210 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0020 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0060 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0060 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0100 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0120 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0140 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0140 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0310 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0310 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0320 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0320 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..91a8dbe670128aa81b880c641fc28ce7d376e851 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test.ets @@ -0,0 +1,482 @@ +/* + * Copyright (C) 2024 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +function switchLocale(Locale: string): string { + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log('Switch Locales,current appPreferredLanguage=' + appPreferredLanguage); + try { + i18n.System.setAppPreferredLanguage(Locale); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2= ${appPreferredLanguage2}`); + return appPreferredLanguage2; +} + + +export default function UIComponentAlphabetIndexer003() { + describe('UIComponentAlphabetIndexer003', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0440 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); // 获取窗口的边框信息 + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); // 一级 + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + + await driver.click(pos.x + parseInt(JSON.parse(margin).right), pos.y); // 二级 + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0440 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0380 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn02")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0380 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0390 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0390 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0400 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0400 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0420 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45 + 5, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0420 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0150 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0150 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn07")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0120 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0170 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn08")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0170 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0130 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0130 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0160 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0160 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0140 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0140 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0220 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn11")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 120, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0220 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0200 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn12")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0180 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn13")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0180 finish.`); + done() + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..afca33cb261ea3e3a1420cd9552e56ad71e56239 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentAlphabetIndexer004() { + + describe('UIComponentAlphabetIndexer004', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_ATTRIBUTES_POSITION_VISIBILITY_0010 + * @tc.name SUB_ACE_UI_ATTRIBUTES_POSITION_VISIBILITY_0010 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_UX_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_UX_0090 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await SliderCom1.getBounds() // 获取窗口的边框信息 + let pos = await SliderCom1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/11 + '') + // Logger.info(JSON.stringify(parseInt(itemHeight * 7 + ''))+'----SliderCom1') + // Logger.info(JSON.stringify(parseInt(itemHeight * 7 + '') + info.top)+'----SliderCom1') + + await driver.click(pos.x, parseInt(itemHeight * 7 + '') + info.top) + // await driver.click(540,476 + info.top) + await Utils.sleep(2000) + let pointCenter1 = await SliderCom1.getBoundsCenter(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_UX_0090 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..450671dba2957980c9d031d1779ef863b3dc5cd4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test.ets @@ -0,0 +1,386 @@ +/* + * Copyright (C) 2024 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +function switchLocale(Locale: string): string { + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log('Switch Locales,current appPreferredLanguage=' + appPreferredLanguage); + try { + i18n.System.setAppPreferredLanguage(Locale); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2= ${appPreferredLanguage2}`); + return appPreferredLanguage2; +} + + +export default function UIComponentAlphabetIndexer005() { + describe('UIComponentAlphabetIndexer005', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0190 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + // let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + // let SliderCom1Height = info.bottom - info.top; + // let itemHeight = parseInt(SliderCom1Height/11 + ''); + // await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + // let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + await driver.click(pos.x + 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0190 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0210 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn02")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0210 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0040 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0010 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0010 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0060 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0060 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0020 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn07")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0030 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0050 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn08")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0050 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0110 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 120, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0110 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0100 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0070 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn11")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0070 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0080 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn12")); + await btnWidget.click(); + await Utils.sleep(3000); + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let pos = await alphabetWidget.getBoundsCenter(); + await Utils.sleep(3000); + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0080 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ab99feca5ae5c3fca9cf27bb2b270b5b7101bab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test.ets @@ -0,0 +1,332 @@ +/* + * Copyright (C) 2024 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +function switchLocale(Locale: string): string { + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log('Switch Locales,current appPreferredLanguage=' + appPreferredLanguage); + try { + i18n.System.setAppPreferredLanguage(Locale); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2= ${appPreferredLanguage2}`); + return appPreferredLanguage2; +} + + +export default function UIComponentAlphabetIndexer006() { + describe('UIComponentAlphabetIndexer006', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0260 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + await driver.click(pos.x - 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0260 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0230 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn02")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x + 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0230 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0280 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0280 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0240 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0240 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0250 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x + 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0250 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0270 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0270 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0330 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn07")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 140, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0330 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0310 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn08")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0310 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0290 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0290 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0300 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let pos = await alphabetWidget.getBoundsCenter(); + await Utils.sleep(2000); + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0300 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3d32960dddc2930bf2059772cc35bd20a539dd5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test.ets @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2024 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +export default function UIComponentAlphabetIndexer007() { + describe('UIComponentAlphabetIndexer007', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0020 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0030 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0040 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0100 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0080 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0190 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0190 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0180 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0120 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0130 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0140 finish.`); + done(); + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0200 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0200 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cc047bc22d44052e084af96365d27f867d7dff9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test.ets @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function UIComponentAlphabetindexerAttributePopupselected() { + + describe('UIComponentAlphabetindexerAttributePopupselected', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected10')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected20')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected30')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected40')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected50')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid001.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d2d665911bc855700dbb6226e9d732147bc6eb7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid001.test.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentGrid001() { + + describe('UIComponentGrid001', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060_174', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060_174 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050_016', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050_016 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + await Utils.sleep(1000); + await SliderCom1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070_264', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070_264 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + await Utils.sleep(1000); + await SliderCom1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid002.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid002.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f2eaf72c847022e79b3717882726169018b54c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid002.test.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid002() { + describe('UIComponentGrid002', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080_252', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080_252 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid002") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid003.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid003.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8ebf572a2268343fac337cf476a9acd04993df5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid003.test.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid003() { + describe('UIComponentGrid003', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0090_295', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0090_295 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid003") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid004.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid004.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b5baddcf38ba008e1d7f7c519f11a051ab37078e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid004.test.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid004() { + describe('UIComponentGrid004', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0030_737', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0030_737 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid004") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid005.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid005.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d5a168beea24a3c10eba392292313405d2f090b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid005.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid005() { + describe('UIComponentGrid005', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0180_311', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0180_311 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid005") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid006.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid006.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..3839957322962474ca747b5021f106fc3e5e29d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid006.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid006() { + describe('UIComponentGrid006', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0110_995', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0110_995 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid006") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid007.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid007.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..60feea91b5c5a8542c4e62a77b4b8a1e97b74720 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid007.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid007() { + describe('UIComponentGrid007', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0080_509', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0080_509 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid007") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid008.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid008.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..15a6a67a21fbcf2d2c9a98992e894dfd510381dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid008.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid008() { + describe('UIComponentGrid008', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0280_597', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0280_597 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid008") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid009.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid009.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc03b380b8d88dfebc41fb29a03c2c2a388e2bd4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid009.test.ets @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid009() { + describe('UIComponentGrid009', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0360_974', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0360_974 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0370_895', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0370_895 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0380_183', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0380_183 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0310_326', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0310_326 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn04")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0390_824', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0390_824 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn05")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid010.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid010.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..922b28e12ae8eec163a07d5949d96797b718b00b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid010.test.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid010() { + describe('UIComponentGrid010', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0410 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0520 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid011.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid011.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c2436e0dd4b8df3241fd07566f7b20b78905d0a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid011.test.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid011() { + describe('UIComponentGrid011', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0550 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid011") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0450 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid011") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAccessibleTest/UIComponentGridAccessible.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAccessibleTest/UIComponentGridAccessible.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b254f70bcbe68102a90b4f04745e1112b86e0ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAccessibleTest/UIComponentGridAccessible.test.ets @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentGridAccessible() { + + describe('UIComponentGridAccessible', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button1: Component = await driver.findComponent(ON.id('btn1')) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button1: Component = await driver.findComponent(ON.id('btn1')) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button1: Component = await driver.findComponent(ON.id('btn1')) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..4bf27043c36db5b489b678d38a5b877d10e8d031 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test.ets @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentGridAlignitems() { + + describe('UIComponentGridAlignitems', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0250', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0250 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentGridAlignItems0250')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+50,pos.x,pos.y) + await Utils.sleep(2000) + + await driver.swipe(pos.x,pos.y,pos.x,pos.y+60) + await Utils.sleep(3000) + + await driver.swipe(pos.x,pos.y,pos.x,pos.y+60) + await Utils.sleep(3000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0250 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0330', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0330 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentGridAlignItems0330')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+50) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0330 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..228e29888888c5cc2fee27341de954cafcd8bb4b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListHirror() { + + describe('UIComponentListandgridListHirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 + * @tc.desc Grid test + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 start.'); + Settings.createWindow("testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentGridAlignltems0260_001")); + await button.click(); + await Utils.sleep(2000); + let buttonCheck: Component = await driver.findComponent(ON.id("UIComponentGridAlignltems0260_002")); + await buttonCheck.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 finish.'); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridModifierTest/UIComponentGridModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridModifierTest/UIComponentGridModifier.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f514f0b6e739dd9e8015c6826b7bb42ee79f6604 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridModifierTest/UIComponentGridModifier.test.ets @@ -0,0 +1,444 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON,MouseButton } from '@ohos.UiTest' + +export default function UIComponentGridModifier() { + + describe('UIComponentGridModifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0130"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0130"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0150"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0160"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0170"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0180"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0190"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0200"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0460"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0470"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0410"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0420"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0450"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0230"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier440"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier210"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier220"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier400"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier370"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier380"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0260"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentGridModifier0260_1')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentGridModifier0260_2')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..fff3a5ba3691aa255163642f98ec2a61488ffdc1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridGridAutoStretch() { + + describe('UIComponentListAndGridGridAutoStretch', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0240_115', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0240_115 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListAndGridGridAutoStretch0240115')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+50,pos.x,pos.y) + await Utils.sleep(2000) + + await driver.swipe(pos.x,pos.y-20,pos.x,pos.y+40) + await Utils.sleep(3000) + await driver.swipe(pos.x,pos.y-20,pos.x,pos.y+40) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0240_115 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0190_274', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0190_274 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridGridAutoStretch0190274_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0190_274 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..97d9daf1e946eb74d48acc3a52010c6f5d577890 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridListMouse() { + + describe('UIComponentListAndGridListMouse', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MOUSE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MOUSE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140"); + await Utils.sleep(1000); + + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let list20 :Component = await driver.findComponent(ON.id('list20')); + let list14 :Component = await driver.findComponent(ON.id('list14')); + await Utils.sleep(1000); + let list1Point = await list14.getBoundsCenter(); + let list2Point = await list20.getBoundsCenter(); + await Utils.sleep(1000); + await driver.drag(list2Point.x, list2Point.y, list1Point.x, list1Point.y) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MOUSE_0140 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..42506af72932aaa1bda9c837824fee0c92a34154 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest' + +export default function UIComponentListandcridGridUxconsistency() { + + describe('UIComponentListandcridGridUxconsistency', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + let point = await item.getBoundsCenter() + await driver.mouseMoveTo({x: point.x, y: point.y}) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await driver.triggerKey(2049) + await Utils.sleep(800); + await driver.triggerKey(2049) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717 finish.`); + done(); + }) + + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c52926675534b331c5f70a1064eeeb763c257448 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test.ets @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridEventEnhancement() { + + describe('UIComponentListandgridGridEventEnhancement', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0120_290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0120_290 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0120290')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-100) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0120_290 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0110_344', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0110_344 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0110344')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+110,pos.x,pos.y-110) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0110_344 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0270_047', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0270_047 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0270047')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+110,pos.x,pos.y-110) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0270_047 finish.`); + done(); + }) + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0330_647', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0330_647 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0330647')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+110,pos.x,pos.y-110) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0330_647 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0320_937', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0320_937 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0320937')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + + await driver.mouseScroll({x:pos.x, y:pos.y}, true, 200, 2072,20) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0320_937 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0210_322', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0210_322 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0210322')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + + await driver.mouseScroll({x:pos.x, y:pos.y}, true, 200, 2072,20) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0210_322 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0240_136', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0240_136 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0240136')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + + await driver.fling({x: pos.x, y: pos.y+100},{x: pos.x, y: pos.y},5,40000); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0240_136 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..42a6a66891b3d1258de78b2d3a8fcac5ce119d73 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test.ets @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridEvents() { + + describe('UIComponentListandgridGridEvents', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridGridEvents_0070_077')); + let point = await button.getBoundsCenter(); + let center = await button.getBounds(); + await driver.fling({x:point.x,y:center.bottom},{x:point.x,y:center.top},2,10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('-11')); + let Text2: Component = await driver.findComponent(ON.text('11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..510ef7e08f9c5eb2ca3120f4cd42b31be6dafa4b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest' + +export default function UIComponentListandgridGridHouse() { + + describe('UIComponentListandgridGridHouse', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn')); + await btn.click() + await Utils.sleep(1000); + let item: Component = await driver.findComponent(ON.id('3')); + let point = await item.getBoundsCenter() + await driver.mouseClick({x: point.x, y: point.y}, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7963fa21b262176e3942968067dd79d9baa2bc9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridInteraction() { + + describe('UIComponentListandgridGridInteraction', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237', 1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237"); + await Utils.sleep(3000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1aeab01b816978785a3cefcf1368e9a2ce15b63a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test.ets @@ -0,0 +1,517 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridInterface() { + + describe('UIComponentListandgridGridInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486', 1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798', 2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891', 3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291', 4, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_632', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_632 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_632 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f39f6b0c51a2ee459c7ea0162b9dca786326f26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListFramemode() { + + describe('UIComponentListandgridListFramemode', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 finish.'); + done(); + }) + + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..33317e05b429ac54fcf8a4f105239e79c10678d4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test.ets @@ -0,0 +1,323 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridListHirror() { + + describe('UIComponentListandgridListHirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridListHirror0670')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListHirror0530")); + let point2 = await swiperArrow.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y-50}, {x: point2.x, y: point2.y+20}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridListHirror0520')); + let point2 = await button.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y+ 350}, {x: point2.x , y: point2.y- 300}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridListHirror0630')); + let point2 = await button.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y+ 200}, {x: point2.x , y: point2.y-150}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListHirror0540")); + let point2 = await swiperArrow.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y-50}, {x: point2.x, y: point2.y+20}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListHirror0550")); + let point2 = await swiperArrow.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y-50}, {x: point2.x, y: point2.y+20}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0560')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-50, img2Point.y) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0570')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-30, img2Point.y+50) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('listandgridListHirror0580')) + let img1= await driver.findComponent(ON.id('btnListandgridListHirror0580')) + let img1Point = await img1.getBoundsCenter(); + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img1Point.x, img1Point.y, img2Point.x, img2Point.y) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0590')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-120, img2Point.y) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0600')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x, img2Point.y+250) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0610')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-50, img2Point.y+100) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..db8acebeafdaeba3793053640b00f7f70c49584f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListInterfaceCachedcount() { + + describe('UIComponentListandgridListInterfaceCachedcount', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 finish.'); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5e9a3e568d875b02d5cb9dcb40b71eaff3416d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test.ets @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridListInterface() { + + describe('UIComponentListandgridListInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListInterface1500")); + let point = await swiperArrow.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x, y: point.y + }, { + x: point.x, y: point.y + 300 + }, 600); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('list')); + let point = await list.getBoundsCenter() + await driver.fling({x:point.x, y:point.y+300}, {x:point.x, y:point.y-400},5,2000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('list')); + let point = await list.getBoundsCenter() + await driver.fling({x:point.x, y:point.y+300}, {x:point.x, y:point.y-400},5,2000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7eae09628936f456bbb323a2163d6558929a716e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test.ets @@ -0,0 +1,327 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridListMirror() { + + describe('UIComponentListandgridListMirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0070')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x + 100, y: point.y + }, { + x: point.x - 100, y: point.y + }, 5, 6000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0070")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0140')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x + 50, y: point.y + }, { + x: point.x - 80, y: point.y + }, 5, 600); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0140")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0150')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x + 150, y: point.y + }, { + x: point.x - 200, y: point.y + }, 5, 6000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0150")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0200")); + await showPrevious.click(); + await Utils.sleep(800); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0210')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+150 + }, { + x: point.x , y: point.y- 200 + }, 5, 5000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0210")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0250')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+200 + }, { + x: point.x , y: point.y- 200 + }, 5, 5000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0250")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0260')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+150 + }, { + x: point.x , y: point.y- 80 + }, 5, 2000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0260")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0180')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+150 + }, { + x: point.x , y: point.y- 180 + }, 5, 3000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0180")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0170")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0470")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0460")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 finish.`); + done(); + }) + + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0640 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0640 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0620 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0620 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b600303b2365244bd9838674cb0772b32c9907b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListScrolltoindex() { + + describe('UIComponentListandgridListScrolltoindex', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 + * @tc.desc scrollToIndex test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridListScrolltoindex0010_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 + * @tc.desc scrollToIndex test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridListScrolltoindex0030_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 + * @tc.desc scrollToIndex test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridListScrolltoindex0040_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 finish.'); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a3a5b614367b7084b63232181ee3bbd6cf352411 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test.ets @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, Component, UiWindow, ResizeDirection, UiDriver, MouseButton } from '@ohos.UiTest'; + +export default function UIComponentListandgridListitencroupMirror() { + + describe('UIComponentListandgridListitencroupMirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 + * @tc.level Level 3 + */ + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070"); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnMirror0110")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnMirror0100")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 finish.`); + done(); + }) + + + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridModifierTest/UIComponentListandgridModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridModifierTest/UIComponentListandgridModifier.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..93d770f4c6bb1a1ea3401e66bcdd629feef0b7db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridModifierTest/UIComponentListandgridModifier.test.ets @@ -0,0 +1,456 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridModifier() { + + describe('UIComponentListandgridModifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40"); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier230')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier520')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier810')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier760')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier930')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier980')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier1170')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier20')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier30')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier510')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier440')); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier440_1')); + let center = await List.getBoundsCenter(); + let point = await List.getBounds(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await button.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier360')); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier360_1')); + let center = await List.getBoundsCenter(); + let point = await List.getBounds(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await button.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier120_1')); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier120_2')); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier120')); + let center = await button.getBoundsCenter(); + let point = await List.getBounds(); + await driver.swipe(center.x, point.top,center.x, point.top+200); + await button.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200); + await button2.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580") + await Utils.sleep(1000) + let driver:Driver= Driver.create() + let buttonFirst:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + buttonFirst.click() + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670") + await Utils.sleep(1000) + let driver:Driver= Driver.create() + let buttonFirst:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + buttonFirst.click() + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670") + await Utils.sleep(1000) + let driver:Driver= Driver.create() + let buttonFirst:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + buttonFirst.doubleClick() + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..41c38241ae3f2b82e0c5179d46215f187f17bed5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test.ets @@ -0,0 +1,116 @@ +/* + * + * * Copyright (C) 2024 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 { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonDtsTest() { + + describe('UIComponentListandgridXommonDtsTest', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 150, 4000); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 300); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 300); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 300, 4000); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020 finish.`); + done(); + })/** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let info = await list.getBounds(); + let pos = await list.getBoundsCenter(); + await driver.click(pos.x, info.top + 10); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e62ca67918ff81641a7a9de8908b4e3c58cd623 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test.ets @@ -0,0 +1,1584 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, } from '@ohos/hypium' +import {PointerMatrix} from '@ohos.UiTest'; + +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonOnscroll() { + + describe('UIComponentListandgridXommonOnscroll', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll330')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y:center.y},{x: center.x, y: info.bottom},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll200')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 finish.`); + done(); + + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll340')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll80')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll180')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll170')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},20,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll170')); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll170_button')) + await button.click() + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: center.y},{x: info.top, y:center.y},50,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll70')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll60')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll190')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll380')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll460')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll450')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x:info.bottom, y:info.top},20,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll500')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x:info.bottom, y:info.top},20,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll210')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x:info.bottom, y:info.top},20,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll30')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: center.y},{x:center.x, y:info.top},20,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll470')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: center.y},{x:center.x, y:info.top},20,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll590')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: info.bottom}); + pointers.setPoint(0, 1, {x: x , y: y}); + await driver.injectMultiPointerAction(pointers,600); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll600')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: x , y: info.top + }); + pointers.setPoint(0, 1, { + x: x , y: y + }); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll350')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,1000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll360')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: y+100}); + await driver.injectMultiPointerAction(pointers,10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll210')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll30')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll470')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll240')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll250')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll260')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll270')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll280')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll290')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll300')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll310')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll560')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll570')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll550')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll510')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll530')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll540')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll520')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll420')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll430')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll410')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll390')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll400')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll110')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll90')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll160')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll130')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll140')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll150')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll120')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll100')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 finish.`); + done() + })/* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0320_002')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0320_001')); + await button.click(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0320_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0020_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let column: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0440_002')); + let point = await column.getBoundsCenter(); + await driver.swipe(point.x, point.y + 200, point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0440_001')); + await button.click(); + await Utils.sleep(1000); + let column: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0440_002')); + let point = await column.getBoundsCenter(); + await driver.swipe(point.x, point.y + 200, point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0580_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0580_001')); + await button1.click(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0580_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0010_001')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0280860_001')); + await button1.click(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0280860_002')); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0260164_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0260164_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0240816_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0240816_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0270155_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0270155_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0250533_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0250533_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0290252_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0290252_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0310603_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0310603_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0300319_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0300319_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0200765_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0200765_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0330887_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0330887_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('scroll')); + let point = await scroll.getBoundsCenter() + await driver.fling({x:point.x, y:point.y+100}, {x:point.x, y:point.y-200},5,2000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..b53ba6b9f09bb8931b8471d67a2cf623fa122f93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test.ets @@ -0,0 +1,838 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON,PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonReport() { + + describe('UIComponentListandgridXommonReport', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.swipe(center.x,point.bottom,center.x,point.top,20000) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x:center.x,y:point.bottom},{x:center.x,y:point.top},15,20000) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1,4); + pointers.setPoint(0,0,{x:center.x,y:point.top-100}); + pointers.setPoint(0,1,{x:center.x,y:point.top-150}); + pointers.setPoint(0,2,{x:center.x,y:point.top-200}); + pointers.setPoint(0,3,{x:center.x,y:point.top-250}); + await driver.injectMultiPointerAction(pointers); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport40')); + await Button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport50')); + await Button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.mouseScroll({x:360, y:640}, true, 30, 2072) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport60')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.swipe(center.x,point.top,center.x,point.top+50) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let grid: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport80')); + let point = await grid.getBounds(); + let center = await grid.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1,4); + pointers.setPoint(0,0,{x:center.x,y:point.top+200}); + pointers.setPoint(0,1,{x:center.x,y:point.top+150}); + pointers.setPoint(0,2,{x:center.x,y:point.top+100}); + pointers.setPoint(0,3,{x:center.x,y:point.top+50}); + await driver.injectMultiPointerAction(pointers); + await Utils.sleep(4000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport90')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x:center.x,y:point.top+100},{x:center.x,y:point.top},2,1000) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport100')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.swipe(center.x,point.top+100,center.x,point.top) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 finish.`); + done(); + })/* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0150_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0160_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 300 + }, point, 5, 40000); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170"); + await Utils.sleep(4000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0180_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0190_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0200_002')); + let point = await button.getBoundsCenter(); + await driver.fling(point, { + x: point.x, y: point.y + 30 + }, 5, 600); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0210_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0220_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 1500); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0230_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0230_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0240_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0240_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0250_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0250_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0260_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0260_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0270_002')); + let point = await button.getBoundsCenter(); + await driver.fling(point, { + x: point.x, y: point.y + 30 + }, 5, 600); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0280_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0290_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(4000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0300_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 20000); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(5000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0310_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0320_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y) + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0330_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y) + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0340_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + 50 + }); + await driver.injectMultiPointerAction(pointers, 1500); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0350_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0130_002')); + let point = await button.getBoundsCenter(); + await driver.fling(point, { + x: point.x, y: point.y + 100 + }, 5, 900); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0140_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110") + await Utils.sleep(1000) + let driver:Driver = Driver.create() + let button:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + button.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120") + await Utils.sleep(1000) + let driver:Driver = Driver.create() + await Utils.sleep(1000) + await driver.fling({x: 250, y: 480},{x: 250, y: 100},5,200); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..740897394e4b8ab7b377de72c74237fd1c22179f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test.ets @@ -0,0 +1,307 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonSmooth() { + + describe('UIComponentListandgridXommonSmooth', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0050')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0060')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0070')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0080')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0170')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0180')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0190')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0200')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0210')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0220')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let buttonGrid: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0100857_001")); + await buttonGrid.click(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0100857_002")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let buttonGrid: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0110629_001")); + await buttonGrid.click(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0110629_002")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 finish.'); + done(); + }) + + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9adba59eb7ef5d47535ab861b4e05cdc10b84a44 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test.ets @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXonhofOnscroll() { + + describe('UIComponentListandgridXonhofOnscroll', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0320_784', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0320_784 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0320784_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0320784_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + let button3 :Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0320784_003')) + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0320_784 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0230_457_155', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0230_457_155 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155") + await Utils.sleep(3000) + let driver : Driver = Driver.create(); + await Utils.sleep(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0230457155_001')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.drag(pos.x,pos.y+10,pos.x,pos.y+200) + await Utils.sleep(2000) + + await driver.drag(pos.x,pos.y+250,pos.x,pos.y) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(4000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0230_457_155 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0210_137_385', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0210_137_385 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0210137385')); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0210_137_385 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0220_134_528', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0220_134_528 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0220134528')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.fling({x: pos.x, y: pos.y+50},{x: pos.x, y: pos.y},5,40000); + await Utils.sleep(2000) + + await driver.fling({x: pos.x, y: pos.y},{x: pos.x, y: pos.y+60},5,40000); + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0220_134_528 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2418f8c5fa4d7116f6751feccb0afba68348d7cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerArrayvalue() { + describe('UIComponentOtherAlphabetindexerArrayvalue', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..469915f7ea1768d7fe50b25f4e1f0d65a6d427b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test.ets @@ -0,0 +1,311 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerAttribute() { + + describe('UIComponentOtherAlphabetindexerAttribute', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface50')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `v finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface220')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface270')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface350')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface410')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface460')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface510')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbab845ce6f7da752a2193898318ec6ff69c7286 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test.ets @@ -0,0 +1,428 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerImprove() { + describe('UIComponentOtherAlphabetindexerImprove', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn01')); + await Text.click(); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn01')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn02')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn03')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn04')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn05')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn06')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn07')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn08')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn09')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn10')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8491d6f77be21af9d8e448af909edb95679b1a97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test.ets @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerInterface() { + + describe('UIComponentOtherAlphabetindexerInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface10')); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface20')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..73b9c8414bb191894b51daf64be551cc31faf637 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test.ets @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerWidth() { + + describe('UIComponentOtherAlphabetindexerWidth', () => { + + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0270 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 finish.`); + done(); + })/* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a045405da424010994be022a8e6c582688b88f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test.ets @@ -0,0 +1,73 @@ +/* + * + * * Copyright (C) 2024 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 { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentOtherListPerformance() { + + describe('UIComponentOtherListPerformance', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f33b927a289373c982d35b599e63831e5038b177 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test.ets @@ -0,0 +1,1677 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function UIComponentScrollAlphabetindexermodifier() { + + describe('UIComponentScrollAlphabetindexermodifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier10')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier20')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier30')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier40')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier50')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier60')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier70')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier80')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier90')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier100')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier290')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier300')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier310')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier320')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier330')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier340')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier350')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier360')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier370')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier380')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier390')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier400')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier410')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier420')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier430')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier440')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier450')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier460')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier470')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier480')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier490')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier500')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier510')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier520')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier530')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier540')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier550')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier560')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier570')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier580')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier590')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier600')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier610')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier620')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier680')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier690')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier700')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier710')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier940')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier950')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier960')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1060')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1070')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 0); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1120')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1130')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1140')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1150')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1160')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1550')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 0); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1560')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1620')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 finish.`); + done() + }) + + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 finish.`); + done() + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier630')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier640')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier650')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier660')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier670')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f34e158653ebf5ea334a2a854b30800031f9f4f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UICovponentScrollScrollGetitemrect() { + + describe('UICovponentScrollScrollGetitemrect', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let buttonChange: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0270_002")); + await buttonChange.click(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0270_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0290_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0240_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0230_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 finish.'); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ae477867bcd9b0ce68cdb9d4822d22de5c4664a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test.ets @@ -0,0 +1,862 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentScrollScrollExtra() { + + describe('UIComponentScrollScrollExtra', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra10')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra20')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra30')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra40')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra50')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra60')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra70')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra80')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra90')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra100')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra110')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra120')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra130')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra140')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra150')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra160')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra170')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra180')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra190')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra210')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra220')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra230')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra240')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra250')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra260')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra270')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra280')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra290')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra310')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra320')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra340')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra350')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra360')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra380')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra370')); + await button.click(); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra390')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra400')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra410')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra430')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra440')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 finish.`); + done(); + }) + + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d9201754aea8c7657f873c3b37fdef6045c6ca0a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test.ets @@ -0,0 +1,84 @@ +/* + * + * * Copyright (C) 2024 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 { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentMediaVideoAi() { + + describe('UIComponentMediaVideoAi', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 150, 4000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let button: Component = await driver.findComponent(ON.id('ScrollLog_002')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 150, 4000); + await Utils.sleep(2000); + await button.click(); + await Utils.sleep(500); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 150, 4000); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSwiperTest/UIComponentSwiper002.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSwiperTest/UIComponentSwiper002.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a79baa5ee514417439d59f3bb5064a95089f80a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSwiperTest/UIComponentSwiper002.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentSwiper002() { + + describe('UIComponentSwiper002', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 start.`); + Settings.createWindow("testability/pages/UIComponentSwiper/UIComponentSwiper002") + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets index daf797ea095d73d75a47ee5fe88209d0fec33dae..9662ed0cff79266ae5190ea71ba10742f0657171 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets @@ -390,5 +390,126 @@ export default function UIComponentUISupportColor() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0950 finish.`); done(); }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0010"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0010')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0020"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0020')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0040"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0040')); + await button.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0050"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0050')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0060"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0060')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0070"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0070')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 finish.`); + done(); + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae65b5d39f47b777c78d5b544a22f1aa3df0bdcf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test.ets @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest' + +export default function UICoypokentScrollScrollGetitenrect() { + + describe('UICoypokentScrollScrollGetitenrect', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260 + */ + it('SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260 start.`); + Settings.createWindow("testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn1')); + await btn.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250 + */ + it('SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250 start.`); + Settings.createWindow("testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn2')); + let btn1:Component = await driver.findComponent(ON.id('btn1')); + await btn.click() + await Utils.sleep(1000); + await btn1.click() + await Utils.sleep(1000); + await btn.click() + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300 + */ + it('SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300 start.`); + Settings.createWindow("testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn2')); + let btn1:Component = await driver.findComponent(ON.id('btn1')); + await btn.click() + await Utils.sleep(1000); + await btn1.click() + await Utils.sleep(1000); + await btn.click() + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b2f59611414c8ff18d9cce8bc2c969d5d0f1e50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test.ets @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function UiComponentAlphabetindexerAttributeAutocollapse() { + + describe('UiComponentAlphabetindexerAttributeAutocollapse', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse50')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse40')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse30')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse20_1')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse20_2')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCanvasModifierTest/UiComponentCanvasModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCanvasModifierTest/UiComponentCanvasModifier.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8ae8e55bcc0c611f34cdff6baa30e94746e08c88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCanvasModifierTest/UiComponentCanvasModifier.test.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 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 '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UiComponentCanvasModifier() { + + describe('UiComponentCanvasModifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 + * @tc.name SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 start.`); + Settings.createWindow("testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790") + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 + * @tc.name SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 start.`); + Settings.createWindow("testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530") + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentListandgridXommonScrolltoTest/UiComponentListandgridXommonScrollto.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentListandgridXommonScrolltoTest/UiComponentListandgridXommonScrollto.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..23f80bbd2f1807d37db779eebb5f8ebdb8382487 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentListandgridXommonScrolltoTest/UiComponentListandgridXommonScrollto.test.ets @@ -0,0 +1,462 @@ +/* + * Copyright (C) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonScrollto() { + + describe('UIComponentListandgridXommonScrollto', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto90')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto230')) + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto370')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto510')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto570')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto580')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto590')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto600')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto610')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto620')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto630')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto640')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto650')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto660')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto670')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto680')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto690')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto700')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 finish.`); + done() + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273") + await Utils.sleep(2000) + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('btn')) + let button1: Component = await driver.findComponent(ON.id('btn1')) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button1.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 finish.`); + done() + }) + + /* + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Component1: Component = await driver.findComponent(ON.id('0')); + let Component1Pos = await Component1.getBoundsCenter(); + await driver.swipe(Component1Pos.x, Component1Pos.y, Component1Pos.x, Component1Pos.y + 100, 4000) + await Utils.sleep(3000); + await driver.swipe(Component1Pos.x, Component1Pos.y, Component1Pos.x, Component1Pos.y - 100, 4000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822 finish.'); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100.ets new file mode 100644 index 0000000000000000000000000000000000000000..384149f7802015938a0b416a811dd4539a842889 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll100 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll100_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll100_2') + .onClick(() => { + this.flag = false; + }) + } + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130.ets new file mode 100644 index 0000000000000000000000000000000000000000..f2b0c1be7de20149fcda69da67bef455d87ebb59 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll130 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '1000%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll130') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa84a72bd56a5bbc4aedc717834dcdc510c4bbe2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll140 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '200%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll140') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150.ets new file mode 100644 index 0000000000000000000000000000000000000000..1273dd5970a7a5a8523501010199cdefe59acfd9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll150 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll150') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160.ets new file mode 100644 index 0000000000000000000000000000000000000000..0560f8235d5bae6577b5e3f00655452a28d959fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll160 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .id('ArkUIScrollbarScroll160') + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170.ets new file mode 100644 index 0000000000000000000000000000000000000000..21e283dcfd076577a31fe00f91af3b56587b0349 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll170 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + .id('ArkUIScrollbarScroll170') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190.ets new file mode 100644 index 0000000000000000000000000000000000000000..f609a31b3b0d6d3f2ef1d78c9a6a8c0d69007165 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll190 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Column(){ + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll190') + .onClick(() => { + this.flag = true; + }) + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .height('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200.ets new file mode 100644 index 0000000000000000000000000000000000000000..13f932b4df0f2cd8a6b9a7a7f8a8091d533a936a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll200 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Column(){ + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll200_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll200_2') + .onClick(() => { + this.flag = false; + }) + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .height('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230.ets new file mode 100644 index 0000000000000000000000000000000000000000..614397f3f9b4316c9d1304fe2a780059a808b610 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll230 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + } + .width('90%') + .initialOffset({xOffset:'0%',yOffset:'100%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + + Button('Button') + .id('ArkUIScrollbarScroll230') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240.ets new file mode 100644 index 0000000000000000000000000000000000000000..a2b63ca17b1ca7c6cc0107cea1438b457feb30c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll240 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + } + .width('90%') + .initialOffset({xOffset:'0%',yOffset:'100%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .margin({bottom:200,right:100}) + .id('ArkUIScrollbarScroll240') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c01a57bfbac1314dae3651e5e31a26ab7e5ca89 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll250 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0x000000, startMargin: 20, endMargin: 20 }) + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll250') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c945625c6feb17068531511bb33230e7dda84a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll260 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State editFlag: boolean = false + private scroller: Scroller = new Scroller() + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + if (this.editFlag) { + Button() { + Text("delete").fontSize(16) + }.width('30%').height(40) + .id('index' + (index)) + .onClick(() => { + if (index != undefined) { + console.info(this.arr[index] + 'Delete') + this.arr.splice(index, 1) + console.info(JSON.stringify(this.arr)) + this.editFlag = false + } + }).stateEffect(true) + } + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + }.initialOffset({ xOffset: '0%', yOffset: '100%' }) + }.width('100%') + + Button('edit list') + .id('ArkUIScrollbarScroll260') + .onClick(() => { + this.editFlag = !this.editFlag + }).margin({ top: 5, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc431c32f5d03b370f8fb6a5a7b04b8558057db0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll270 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State editFlag: boolean = false + private scroller: Scroller = new Scroller() + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + if (this.editFlag) { + Button() { + Text("delete").fontSize(16) + }.width('30%').height(40) + .id('index' + (index)) + .onClick(() => { + if (index != undefined) { + console.info(this.arr[index] + 'Delete') + this.arr.splice(index, 1) + console.info(JSON.stringify(this.arr)) + this.editFlag = false + } + }).stateEffect(true) + } + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + }.initialOffset({ xOffset: '0%', yOffset: '100%' }) + }.width('100%') + + Button('edit list') + .id('ArkUIScrollbarScroll270') + .onClick(() => { + this.editFlag = !this.editFlag + }).margin({ top: 5, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280.ets new file mode 100644 index 0000000000000000000000000000000000000000..2729c16f63499ab6f7594351c446e80cae9918d3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll280 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State editFlag: boolean = false + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + if (this.editFlag) { + Button() { + Text("delete").fontSize(16) + }.width('30%').height(40) + .id('index'+ (index)) + .onClick(() => { + if (index != undefined) { + console.info(this.arr[index] + 'Delete') + this.arr.splice(index, 1) + console.info(JSON.stringify(this.arr)) + this.editFlag = false + } + }).stateEffect(true) + } + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + }.width('100%') + + Button('edit list') + .id('ArkUIScrollbarScroll280') + .onClick(() => { + this.editFlag = !this.editFlag + }).margin({ top: 5, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca1f39b79bbbee6ac7e7f27f4d188409c809ab84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll290 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .id('ArkUIScrollbarScroll290') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30.ets new file mode 100644 index 0000000000000000000000000000000000000000..a86edb6e8d305b43a9c1c73bb477368d8cd6a1cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll30 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '100%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll30') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c4bf53bb85122bf2b9058782d2d1d7597f619a3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll300 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .id('ArkUIScrollbarScroll300') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320.ets new file mode 100644 index 0000000000000000000000000000000000000000..d70827df207faab6b8a17c8e7db1423d6718d6ae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll320 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll320') + .onClick(() => { + this.flag = true; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330.ets new file mode 100644 index 0000000000000000000000000000000000000000..67b23339d1f462bdc73d8192c02ad8b35f2b9a0b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll330 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll330_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({ top: 30 }) + .id('ArkUIScrollbarScroll330_2') + .onClick(() => { + this.flag = false; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360.ets new file mode 100644 index 0000000000000000000000000000000000000000..a77a2778c62a21ae5d3a49a0a3baafa59e905beb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll360 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + } + .width('90%') + .initialOffset({xOffset:'1000%',yOffset:'0%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .margin({bottom:200,right:100}) + .id('ArkUIScrollbarScroll360') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370.ets new file mode 100644 index 0000000000000000000000000000000000000000..43397e0b17640b895a113c78422f1340a7f1815e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll370 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + } + .width('90%') + .initialOffset({xOffset:'250%',yOffset:0}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + Button('Button') + .id('ArkUIScrollbarScroll370') + .onClick(() => { + this.arr.push(7, 8, 9, 10); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380.ets new file mode 100644 index 0000000000000000000000000000000000000000..9de9d2f6c279a4fdab1c2093a2044188abc5e3c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +// xxx.ets +@Entry +@Component +struct ArkUIScrollbarScroll380 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + } + .width('90%') + .initialOffset({xOffset:0,yOffset:'100%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + Button('Button') + .id('ArkUIScrollbarScroll380') + .onClick(() => { + this.arr.push(7, 8, 9, 10) + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390.ets new file mode 100644 index 0000000000000000000000000000000000000000..5731f7e7b3537fd8f55e520a0065abb309587243 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll390 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .id('ArkUIScrollbarScroll390') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40.ets new file mode 100644 index 0000000000000000000000000000000000000000..b42c5802dd91eb9b31d9b5d90611fad9d936cf83 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll40 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '20%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll40') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400.ets new file mode 100644 index 0000000000000000000000000000000000000000..b415b9cffba5ee3b67b5eab206e5e581b4c48b46 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 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. + */ +// xxx.ets +@Entry +@Component +struct ArkUIScrollbarScroll400 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .id('ArkUIScrollbarScroll400') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420.ets new file mode 100644 index 0000000000000000000000000000000000000000..e22660691b607ee3227fc9775c5bca4ab4d3deee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll420 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll420') + .onClick(() => { + this.flag = true; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430.ets new file mode 100644 index 0000000000000000000000000000000000000000..508d4c98e15e169989e92c25ff2f24291eda8300 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll430 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll430_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({ top: 30 }) + .id('ArkUIScrollbarScroll430_2') + .onClick(() => { + this.flag = false; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460.ets new file mode 100644 index 0000000000000000000000000000000000000000..486eed3b5df721f5e151c58573c8b000452216b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll460 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr') + .columnsGap(10) + .rowsGap(10) + } + .initialOffset({ xOffset: '0%', yOffset: '100%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + Button('Button') + .margin({ bottom: 200, right: 100 }) + .id('ArkUIScrollbarScroll460') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470.ets new file mode 100644 index 0000000000000000000000000000000000000000..eebec487dbe7bb4b053dcb74ee862279dbd12748 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll470 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr') + .columnsGap(10) + .rowsGap(10) + } + .initialOffset({ xOffset: '0%', yOffset: '30%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + Button('Button') + .margin({ bottom: 200, right: 100 }) + .id('ArkUIScrollbarScroll470') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480.ets new file mode 100644 index 0000000000000000000000000000000000000000..c832eac124529421ae1d4561ac3c43f2cd340658 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll480 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (day: string) => { + ForEach(this.arr, (day: string) => { + GridItem() { + Text() + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + Button('Button') + .margin({ bottom: 200, right: 100 }) + .id('ArkUIScrollbarScroll480') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490.ets new file mode 100644 index 0000000000000000000000000000000000000000..081ff5eee454af66a7f40c6e8d22c39774cff6e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll490 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll490') + .height('50%') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50.ets new file mode 100644 index 0000000000000000000000000000000000000000..82554dff8d59fbc66409bd6a9cba46e8dc0e0a3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll50 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '100%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll50') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500.ets new file mode 100644 index 0000000000000000000000000000000000000000..bbdb0d43bf9404d8330ec08d2f0a06288ec1a933 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll500 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll500') + .height('50%') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520.ets new file mode 100644 index 0000000000000000000000000000000000000000..293307b5cb41cd914b4dc61d6bbce67cb8ba8af6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll520 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll520') + .onClick(() => { + this.flag = true; + }) + } + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('50%') + .width('80%') + .columnsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d7dac718537fff49ffc8fe32207f1ce56c6683b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll530 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll530_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll530_2') + .onClick(() => { + this.flag = false; + }) + } + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('50%') + .width('80%') + .columnsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc3045b74d142e1a5b5940bbcab181794a2d521d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll560 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('20%') + .rowsTemplate('1fr 1fr') + .rowsGap(20) + } + .initialOffset({ xOffset: '100%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + Button('Button') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll560') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570.ets new file mode 100644 index 0000000000000000000000000000000000000000..ffce497bc3087eb0348fbbb1f34c4a6ae95eb3db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll570 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('20%') + .rowsTemplate('1fr 1fr') + .rowsGap(20) + } + .initialOffset({ xOffset: '50%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + Button('Button') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll570') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580.ets new file mode 100644 index 0000000000000000000000000000000000000000..c06b6afc837c205a798043004a002426605046ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll580 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('20%') + .rowsTemplate('1fr 1fr') + .rowsGap(20) + } + .initialOffset({ xOffset: '0%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + Button('Button') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll580') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4bebb7c40cf9d23384fe4e85962c54ed798f9a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll590 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll590') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60.ets new file mode 100644 index 0000000000000000000000000000000000000000..1648637dd9bdd76afaab76a6c289fd526653689e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll60 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + .id('ArkUIScrollbarScroll60') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600.ets new file mode 100644 index 0000000000000000000000000000000000000000..96775b74053468d01596487d1ab5f4d7f8bd0caf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll600 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll600') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb2d11cc26593805271756cfeb43ceee60361abb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll620 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9]; + @State flag: boolean = false; + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll620') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll620') + .onClick(() => { + this.flag = true; + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7ac43d7d53654442594904e84b0e913b8a5d432 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll630 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9]; + @State flag: boolean = false; + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll630') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll630_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll630_2') + .onClick(() => { + this.flag = false; + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b105bafbb01aa2079769777107d0531bc09e937 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll660 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('ArkUIScrollbarScroll660') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670.ets new file mode 100644 index 0000000000000000000000000000000000000000..027082ec9dc2e77744e3283affbd2747646d8893 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll670 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + .id('ArkUIScrollbarScroll670') + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70.ets new file mode 100644 index 0000000000000000000000000000000000000000..f011c6c1d812065d2f88587bdca4dd3894386309 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll70 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + .id('ArkUIScrollbarScroll70') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700.ets new file mode 100644 index 0000000000000000000000000000000000000000..3673463a111dbe247e64ce2df5412f2c24be7985 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll700 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Row({ space: 2 }) { + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .rowsTemplate("1fr 1fr") + .layoutDirection(FlexDirection.Row) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .id('ArkUIScrollbarScroll700') + .onClick(() => { + this.flag = true; + }) + } + + + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710.ets new file mode 100644 index 0000000000000000000000000000000000000000..99208ec71235642aaf780155335855e379eae6f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710.ets @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll710 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Row({ space: 2 }) { + + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll710_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll710_2') + .onClick(() => { + this.flag = false; + }) + } + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('80%') + .height('80%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740.ets new file mode 100644 index 0000000000000000000000000000000000000000..6733645429f6b89448cde17753640c51d9e15a00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll740 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('ArkUIScrollbarScroll740') + .layoutDirection(FlexDirection.Row) + .rowsTemplate("1fr 1fr 1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750.ets new file mode 100644 index 0000000000000000000000000000000000000000..0db5845fb798a03cb9f3d9ce3cd09e05a5d1539e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll750 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('ArkUIScrollbarScroll750') + .layoutDirection(FlexDirection.Row) + .rowsTemplate("1fr 1fr 1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770.ets new file mode 100644 index 0000000000000000000000000000000000000000..a5d6d7aae7ac470ca13f5e1cef82e790c6f9f4ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll770 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Column({ space: 2 }) { + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .rowsTemplate("1fr 1fr") + .layoutDirection(FlexDirection.Row) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .id('ArkUIScrollbarScroll770') + .onClick(() => { + this.flag = true; + }) + } + + + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780.ets new file mode 100644 index 0000000000000000000000000000000000000000..eb832edac5ee61583449c5938042d3329690cd63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780.ets @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll780 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Column({ space: 2 }){ + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll780_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll780_2') + .onClick(() => { + this.flag = false; + }) + + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .rowsTemplate("1fr 1fr 1fr") + .layoutDirection(FlexDirection.Row) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('80%') + .height('80%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b10f48f1a9f18c50ee97b01be3fe9730b1bd4b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ +// xxx.ets +@Entry +@Component +struct ArkUIScrollbarScroll790 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0x000000, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll790') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100 }) + this.arr.unshift(this.arr[0]-1) + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830.ets new file mode 100644 index 0000000000000000000000000000000000000000..de81b4cbba113f49aeedf18731c870ef9a7b72a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll830 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .id('ArkUIScrollbarScroll830') + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b618eee1b9f38fc22a1d8879935e421270ed56c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll840 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll840') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.PARENT_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850.ets new file mode 100644 index 0000000000000000000000000000000000000000..d22a20ce978c88fc4924a0e58f4612ad8ae54a27 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll850 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll850') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.SELF_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860.ets new file mode 100644 index 0000000000000000000000000000000000000000..325e88417d652fb7e3016b36a96a75ec7ae3dd7d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll860 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.PARALLEL, + scrollBackward: NestedScrollMode.PARALLEL + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .id('ArkUIScrollbarScroll860') + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870.ets new file mode 100644 index 0000000000000000000000000000000000000000..284a5a5b58eeafa68266628b18141ce68563372f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll870 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll870') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.PARENT_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880.ets new file mode 100644 index 0000000000000000000000000000000000000000..65cb4b40598131472381be4679c157757f533bb3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll880 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll880') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.SELF_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90.ets new file mode 100644 index 0000000000000000000000000000000000000000..7abcd4217e440a0df062f423bdd8a0a2aea9d6c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll90 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll90') + .onClick(() => { + this.flag = true; + }) + } + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkuiScrollbarScroll0890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkuiScrollbarScroll0890.ets new file mode 100644 index 0000000000000000000000000000000000000000..26768d3bcdbdfc2454333dd15e1361a859348e1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkuiScrollbarScroll0890.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkuiScrollbarScroll0890 { + @State message: string = 'Hello World'; + @State listData: string[] = [] + + aboutToAppear(): void { + this.doAppendData(); + } + + build() { + Column() { + Scroll() { + Column() { + Text('top Header') + .backgroundColor(Color.Gray) + .width('100%') + .height(100) + this.listBuilder() + } + } + .height('100%') + .width('100%') + } + .height('100%') + .width('100%') + } + + @Builder + listBuilder() { + List() { + ListItemGroup({ header: this.listHeader() }) { + Repeat(this.listData) + .each((item: RepeatItem) => { + ListItem() { + Text(item.item) + .fontSize(20) + .padding(20) + } + }) + }.divider({ strokeWidth: 1 }) + + if (this.listData.length < 300) { + ListItem() { + Text(this.loadingMore ? 'loading more' : 'try load more') + .fontSize(20) + .padding(10) + .width('100%') + .backgroundColor(Color.Red) + .onVisibleAreaChange([0, 1], (visible, ratio) => { + if (visible && ratio == 1) { + this.tryAppendData() + } + }) + } + } + } + .id('ArkuiScrollbarScroll0890_001') + .edgeEffect(EdgeEffect.None) + .sticky(StickyStyle.Header) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + .height('100%') + .width('100%') + } + + @Builder + listHeader() { + Text('this is header') + .backgroundColor(Color.Red) + .width('100%') + } + + readonly DATA_SOURCE: string[] = [ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N' + ] + @State loadingMore: boolean = false + + tryAppendData() { + if (this.loadingMore) { + return + } + this.loadingMore = true + setTimeout(() => { + this.doAppendData(); + }, 1000) + } + + private doAppendData() { + const listLength = this.listData.length; + this.DATA_SOURCE.forEach((str, index) => { + this.listData.push(str + (listLength + index)); + }); + this.loadingMore = false; + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/WaterFlowDataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..60644b7d88fa8851f1a7695ded264907b0f41eff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409.ets new file mode 100644 index 0000000000000000000000000000000000000000..350933993ed9ba7b4d1f187df78dfa8bb2606916 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkuiGridLayoutOption0050409 { + @State msgInfo: string = ''; + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + this.msgInfo = 'first='+first.toString() + 'last='+first.toString(); + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('ArkuiGridLayoutOption0050409_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c8007aa58652b7c1ea5613802992a041d177dd7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779.ets @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct ArkuiGridLayoutOption0190779 { + @State arr: string[] = [] + @State arr2: string[] = [] + private mIndex: number = -1 + private startIndex: number = -1 + @State text: string = 'drag' + @State msgInfo: string = '' + private listType: number = -1 + + aboutToAppear(): void { + for (let i = 0; i < 5; i++) { + this.arr.push(i+"") + } + for (let i = 0; i < 5; i++) { + this.arr2.push(i+"") + } + } + + @Builder + pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xF5F5F5) + } + } + + changeIndex(type: number, itemIndex: number, insertIndex: number) { //交换数组位置 + let temp: string; + if (this.listType == type && type == 1) { + temp = this.arr[itemIndex]; + this.arr[itemIndex] = this.arr[insertIndex]; + this.arr[insertIndex] = temp; + } else if (this.listType == type && type == 2) { + temp = this.arr2[itemIndex]; + this.arr2[itemIndex] = this.arr2[insertIndex]; + this.arr2[insertIndex] = temp; + } else if (this.listType != type && type == 1) { + temp = this.arr2[insertIndex]; + this.arr.splice(insertIndex, 1, this.text); + this.arr2.splice(this.startIndex, 1, temp); + } else if (this.listType != type && type == 2) { + temp = this.arr[insertIndex]; + this.arr2.splice(insertIndex, 1, this.text); + this.arr.splice(this.startIndex, 1, temp); + } + // else if (insertIndex == -1 && type == 1) { + // temp = this.text; + // this.arr2.splice(itemIndex, 0, temp); + // } + } + + build() { + Column() { + Text(this.msgInfo); + List({ space: 10 }) { + ForEach(this.arr, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list1"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 1 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 1 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 1 + this.msgInfo= 'trigger onItemDragStart' + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + + console.info('pkgg 1 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 1 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 1 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 1 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(1, itemIndex, insertIndex) + }) + + Column().width('100%').height('2%').backgroundColor(Color.Blue) + List({ space: 10 }) { + ForEach(this.arr2, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list2"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 2 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 2 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr2[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 2 + this.msgInfo= 'trigger onItemDragStart' + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + console.info('pkgg 2 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 2 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 2 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 2 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(2, itemIndex, insertIndex) + }) + + } + .padding(10) + .backgroundColor(0xDCDCDC) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370.ets new file mode 100644 index 0000000000000000000000000000000000000000..94875fd6ca771525e529919940e4c70cd969b5f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370.ets @@ -0,0 +1,61 @@ +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIAbilityMouseevents2370 { + scroller: Scroller = new Scroller(); + @State scroll: string = ''; + @State mouse: string = ''; + @State isFullScreen: boolean = false; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Column() { + Button('horVerSwitch') + .id('UIAbilityMouseevents2370_002') + .onClick(() => { + this.horVerSwitch(); + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('scroll: ' + this.scroll + ',mouse: ' + this.mouse) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIAbilityMouseevents2370_001') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll(() => { + this.scroll = 'onScroll succ'; + }) + .onMouse(() => { + this.mouse = 'mouse succ'; + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4151ef267f6c1667bdab0b72f8e77546e1f2dbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001.ets @@ -0,0 +1,98 @@ +// 该示例实现了自定义设置提示弹窗的背景模糊材质 +@Entry +@Component +struct AlphabetIndexer001 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + @State popupTitleBackgroundValue: ResourceColor = 0xffffff; + @State customBlurStyle: BlurStyle = BlurStyle.NONE; + + + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + Column(){ + Column(){ + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('AlphabetIndexerFlag') + .selectedFont({ + size: 20, + weight: FontWeight.Bolder + }) + .itemSize(28) + .usingPopup(true) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(this.customBlurStyle) + .popupTitleBackground(this.popupTitleBackgroundValue) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("提示弹窗首个索引项背板颜色按设置显示").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 0xffa500; + }).id("btn01") + } + ListItem() { + Button("0xffc0cb粉色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 0xffc0cb; + }).id("btn02") + } + ListItem() { + Button("abcdefg黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'abcdefg'; + }).id("btn03") + } + ListItem() { + Button("nul1黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'null'; + }).id("btn04") + } + ListItem() { + Button("rgb(0,0,255)黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'rgb(0,0,255)'; + }).id("btn05") + } + ListItem() { + Button("undifined黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'undefined' ; + }).id("btn06") + } + ListItem() { + Button("资源引用").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = $r("sys.color.ohos_id_color_warning_dark"); + }).id("btn07") + } + } + } + .height('80%') + } + .width('70%') + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c72b53b6fa8e653daea61842daa834d7c55532f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002.ets @@ -0,0 +1,147 @@ +// 该示例实现了自定义设置提示弹窗的背景模糊材质 +@Entry +@Component +struct AlphabetIndexer002 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + @State itemSizeValue: number = 16; + @State widthValue: ResourceColor = "auto"; + @State customBlurStyle: BlurStyle = BlurStyle.NONE; + + + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + Column(){ + Column(){ + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('AlphabetIndexerFlag') + .selectedFont({ + size: 16, + weight: FontWeight.Bolder + }) + .itemSize(this.itemSizeValue) + .width(this.widthValue) + .backgroundColor(0xFAEEE0) + .usingPopup(true) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(this.customBlurStyle) + .borderColor(Color.Red) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + List({ space: 20, initialIndex: 0 }){ // 2686 + ListItem() { + Button("ohos_id_color_sub_background").onClick((event: ClickEvent) => { + this.widthValue = $r("sys.color.ohos_id_color_sub_background"); + this.itemSizeValue = 16; + }).id("btn01").width(200) + } + // ListItem() {// 长文本 // 2687 + // Button("ohos_id_color_sub_background").onClick((event: ClickEvent) => { + // this.widthValue = $r("sys.color.ohos_id_color_sub_background"); + // this.itemSizeValue = 16; + // }).id("longBtn01").width(200) + // } + ListItem() { // 2688 + Button("width value is 12").onClick((event: ClickEvent) => { + this.widthValue = 12; + this.itemSizeValue = 16; + }).id("btn02").width(200) + } + // ListItem() {// 长文本 2689 + // Button("nul1黑色").onClick((event: ClickEvent) => { + // this.popupTitleBackgroundValue = 'null'; + // }).id("btn04") + // } + ListItem() { // 2690 + Button("width value is null").onClick((event: ClickEvent) => { + this.widthValue = "null"; + this.itemSizeValue = 16; + }).id("btn03").width(200) + } + // ListItem() {// 长文本2691 + // Button("undifined黑色").onClick((event: ClickEvent) => { + // this.popupTitleBackgroundValue = 'undefined' ; + // }).id("btn06") + // } + ListItem() {// 长文本2692 + Button("width value is auto").onClick((event: ClickEvent) => { + this.widthValue = "auto"; + this.itemSizeValue = 16; + }).id("btn04").width(200) + } + // ListItem() { // 长文本2693 + // Button("width value is auto").onClick((event: ClickEvent) => { + // this.widthValue = "auto"; + // this.itemSizeValue = 16 + // }).id("btn07") + // } + ListItem() { // 2694 + Button("width value is undefined").onClick((event: ClickEvent) => { + this.widthValue = "undefined"; + this.itemSizeValue = 16; + }).id("btn05").width(200) + } + // ListItem() { // 长文本2695 + // Button("width value is auto").onClick((event: ClickEvent) => { + // this.widthValue = "auto"; + // this.itemSizeValue = 16 + // }).id("btn07") + // } + ListItem() { // 2696 + Button("width value is undefined").onClick((event: ClickEvent) => { + this.widthValue = "auto auto"; + this.itemSizeValue = 16; + }).id("btn06").width(200) + } + // ListItem() { // 2697 + // Button("width value is undefined").onClick((event: ClickEvent) => { + // this.widthValue = "auto auto"; + // this.itemSizeValue = 16; + // }).id("btn07").width(200) + // } + ListItem() { // 2698 + Button('width value is ""').onClick((event: ClickEvent) => { + this.widthValue = ""; + this.itemSizeValue = 16; + }).id("btn07").width(200) + } + // ListItem() { // 2699 + // Button("width value is undefined").onClick((event: ClickEvent) => { + // this.widthValue = ""; + // this.itemSizeValue = 16; + // }).id("btn07").width(200) + // } + }.lanes(2) + } + .height('80%') + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0a9c29fa182b10528d0c9a455093f643fadfe15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003.ets @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2024 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer003 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupPositionValue: Position = {x: 60.0, y: 48.0} + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + + private arrayA: string[] = ['安'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .popupPosition(this.popupPositionValue) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupItemBorderRadius(4) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("维吾尔文模式-End").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn01") + } + ListItem() { + Button("维吾尔文模式-null").onClick((event: ClickEvent) => { + this.offsetValue = "null" + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn02") + } + ListItem() { + Button("维吾尔文模式-undefined").onClick((event: ClickEvent) => { + this.offsetValue = "undefined" + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn03") + } + ListItem() { + Button("维吾尔文模式-false").onClick((event: ClickEvent) => { + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn04") + } + ListItem() { + Button("维吾尔文模式-5").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn05") + } + ListItem() { + Button("英文模式-End").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn06") + } + ListItem() { + Button("英文模式-Left").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn07") + } + ListItem() { + Button("英文模式-nul1").onClick((event: ClickEvent) => { + this.offsetValue = "null" + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn08") + } + ListItem() { + Button("英文模式-Right").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Right + }).id("btn09") + } + ListItem() { + Button("英文模式-undefined").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.offsetValue = "undefined" + this.alignStyleValue = IndexerAlign.Right + }).id("btn10") + } + ListItem() { + Button("英文模式--5").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn11") + } + ListItem() { + Button("英文模式-5").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn12") + } + ListItem() { + Button("英文模式-false").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn13") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004.ets new file mode 100644 index 0000000000000000000000000000000000000000..02a4e480df252acbd0ffda170e6de0884776843e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004.ets @@ -0,0 +1,128 @@ +// xxx.ets +@Entry +@Component +struct UIComponentAlphabetIndexer004 { + private arrayA: string[] = ['安'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayG: string[] = ['干', '刚'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + @State isNeedAutoCollapse: boolean = true; + @State indexerHeight: string = '70%'; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayG, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + Column() { + Column() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF)// 选中项文本颜色 + .popupColor(0xFFFAF0)// 弹出框文本颜色 + .selectedBackgroundColor(0xCCCCCC)// 选中项背景颜色 + .popupBackground(0xD2B48C)// 弹出框背景颜色 + .usingPopup(true)// 是否显示弹出框 + .selectedFont({ size: 16, weight: FontWeight.Bolder })// 选中项字体样式 + .popupFont({ size: 30, weight: FontWeight.Bolder })// 弹出框内容的字体样式 + .itemSize(38)// 每一项的尺寸大小 + .alignStyle(IndexerAlign.Right)// 弹出框在索引条左侧弹出 + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'G') { + return this.arrayG; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + .id('AlphabetIndexer001') + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + // Button('切换成折叠模式') + // .margin('5vp') + // .onClick(() => { + // this.isNeedAutoCollapse = true; + // }) + Button('切换索引条高度到30%') + .margin('5vp') + .onClick(() => { + this.indexerHeight = '30%'; + }) + Button('切换索引条高度到70%') + .margin('5vp') + .onClick(() => { + this.indexerHeight = '70%'; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005.ets new file mode 100644 index 0000000000000000000000000000000000000000..0e0bf4c6f59641642ba4edfff5a66d6154c4ad5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer005 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupPositionValue: Position = {x: 60.0, y: 48.0} + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + + private arrayA: string[] = ['安', '雷', '吕', '柳', '卢'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .popupPosition(this.popupPositionValue) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupItemBorderRadius(4) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("英文模式-START").onClick((event: ClickEvent) => { + this.selectedValue = 1 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn01") + } + ListItem() { + Button("英文模式-popupPosition").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + this.popupPositionValue = {x: 20.0, y: 18.0} + }).id("btn02") + } + ListItem() { + Button("中文模式-End").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn03") + } + ListItem() { + Button("中文模式-Left").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn04") + } + ListItem() { + Button("中文模式-null").onClick((event: ClickEvent) => { + this.offsetValue = "null" + this.usingPopupValue = true + }).id("btn05") + } + ListItem() { + Button("中文模式-null").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Right + }).id("btn06") + } + ListItem() { + Button("中文模式-START").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn07") + } + ListItem() { + Button("中文模式-undefined").onClick((event: ClickEvent) => { + this.offsetValue = "undefined" + this.usingPopupValue = true + }).id("btn08") + } + ListItem() { + Button("中文模式--END").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn09") + } + ListItem() { + Button("中文模式-popupPositionValue").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.popupPositionValue = {x: 20.0, y: 18.0} + this.alignStyleValue = IndexerAlign.END + }).id("btn10") + } + ListItem() { + Button("中文模式-false").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn11") + } + ListItem() { + Button("中文模式-selected").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.selectedValue = 1 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn12") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006.ets new file mode 100644 index 0000000000000000000000000000000000000000..c178428719237af035f2b3e0f7e4b8e050cb0fd9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer006 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupPositionValue: Position = {x: 60.0, y: 48.0} + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + + private arrayA: string[] = ['安', '雷', '吕', '柳', '卢'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .popupPosition(this.popupPositionValue) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupItemBorderRadius(4) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("藏文模式-END").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn01") + } + ListItem() { + Button("藏文模式-Left").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn02") + } + ListItem() { + Button("藏文模式-null").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.offsetValue = "null" + }).id("btn03") + } + ListItem() { + Button("藏文模式-Right").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Right + }).id("btn04") + } + ListItem() { + Button("藏文模式-START").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn05") + } + ListItem() { + Button("藏文模式-undefined").onClick((event: ClickEvent) => { + this.offsetValue = "undefined" + this.usingPopupValue = true + }).id("btn06") + } + ListItem() { + Button("藏文模式--5").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn07") + } + ListItem() { + Button("藏文模式-5").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn08") + } + ListItem() { + Button("藏文模式-false").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn09") + } + ListItem() { + Button("藏文模式-false").onClick((event: ClickEvent) => { + this.selectedValue = 1 + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn10") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007.ets new file mode 100644 index 0000000000000000000000000000000000000000..842ee6c23509d6025bbf9c7802ed245d5cd0d273 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer007 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupItemBorderRadiusValue: number = 24 + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + @State itemBorderRadiusValue: number = 8 + + private arrayA: string[] = ['安', '雷', '吕', '柳', '卢'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .popupItemBorderRadius(this.popupItemBorderRadiusValue) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .itemBorderRadius(this.itemBorderRadiusValue) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("selected").onClick((event: ClickEvent) => { + this.selectedValue = 1 + }).id("btn01") + } + ListItem() { + Button("改变popupItemBorderRadius").onClick((event: ClickEvent) => { + this.popupItemBorderRadiusValue = 4 + }).id("btn02") + } + ListItem() { + Button("改变itemBorderRadiusValue").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 4 + }).id("btn03") + } + ListItem() { + Button("attr is -10").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = -10 + }).id("btn04") + } + ListItem() { + Button("attr is 0").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 0 + }).id("btn05") + } + ListItem() { + Button("attr is 5.5").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 5.5 + }).id("btn06") + } + // ListItem() { + // Button("attr is null").onClick((event: ClickEvent) => { + // this.itemBorderRadiusValue = null + // }).id("btn07") + // } + // ListItem() { + // Button("attr is null").onClick((event: ClickEvent) => { + // this.itemBorderRadiusValue = undefined + // }).id("btn08") + // } + ListItem() { + Button("attr is 500").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 500 + }).id("btn09") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10.ets new file mode 100644 index 0000000000000000000000000000000000000000..e0f7948ff1de17e19531b13a229ef320ca0f7d88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected10 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected10') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0xFAEEE0) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20.ets new file mode 100644 index 0000000000000000000000000000000000000000..4144b0f11b98d10955749343be322fab90129eae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor('rgb(0,0,255)') + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30.ets new file mode 100644 index 0000000000000000000000000000000000000000..86aad5ee3ab5e53cda32ffad555a8deaf61c2c39 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected30') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Black) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1c34a605b33decc055540fc4bc644663fe1b9f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected40 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected40') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor('#0000FF') + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ca670e68b4aa5ed30540e7c6b4102caba7ccc28 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected50') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(undefined) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid001.ets new file mode 100644 index 0000000000000000000000000000000000000000..67e457189d6bb4f9db329580f1039bd16eb5fc79 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid001.ets @@ -0,0 +1,56 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid { + @State numbers: String[] = ['0', '1', '2', '3'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to -1') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(-1, false) + }).id('btn01') + Button('scrollToIndex equal to 0') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(0, false) + }).id('btn02') + Button('scrollToIndex equal to 3') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(13, false) + }).id('btn03') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid002.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bff3eb3ab0b7828ba3239276235af614cd1d1f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid002.ets @@ -0,0 +1,56 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid02 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to 30') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(30, false) + }).id('btn01') + Button('scrollToIndex equal to 0') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(0, false) + }).id('btn02') + Button('scrollToIndex equal to 3') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(13, false) + }).id('btn03') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid003.ets new file mode 100644 index 0000000000000000000000000000000000000000..96749717f5639a4446bee6678e3f689b87635d5d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid003.ets @@ -0,0 +1,48 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid03 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to 30') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(13, true) + }).id('btn01') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid004.ets new file mode 100644 index 0000000000000000000000000000000000000000..63740ab1b2f64d9c5a9db5ab69ebef4b36a1b1c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid004.ets @@ -0,0 +1,51 @@ + +// xxx.ets +@Entry +@Component +struct Index { + @State numbers: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + columnsTemplateValue: string = "1fr 1fr 1fr 1fr" + // @State columnsTemplateValue: string = "repeat(auto-fit, 90px)" + @State cachedCount: number = 1 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .cachedCount(this.cachedCount) + .columnsTemplate(this.columnsTemplateValue) + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to 30') + .onClick(() => { // 点击后滑到下一页 + this.columnsTemplateValue = "repeat(auto-fit, 90px)" + this.cachedCount = 3 + }).id('btn01') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid005.ets new file mode 100644 index 0000000000000000000000000000000000000000..3407aad16fafefc7f43f4f139eb8afaeffe5cff9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid005.ets @@ -0,0 +1,52 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid005 { + @State numbers: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + columnsTemplateValue: string = "1fr 1fr 1fr 1fr" + @State rowsTemplateValue: string = "1fr 1fr" + @State cachedCount: number = 1 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .rowsTemplate(this.rowsTemplateValue) + .cachedCount(this.cachedCount) + .columnsTemplate(this.columnsTemplateValue) + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('repeat(auto-fit, 90px)') + .onClick(() => { // 点击后滑到下一页 + this.rowsTemplateValue = "repeat(auto-fit, 90px)" + this.cachedCount = 3 + }).id('btn01') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid006.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d37d1912400ed55af6ef51d97ce97acd104795e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid006.ets @@ -0,0 +1,42 @@ +@Entry +@Component +struct UIComponentGrid006 { + @State numbers: string[] = [] + layoutDirectionValue: GridDirection = GridDirection.Row + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(6) + .minCount(2) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + Button('GridDirection.Column') + .onClick(() => { // 点击后滑到下一页 + this.layoutDirectionValue = GridDirection.Column + }).id('btn01') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid007.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b6a99001b19c8a75b32b8266ab3437828b60221 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid007.ets @@ -0,0 +1,46 @@ +@Entry +@Component +struct UIComponentGrid007 { + @State numbers: string[] = [] + @State rowsTemplateValue: string = "1fr 1fr" + + layoutDirectionValue: GridDirection = GridDirection.Row + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .rowsTemplate(this.rowsTemplateValue) + .height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(6) + .minCount(2) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + Button('GridDirection.Column') + .onClick(() => { // 点击后滑到下一页 + this.rowsTemplateValue = "repeat(auto-fit, 90px)" + this.layoutDirectionValue = GridDirection.ColumnReverse + }).id('btn01') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid008.ets new file mode 100644 index 0000000000000000000000000000000000000000..4bff3e0e42712fd41cb1fb474603f7d7a86aa5a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid008.ets @@ -0,0 +1,49 @@ +@Entry +@Component +struct UIComponentGrid008 { + @State numbers: String[] = [] + @State maxCountValue: number = -2 + layoutDirectionValue: GridDirection = GridDirection.Column/GridDirection.ColumnReverse + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(90) + .width(50) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .width(170) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(this.maxCountValue) + .minCount(2) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + + Button('Infinity') + .onClick(() => { + this.maxCountValue = Infinity + }).id('btn01') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid009.ets new file mode 100644 index 0000000000000000000000000000000000000000..dea61f5cf05be0547b153a34a8e3dad78a35cceb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid009.ets @@ -0,0 +1,91 @@ +@Entry +@Component +struct UIComponentGrid009 { + @State numbers: String[] = [] + @State maxCountValue: number = 0 + @State minCountValue: number = 2 + layoutDirectionValue: GridDirection = GridDirection.Row/GridDirection.RowReverse + @State TextWidth: number = 50 + @State TextHeight: number = 90 + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(this.TextHeight) + .width(this.TextWidth) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .width(170) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(this.maxCountValue) + .minCount(this.minCountValue) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + + Button('Infinity') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.TextHeight = 90 + this.TextWidth = 50 + this.minCountValue = 2 + + this.maxCountValue = Infinity + }).id('btn01') + Button('maxCountValue value is 2') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.TextHeight = 90 + this.TextWidth = 50 + this.minCountValue = 2 + + this.maxCountValue = 2 + }).id('btn02') + Button('maxCountValue value is -2') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.TextHeight = 90 + this.TextWidth = 50 + this.minCountValue = 2 + + this.maxCountValue = -2 + }).id('btn03') + Button('TextWidth value is 100') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Column/GridDirection.ColumnReverse + this.maxCountValue = 0 + this.TextHeight = 90 + this.TextWidth = 100 + this.minCountValue = -2 + }).id('btn04') + Button('GridItem size 150*50') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.maxCountValue = -2 + this.TextHeight = 150 + this.TextWidth = 50 + this.minCountValue = 0 + }).id('btn05') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid010.ets new file mode 100644 index 0000000000000000000000000000000000000000..72e61d76a526b1abd0e08edf9112b2d0910c461c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid010.ets @@ -0,0 +1,64 @@ +@Entry +@Component +struct UIComponentGrid010 { + @State numbers: String[] = [] + @State maxCountValue: number = -2 + @State gridWidthStart: number = 50 + @State gridHeightStart: number = 90 + layoutDirectionValue: GridDirection = GridDirection.Column/GridDirection.ColumnReverse + + aboutToAppear() { + for (let i = 1; i <= 6; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + GridItem() { + Text("0") + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(this.gridHeightStart) + .width(this.gridWidthStart) + }.borderWidth(2).borderColor(Color.Red) + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(90) + .width(50) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .width(300) + .height(600) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + // .maxCount(this.maxCountValue) + // .minCount(2) + .cellLength(0) + // .layoutDirection(this.layoutDirectionValue) + + Button('Width increase') + .onClick(() => { + this.gridHeightStart = 90 + this.gridWidthStart = 160 + }).id('btn01') + Button('Height increase') + .onClick(() => { + this.gridHeightStart = 300 + this.gridWidthStart = 50 + }).id('btn02') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid011.ets new file mode 100644 index 0000000000000000000000000000000000000000..43656a687cc81e1b3b12eba7bfe34892dd59e2f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid011.ets @@ -0,0 +1,57 @@ +@Entry +@Component +struct UIComponentGrid011 { + @State numbers: String[] = [] + @State maxCountValue: number = -2 + @State gridWidthStart: number = 300 + @State gridHeightStart: number = 600 + layoutDirectionValue: GridDirection = GridDirection.Column/GridDirection.ColumnReverse + + aboutToAppear() { + for (let i = 1; i <= 6; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(90) + .width(50) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .width(this.gridWidthStart) + .height(this.gridHeightStart) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + // .maxCount(this.maxCountValue) + // .minCount(2) + .cellLength(0) + // .layoutDirection(this.layoutDirectionValue) + + Button('Height increase') + .onClick(() => { + this.gridHeightStart = 150 + this.gridWidthStart = 300 + }).id('btn01') + Button('Width increase') + .onClick(() => { + this.gridHeightStart = 600 + this.gridWidthStart = 150 + }).id('btn02') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f17a5fdbfcbeee224ceaeb8918fbd6b0c7847a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 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 { MyDataSource } from './common/BasicDataSource' +@Entry +@Component +struct UIComponentGridAccessible0060 { + @State arr: MyDataSource = new MyDataSource() + @State Number: string[] = ['0', '1', '2', '3', '4', '5', '6'] + scroller: Scroller = new Scroller() + @State columnsGap: number = 10 + @State rowsGap: number = 10 + // 滚动条 + @State scrollBar: BarState = BarState.Off + @State scrollBarWidth: number = 4 + @State scrollBarColor: Color = Color.Red + @State editMode: boolean = true + @State layoutDirection: GridDirection = GridDirection.Row + @State maxCount: number = 10 + @State minCount: number = 1 + @State cellLength: number = 5 + @State multiSelectable: boolean = false + @State supportAnimation: boolean = false + @State edgeEffect: EdgeEffect = EdgeEffect.None + @State enableScrollInteraction: boolean = true + @State bool1:boolean=true + @State bool2:boolean=true + @State edgeEffectType: EdgeEffect = EdgeEffect.None + @State alwaysEnabled:boolean=true + @State A:boolean=true + + build() { + Column({ space: 5 }) { + if (this.A==true){ + Grid(this.scroller) { + ForEach(this.Number, (day: string) => { + ForEach(this.Number, (day: string) => { + GridItem({style:GridItemStyle.PLAIN}) { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .focusable(true) + .height('100%') + .borderRadius(10) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .padding(4) + .rowsTemplate('1fr 1fr 1fr') + .columnsGap(this.columnsGap) + .rowsGap(this.rowsGap) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .border({ width:1}) + } + else if(this.A==false) { + Grid(this.scroller) { + LazyForEach(this.arr, (item: number,index:number) => { + GridItem({style:GridItemStyle.PLAIN}) { + Text('' + item) + .width('100%') + .height(60) + .fontSize(16) + .textAlign(TextAlign.Center) + .focusable(true) + .borderRadius(10) + .backgroundColor(0xF9CF93) + } + }, (item: string) => item) + } + .padding(4) + .columnsTemplate('1fr 1fr 1fr') + //行列间距 + .columnsGap(this.columnsGap) + .rowsGap(this.rowsGap) + .edgeEffect(this.edgeEffectType,{alwaysEnabled:this.alwaysEnabled}) + .width('90%') + .height(300) + .backgroundColor(0xFAEEE0) + .border({ width:1}) + } + + List({space:10}){ + ListItem(){ + Button('改变布局方向:'+this.A).onClick((event: ClickEvent) => { + this.A=! this.A + }).id('btn1') + } + + ListItem(){ + Row(){ + Button('翻页') + .height(20) + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: this.bool1,animation: this.bool2 }) + }).id('btn2') + } + } + } + .width("100%").height(300) + .border({ width: 1 }) + .padding(15) + }.width('100%').margin({ top: 5 }) + } + aboutToAppear(): void { + for (let i =1; i < 60; i++) { + this.arr.pushData(i); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a42dec344dc6a56241a71b409670ed2a76ab2fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAccessible0070 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State colNum: string = '1fr 1fr 1fr 1fr 1fr' + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate(this.colNum) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('change dir') + .onClick(() => { + this.colNum = '1fr 1fr 1fr 1fr' + }).id('btn1') + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('btn2') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec5f68d864ed2b50188f0054800107df65a90bf2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAccessible0080 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State dir: Direction = Direction.Ltr + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .direction(this.dir) + .enableScrollInteraction(true) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('change dir') + .onClick(() => { + this.dir = Direction.Rtl + }).id('btn1') + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('btn2') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible10.ets new file mode 100644 index 0000000000000000000000000000000000000000..044d5128570192025064e609b31e8a0b3d6813b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible10.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridAccessible10 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible20.ets new file mode 100644 index 0000000000000000000000000000000000000000..1591843f239632ae2299bdab8f1770450e19f51c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible20.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridAccessible20 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible30.ets new file mode 100644 index 0000000000000000000000000000000000000000..286469a1d0a5f4659a36a8cc92a2006e1beffd31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible30.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridAccessible30 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible40.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d03012faf5576dd852ce8bb78213399669859d1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible40.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridAccessible40 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible50.ets new file mode 100644 index 0000000000000000000000000000000000000000..be9c29a9ad48028c007d192acfa20b1a1a500b94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible50.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridAccessible50 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .accessibilityGroup(true) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/common/BasicDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/common/BasicDataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..98273c0cc0d07fa0de26f12d8982c16cd483a8a9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/common/BasicDataSource.ets @@ -0,0 +1,105 @@ +// Basic implementation of IDataSource to handle data listener +abstract class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = [] + + abstract totalCount(): number + abstract getData(index: number): T + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener') + this.listeners.push(listener) + } + } + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener') + this.listeners.splice(pos, 1) + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } +} + +export class MyDataSource extends BasicDataSource { + private dataArray: T[] = [] + + public totalCount(): number { + return this.dataArray.length + } + + public getData(index: number): T { + // console.log(" CacheCountTest3 getData = " + index) + return this.dataArray[index] + } + + public addData(index: number, data: T): void { + this.dataArray.splice(index, 0, data) // 在index位置增加data + this.notifyDataAdd(index) + } + + public dataReload(): void { + this.notifyDataReload() + } + // // 在数据尾部增加一个元素 + // public AddLastItem(): void { + // this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + // this.notifyDataAdd(this.dataArray.length - 1) + // } + + public pushData(data: T): void { + this.dataArray.push(data) + this.notifyDataAdd(this.dataArray.length - 1) + } + + public deleteIndex(index: number): void { + this.dataArray.splice(index, 1) // 在index位置删除1个数据 + this.notifyDataDelete(index) + } + + + public deleteData(data: T): void { + let index = this.dataArray.indexOf(data) + this.dataArray.splice(index, 1) // 在index位置删除1个数据 + this.notifyDataDelete(index) + } + + public moveData(from: number, to: number) { + // [this.dataArray[from], this.dataArray[to]] = [this.dataArray[to], this.dataArray[from]] + this.notifyDataMove(from, to) + } + + public changeData(index: number, data: T) { + this.dataArray[index] = data + this.notifyDataChange(index) + } + + public indexOf(data: T): number { + return this.dataArray.indexOf(data) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..5131b60b537fdef082126cec8fe1901303002e03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0030 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..e8ae94490cfdc9b4b2ae8677a379129a01d9235f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0040 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(undefined) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4e9cafb2cf64257f349ecfbf87f9d314d387d55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0050 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(null) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee93b05e7f3eebc9bd4d23866f7f88774b030faa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0070 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + @State data: number = 5; + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + .columnsGap(10) + .rowsGap(10) + .columnsTemplate('1fr '.repeat(this.data)) + + Button('columnsCount').onClick((event: ClickEvent) => { + this.data = 3; + }).id('btn') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..4de176ffa47d5914d8ed317deb6a430fffb2f438 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0080 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + @State gap: number = 10; + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + .columnsGap(this.gap) + .rowsGap(this.gap) + + Button('changeItemGap').onClick((event: ClickEvent) => { + this.gap = 15 + }).id('btn') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..7034da6e06d86790f9646641dbca49321899378a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0090 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + Button('changeItemLength').onClick((event: ClickEvent) => { + this.numbers.pop() + }).id('btn') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..7eaa34361157b2f1cb381c848f578734549e1998 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0100 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Image($r('app.media.icon')).height(41+Number(day)) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..6a668b75012d7ae89ada5c215490832f53ea2cbe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0110 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..d38026088ffcf5a7fc3e516e101c84a55d2b1e42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridAlignitems0250 { + @State data: number[] = []; + @State items: number[] = []; + + aboutToAppear(): void { + for (let i = 0; i < 10; i++) { + this.data.push(i) + this.items.push(1 + i) + } + } + + + build() { + Column({ space: 10 }) { + Text('Grid alignItems示例代码') + + Grid() { + ForEach(this.data, (item: number) => { + // GridItem和Column不设置高度,默认会自适应子组件大小,设置STRETCH的场景下,会变成与当前行最高节点同高。 + // 若设置高度,则会保持已设置的高度,不会与当前行最高节点同高。 + GridItem() { + Column() { + Column().height(100).backgroundColor('#D5D5D5').width('100%') + // 中间的Text设置flexGrow(1)来自适应填满父组件的空缺 + Text('这是一段文字'); + Column().height(50).backgroundColor('#FF0000').width('100%') + } + } + .border({ color: Color.Black, width: 1 }) + }) + } + .columnsGap(10) + .rowsGap(5) + .columnsTemplate('1fr 1fr') + .width('80%') + .height('100%') + // Grid设置alignItems为STRETCH,以当前行最高的GridItem的高度为其他GridItem的高度。 + .alignItems(GridItemAlignment.STRETCH) + .scrollBar(BarState.Off) + .id('UIComponentGridAlignItems0250'); + } + .height('100%') + .width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..44aec23565fda95a4799dd29129720fd1c93255e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridAlignitems0330 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + this.msgInfo= this.msgInfo + "\ntrigger Grid onReachStart" + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentGridAlignItems0330'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..c589ce79cbcece58f8306651fa4d873d380a3301 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct UIComponentGridAlignltems0260 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State isFullScreen: boolean = false + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + aboutToAppear(): void { + this.horVerSwitch() + } + build() { + Column({ space: 5 }) { + Button("横竖屏切换") + .id('UIComponentGridAlignltems0260_001') + .onClick(() => { + this.horVerSwitch() + }) + Button('next page') + .id('UIComponentGridAlignltems0260_002') + + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .alignItems(GridItemAlignment.STRETCH) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + + }.width('100%').margin({ top: 5 }) + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cd1e874fe23bd21d5b16a917d702042eeee39a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0130.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0140 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ab20123641ecfe94f0af4a88788597c473fa2dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0140.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0140 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(30) + .layoutDirection(GridDirection.ColumnReverse) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..9bb6c529fe66f83bef71a044737d1f3bdaab8604 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0150.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0140 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(50) + .layoutDirection(GridDirection.RowReverse) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..861a619e7c64d31ac077f76ef4c9e52ef062dc92 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0160.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0160 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(30) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e95558982dbbb49ef29cfec75e90e972263ae18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0170.ets @@ -0,0 +1,47 @@ + +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0170 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(5).minCount(3); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.RowReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..ddbbb9d8edbaeeddf31d4677059974ea515f5dd3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0180.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0180 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(5).minCount(3); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.ColumnReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..5c057a747adf317ef488e5168f756174b98389e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0190.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0190 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(3).minCount(5); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.RowReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..132777b9a92d4338a512da4d82f58db23932c1fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0200.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0200 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(-1).minCount(-1); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.RowReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c2e52a0bc387598c4a692e36fb60ac7d099fac0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0230.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0230 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red).selected(false) + }, (day: string) => day) + }.height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .multiSelectable(false) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..f917048b74f345c1829bc0e53a88646264285d20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0260.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentGridModifier0260 { + @State numbers: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19']; + @State columns: number = 2; + @State count: number = 10; + + aboutToAppear() { + let lastCount = AppStorage.get('columnsCount') + if (typeof lastCount != 'undefined') { + this.columns = lastCount + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr '.repeat(this.columns)) + .columnsGap(10) + .rowsGap(10) + .width('90%') + .scrollBar(BarState.Off) + .backgroundColor(0xFAEEE0) + .height('100%') + .cachedCount(this.count) + // 切换列数item位置重排动画 + .animation({ + duration: 300, + curve: Curve.Smooth + }) + .priorityGesture( + PinchGesture() + .onActionEnd((event: GestureEvent) => { + console.info('end scale:' + event.scale) + // 手指分开,减少列数以放大Item,触发阈值可以自定义,示例为2 + if (event.scale > 2) { + this.columns-- + } else if (event.scale < 0.6) { + this.columns++ + } + // 可以根据设备屏幕宽度设定最大和最小列数,此处以最小1列最大4列为例 + this.columns = Math.min(4, Math.max(1, this.columns)); + AppStorage.setOrCreate('columnsCount', this.columns) + }) + ) + Button('button1') + .id('UIComponentGridModifier0260_1') + .onClick(() =>{ + this.count = 0; + }) + Button('button2') + .id('UIComponentGridModifier0260_2') + .onClick(() =>{ + this.count = -1; + }) + }.width('100%').margin({ top: 5 }).height('80%') + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..1fe26a48b70c3e1a9c16869d47a9a56cf2a9d8b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0410.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier410 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnStart(2) + .rowEnd(5) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..d1f4475cd7ee9d54ca408aef39bbe3c89b87af2f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0420.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier420 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnStart(4) + .rowEnd(3) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0450.ets new file mode 100644 index 0000000000000000000000000000000000000000..55ecc39be5e03fb83745ba5ab6ed07f9842512bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0450.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier450 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnStart(-2) + .rowEnd(-5) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..d493b48cf372605b575edf9444a3393ae5cbe76c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0460.ets @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource460 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource2 extends BasicDataSource460 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier460 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State modifier: GridModifier = new GridModifier().columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + private data: MyDataSource2 = new MyDataSource2(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.columnStart(3) + }, (day: string) => 'day') + } + .attributeModifier(this.modifier) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ee4f9191de8c7ebb7c6d8789db673d7807a23de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0470.ets @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier470 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier().columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.columnStart(3) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier210.ets new file mode 100644 index 0000000000000000000000000000000000000000..4417872fff47d813898bfaae82033afafea447aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier210.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier210 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(true) + }, (day: string) => day) + } + .id('UIComponentGridModifier210') + .cellLength(30) + .multiSelectable(true) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier220.ets new file mode 100644 index 0000000000000000000000000000000000000000..c975598b709f1b934d673f2b52247390b6eedd59 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier220.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier220 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(false) + }, (day: string) => day) + } + .id('UIComponentGridModifier220') + .cellLength(30) + .multiSelectable(true) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier370.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a0102c642d8f129daf6223b290cc7682b7bbe49 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier370.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier370 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(true) + }, (day: string) => day) + } + .id('UIComponentGridModifier370') + .cellLength(30) + .multiSelectable(false) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier380.ets new file mode 100644 index 0000000000000000000000000000000000000000..611966e6c3e3263298c2106728ec42de0878aa10 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier380.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier380 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(false) + }, (day: string) => day) + } + .id('UIComponentGridModifier380') + .cellLength(30) + .multiSelectable(false) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier400.ets new file mode 100644 index 0000000000000000000000000000000000000000..2ef8a4c68e744ed4fcd3fec9f27eeb9abc033aa7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier400.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier400 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(false) + }, (day: string) => day) + } + .id('UIComponentGridModifier400') + .cellLength(30) + .multiSelectable(true) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier440.ets new file mode 100644 index 0000000000000000000000000000000000000000..04c616896ebfb839fadc710115363d84f3ff298c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier440.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier440 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnEnd(2) + .rowEnd(3) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274.ets new file mode 100644 index 0000000000000000000000000000000000000000..82d4c29f5ec0cf97722a00f0874f5c905d821c84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Component +struct HelloComponent1 { + @State message: string = 'Hello, World'; + + aboutToAppear() { + console.log('1114' + this.message + " aboutToAppear") + } + + aboutToDisappear() { + console.log('1114' + this.message + " aboutToDisappear") + } + + build() { + Text(this.message) + } +} + +@Entry +@Component +struct UIComponentListAndGridGridAutoStretch0190274 { + data2: number[] = [0, 1, 2, 3, 4, 5] + cachedCount1: number = 2 + build() { + Column({ space: 10 }) { + + Text('auto-stretch 先根据设定的列宽计算列数,余下的空间会均分到每个列间距中').width('90%') + Grid() { + ForEach(this.data2, (item: number) => { + GridItem() { + Text('N' + item).height(80); + } + .backgroundColor(Color.Orange); + HelloComponent1({ message: "Item:" + item }); + }) + } + .width('90%') + .border({ width: 1, color: Color.Black }) + .columnsTemplate('repeat(auto-stretch, 90)') + .columnsGap(10) + .rowsGap(10) + .height(150) + .cachedCount(this.cachedCount1); + Button("change cachedCount") + .onClick((event?: ClickEvent) => { + this.cachedCount1 = 3; + }).id('UIComponentListAndGridGridAutoStretch0190274_001'); + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc3d8aa53a1254e47572c98795a0cbbfe2d65554 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListAndGridGridAutoStretch0240115 { + private scroller: Scroller = new Scroller() + @State numbers: String[] = ['0', '1', '2', '3'] + data1: number[] = [0, 1, 2, 3, 4, 5,6,7,8,9,10,11,12,13,14,15] + build() { + Column() { + Text('auto-stretch 先根据设定的列宽计算列数,余下的空间会均分到每个列间距中').width('90%'); + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.data1, (item: number) => { + GridItem() { + Text('N' + item).height(80) + } + .backgroundColor(Color.Orange) + }) + } + .width('50%') + .border({ width: 1, color: Color.Black }) + .columnsTemplate('repeat(auto-stretch, 80)') + .columnsGap(10) + .rowsGap(10) + .height(300) + } + .width('90%') + .scrollBar(BarState.On) + .scrollable(ScrollDirection.Vertical) + .id('UIComponentListAndGridGridAutoStretch0240115') + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.Auto }) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + }.width(20).backgroundColor('#ededed').id('UIComponentListAndGridGridAutoStretch0240115_001'); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..729483fb511ad798ada4a675d2f0b6b5f17746b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140.ets @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListAndGridListMouse0140 { + @State arr: string[] = [] + @State arr2: string[] = [] + private mIndex: number = -1 + private startIndex: number = -1 + @State text: string = 'drag' + @State msgInfo: string = '' + private listType: number = -1 + + aboutToAppear(): void { + for (let i = 0; i < 5; i++) { + this.arr.push(i+"") + } + for (let i = 0; i < 5; i++) { + this.arr2.push(i+"") + } + } + + @Builder + pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xF5F5F5) + } + } + + changeIndex(type: number, itemIndex: number, insertIndex: number) { //交换数组位置 + let temp: string; + if (this.listType == type && type == 1) { + temp = this.arr[itemIndex]; + this.arr[itemIndex] = this.arr[insertIndex]; + this.arr[insertIndex] = temp; + } else if (this.listType == type && type == 2) { + temp = this.arr2[itemIndex]; + this.arr2[itemIndex] = this.arr2[insertIndex]; + this.arr2[insertIndex] = temp; + } else if (this.listType != type && type == 1) { + temp = this.arr2[insertIndex]; + this.arr.splice(insertIndex, 1, this.text); + this.arr2.splice(this.startIndex, 1, temp); + } else if (this.listType != type && type == 2) { + temp = this.arr[insertIndex]; + this.arr2.splice(insertIndex, 1, this.text); + this.arr.splice(this.startIndex, 1, temp); + } + // else if (insertIndex == -1 && type == 1) { + // temp = this.text; + // this.arr2.splice(itemIndex, 0, temp); + // } + } + + build() { + Column() { + Text(this.msgInfo); + List({ space: 10 }) { + ForEach(this.arr, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list1"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 1 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 1 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 1 + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + console.info('pkgg 1 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 1 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 1 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 1 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(1, itemIndex, insertIndex) + }) + + Column().width('100%').height('2%').backgroundColor(Color.Blue) + List({ space: 10 }) { + ForEach(this.arr2, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list2"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 2 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 2 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr2[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 2 + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + console.info('pkgg 2 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + this.msgInfo= 'onItemDragMove' + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 2 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 2 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 2 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(2, itemIndex, insertIndex) + }) + + } + .padding(10) + .backgroundColor(0xDCDCDC) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995.ets new file mode 100644 index 0000000000000000000000000000000000000000..42cc1a38e92e1ca054d1f214f0660ba348e4e6c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0010_995 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.NONE}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204.ets new file mode 100644 index 0000000000000000000000000000000000000000..df9e51154aab6b3cbfddcb0f8977dccf11034a94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0020_204 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823.ets new file mode 100644 index 0000000000000000000000000000000000000000..b47612566ad2a9c088ce24cace7b3e0ab3eed804 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0030_823 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.NONE}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534.ets new file mode 100644 index 0000000000000000000000000000000000000000..92670c383d5e8c092eb928aaf71bed0a97e56086 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0040_534 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922.ets new file mode 100644 index 0000000000000000000000000000000000000000..6be45621a3cef8fb1724dde271f29f4e614d67be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 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. + */ +interface style { + style: GridItemStyle +} +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0050_922 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + @State style1:style = { + style: GridItemStyle.NONE + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem(this.style1) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704.ets new file mode 100644 index 0000000000000000000000000000000000000000..027269b5f631fbcb41be93a25cb29bcfa59fba4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0060_704 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335.ets new file mode 100644 index 0000000000000000000000000000000000000000..43a38f5174a3c6cd7789f0805512d11fe6e2b4db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0070_335 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215.ets new file mode 100644 index 0000000000000000000000000000000000000000..98492a3a0f5b5d66a0e975423e0220f032af80f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0080_215 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.NONE}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717.ets new file mode 100644 index 0000000000000000000000000000000000000000..333d598b519f9977db92bf6f18436ddfa078c993 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0090_717 { + @State inputValue: string = '' + + build() { + Scroll() { + Row({ space: 20 }) { + Grid() { // 标记为Column1 + GridItem({ style: GridItemStyle.PLAIN }) { + Row({ space: 5 }) { + Button() + .width(80) + .height(40) + .fontColor(Color.White) + } + }.borderColor(Color.Green).focusScopePriority('ColumnScope1', FocusPriority.PRIOR) + GridItem({ style: GridItemStyle.PLAIN }) { + Row({ space: 5 }) { + Button() + .width(80) + .height(40) + .fontColor(Color.White) + } + }.borderColor(Color.Green) + GridItem({ style: GridItemStyle.PLAIN }) { + Row({ space: 5 }) { + Button() + .width(80) + .height(40) + .fontColor(Color.White) + } + }.borderColor(Color.Green) + } + .focusScopeId('ColumnScope1') + }.alignItems(VerticalAlign.Top) + }.margin(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344.ets new file mode 100644 index 0000000000000000000000000000000000000000..45f1bfdc8883676c3eddb089480f05f288ce4330 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0110344 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + this.msgInfo= "trigger Grid onReachEnd" + }).id('UIComponentListandgridGridEventEnhancement0110344'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1a6132d09a793437712085f49f3e30801c9960b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0120290 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + this.msgInfo= this.msgInfo + "\ntrigger Grid onReachStart" + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + this.msgInfo= this.msgInfo + "\ntrigger Grid onReachEnd" + }).id('UIComponentListandgridGridEventEnhancement0120290'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322.ets new file mode 100644 index 0000000000000000000000000000000000000000..2222aac851fb834039d6466daa8c7ed71266e84e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0210322 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + this.msgInfo= "trigger Grid onScrollStop" + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0210322'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136.ets new file mode 100644 index 0000000000000000000000000000000000000000..970f64275ae946fac330db32144c9eb93be9a3bf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0240136 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + this.msgInfo= "trigger Grid onScrollStop" + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0240136'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047.ets new file mode 100644 index 0000000000000000000000000000000000000000..1fb8600db1348ff98d122a4c91a3198b94ae608a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0270047 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.msgInfo= "trigger Grid onScrollFrameBegin" + return { offsetRemain: offset } + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0270047'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b36e2bdb2380d1e5931f15af138bc912d1953d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0320937 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + this.msgInfo= "trigger Grid onScrollIndex" + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0320937'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647.ets new file mode 100644 index 0000000000000000000000000000000000000000..9096979b7877b2c0db159acc9dc2b3e4b169d950 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0330647 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + this.msgInfo= "trigger Grid onScrollIndex" + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0330647'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579.ets new file mode 100644 index 0000000000000000000000000000000000000000..818bd445b62636e7fc2674f071431481a8446e97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0020_579 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + this.text1 = 'onItemDragEnter'; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237.ets new file mode 100644 index 0000000000000000000000000000000000000000..24863ea21f65b15376989555fe2bd92bbd142769 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0030_237 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDragLeave( (event: ItemDragInfo, itemIndex: number) => { + this.text1 = 'onItemDragLeave'; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8659d088dc0a81607523626ed811a4194e22057 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0040_342 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDragMove( (event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + this.text1 = 'onItemDragMove'; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700.ets new file mode 100644 index 0000000000000000000000000000000000000000..db1d872848219477f9c28b8dbd944d94d0e2456f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0050_700 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.text1 = 'onItemDrop'; + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad6418ce09a4255b311f4bbcd2e7893d8561bd79 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0060_990 { + @State numbers: string[] = [] + + @State numbers2: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') + this.changeIndex(itemIndex, insertIndex) + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') + this.changeIndex(itemIndex, insertIndex) + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077.ets new file mode 100644 index 0000000000000000000000000000000000000000..29c49414616c06b45b56891f9450a232633c21f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0070_077 { + @State numbers: String[] = ['0', '1', '2', '3']; + @State numbers2: String[] = ['0', '1', '2']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + @State Text: string = 'Log'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridGridEvents_0070_077') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(50) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + this.Text= 'Index:'+this.numbers[0]; + }) + .onScrollBarUpdate((index: number, offset: number) => { + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e66e83e857c247b791b3d8af0d8ff0a279865ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridGridHouse_0070_630 { + @State numbers: string[] = ['1', '2']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day) + }, (day: string) => day) + } + .focusScopeId('Scope1') + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + Button('增加').onClick(() => { + this.numbers.push('3') + this.numbers.push('4') + }).id('btn') + } + .width(400).margin(10) + .align(Alignment.Center) + .margin(30) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d8b087ff149474b01df4c70e65dae251e997c13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentListandgridGridInteraction0010237 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State text: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: TextInputController = new TextInputController() + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .width('90%') + .height(40) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .inputFilter('[a-z]', (e) => { + console.log(JSON.stringify(e)) + }) + .onChange((value: string) => { + this.text = value + }) + }.alignSelf(ItemAlign.Start) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(6) + .rowsGap(6) + .friction(0.6) + .enableScrollInteraction(true) + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(300) + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('btn') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565.ets new file mode 100644 index 0000000000000000000000000000000000000000..1185f41776eece03f96a908512813c5710053d15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0100_565 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate("repeat(auto-fit,90px)") + .margin(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632.ets new file mode 100644 index 0000000000000000000000000000000000000000..2c652ca6f031d5fc45860ce4ea3e026cac99f1a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ + +@Component +struct HelloComponent { + @State message: string = 'Hello, World'; + + aboutToAppear() { + console.log('1114' + this.message + " aboutToAppear") + } + + aboutToDisappear() { + console.log('1114' + this.message + " aboutToDisappear") + } + + build() { + Text(this.message) + } +} + + +@Entry +@Component +struct UIComponentListandgridGridInterface_0100_632 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + HelloComponent({ message: "Item:" + day }); + }, (day: string) => day) + }, (day: string) => day) + } + .cachedCount(2) + .columnsTemplate("repeat(auto-fit,90px)") + .margin(20) + .id('UIComponentListandgridGridInterface_0100_632') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874.ets new file mode 100644 index 0000000000000000000000000000000000000000..842e6ce5996207c2c4b28491d0c63fdbf7e18d94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0120_874 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .constraintSize({ maxWidth: 200 }) + .columnsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d673c4a04780397aee1c6b361c05e610310c907 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0130_440 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .constraintSize({ maxWidth: 200 }) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a171bd6f043e3bca65920a39315c833cfa619fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0190_620 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State numbers1: String[] = ['0', '1']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.Auto) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308.ets new file mode 100644 index 0000000000000000000000000000000000000000..fc6985688d0fc0e135cb132e5076081675831a5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0200_308 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State numbers1: String[] = ['0', '1']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300.ets new file mode 100644 index 0000000000000000000000000000000000000000..38a1a49bb8244a4b3008ae02eaf8f23d1c791faa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0210_300 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State numbers1: String[] = ['0', '1']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c0d21b785627d6fa4d266aa6591915400085384 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0230_102 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1]; + else if(index==1) + return [0, 1, 2, 2]; + else if(index==2) + return [0 ,3 ,3 ,3]; + else if(index==3) + return [3, 0, 3, 3]; + else if(index==4) + return [4, 3, 2, 2]; + else + return [5, 5, 1, 1]; + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(-1) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264.ets new file mode 100644 index 0000000000000000000000000000000000000000..c64cf2fd88e200be7fa63828ab6ed171ef5249d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0240_264 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .rowsTemplate("repeat(auto-fit,90px)") + .padding(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f45717a2a8991bfebdc77e660191856cdd216ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0240_486 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(0) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323.ets new file mode 100644 index 0000000000000000000000000000000000000000..266df2e872c43d7b228c05efd29d38e0acf3fd71 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0250_323 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .rowsTemplate("repeat(auto-fit,90px)") + .margin(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798.ets new file mode 100644 index 0000000000000000000000000000000000000000..57d4d1da50fcaa20eb0af8e1d0098df5011ff8fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0250_798 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(2) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891.ets new file mode 100644 index 0000000000000000000000000000000000000000..65043c58332f7715f6a18741fb224518b4a5b9a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0260_891 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsGap(-1) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110.ets new file mode 100644 index 0000000000000000000000000000000000000000..a409ef84b492f75a3b76a62a51583b8b49f45bf3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0270_110 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(0) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7bfabaa4bf027663e456525bb14f0307f30bc37 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0270_291 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1]; + else if(index==1) + return [0, 1, 2, 2]; + else if(index==2) + return [0 ,3 ,3 ,3]; + else if(index==3) + return [3, 0, 3, 3]; + else if(index==4) + return [4, 3, 2, 2]; + else + return [5, 5, 1, 1]; + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsGap(0) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967.ets new file mode 100644 index 0000000000000000000000000000000000000000..dabc25bf7cd643a5d8fa68ad1c1a9df5b5f3ca54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0270_967 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .constraintSize({ maxWidth: 200 }) + .rowsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd025fc175a43690dda675f94fcfe70130f22859 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0280_006 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .constraintSize({ maxWidth: 200 }) + }, (day: string) => day) + }, (day: string) => day) + } + .rowsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218.ets new file mode 100644 index 0000000000000000000000000000000000000000..0640473a18db9f2f1011a74f2d65049daf233f63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0280_218 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(-5) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722.ets new file mode 100644 index 0000000000000000000000000000000000000000..04f1f4ff8e5e4f3c35107307a4e53ac957a8fb26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0290_722 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(500) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345.ets new file mode 100644 index 0000000000000000000000000000000000000000..46a9594f4eeebc3750152915b12e7a2f81f333c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0300_345 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(undefined) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a73239462e8ff47e5aea7b23ba7312ab06e0014 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0420_773 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth(0) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891.ets new file mode 100644 index 0000000000000000000000000000000000000000..46db2564c75cb71190853a30acd171a70acc5dd0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0430_891 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth(1) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612.ets new file mode 100644 index 0000000000000000000000000000000000000000..efb5d0903474dfb52645afff2e9cfbe254187fcd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0440_612 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth(-2) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917.ets new file mode 100644 index 0000000000000000000000000000000000000000..32f627d9aafe44126519b7dd3aba9d99b5420a15 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0450_917 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth('20px') + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322.ets new file mode 100644 index 0000000000000000000000000000000000000000..43d75516a1ec0bdc578a3959b76b11bf56b6dfbc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0460_322 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth('90%') + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052.ets new file mode 100644 index 0000000000000000000000000000000000000000..732443e302fb9df8397e151985df884ae0efeb3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0470_052 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 2fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(0xff0000) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955.ets new file mode 100644 index 0000000000000000000000000000000000000000..aa854e53f4bcaa7fa099412fab9a23e485e67e47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0480_955 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 2fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor('#FF0000') + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => {; + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624.ets new file mode 100644 index 0000000000000000000000000000000000000000..cb1616f7669ccc045b124dd6921286771592130f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624.ets @@ -0,0 +1,195 @@ +/* + * Copyright (C) 2024 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. + */ +class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource extends BasicDataSource { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentListandgridGridInterface_0840_624 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + private data: MyDataSource = new MyDataSource(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => 'day') + }, (day: string) => 'day') + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504.ets new file mode 100644 index 0000000000000000000000000000000000000000..0214c64b56139178d19cc1f172be1840a0079e6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0850_504 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca82ffc338effc97b588fff2651614ac52f7a0c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_090_321 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate("repeat(auto-fit,90px)") + .padding(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..da4229a659a8fe0876e9cba296a045046f00de78 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridListFramemode0050 { + private arr: number[] = [] + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 20; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('60%') + .height('80%') + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(false) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .cachedCount(1) + .multiSelectable(false) + .height('100%') + .width('100%') + .enableScrollInteraction(true) + .nestedScroll({ scrollForward: NestedScrollMode.SELF_ONLY, scrollBackward: NestedScrollMode.SELF_ONLY }) + .borderRadius(10) + .lanes(1) + .alignListItem(ListItemAlign.Start) + .friction(0.7) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Auto) + .backgroundColor(0xDCDCDC) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 10 }) + } + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..937849f3e4450eeaa43bee72df27bd21aabf5f9d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridListFramemode0060 { + private arr: number[] = [] + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 20; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('60%') + .height('80%') + }, (item: number) => JSON.stringify(item)) + } + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .cachedCount(1) + .multiSelectable(false) + .height('100%') + .width('100%') + .enableScrollInteraction(true) + .nestedScroll({ scrollForward: NestedScrollMode.SELF_ONLY, scrollBackward: NestedScrollMode.SELF_ONLY }) + .borderRadius(10) + .lanes(1) + .alignListItem(ListItemAlign.Start) + .friction(0.7) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Auto) + .backgroundColor(0xDCDCDC) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 10 }) + } + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ea2b0d66c0059c0f87bb6e63abdb7a1d5cfdd17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0500 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { + this.nameReachEnd='onScrollIndex' + }) + + Text(this.nameReachEnd) + + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..67f9f6461ac30bfffe7b01d679a5b1133609223c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0510 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(2) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("UIComponentListandgridListHirror0510") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .onReachStart(() => { + this.nameReachEnd = "ReachStart" + }) + + Text(this.nameReachEnd) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..28c22abffc64a4372b1fd5702cb7e36a9f771571 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0520 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(2) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("UIComponentListandgridListHirror0520") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .onReachEnd(() => { + this.nameReachEnd = "onReachEnd" + }) + Text(this.nameReachEnd) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..eb0a7e0fe298b940ceba0840ea90f084fe31fe43 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0530 { + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State numbers: number[] = [] + @State translateY: number = 0 + @State onScrollFrameBegin: string = '' + private scroller: Scroller = new Scroller() + private gridScroller: Scroller = new Scroller() + private touchDown: boolean = false + private listTouchDown: boolean = false + private scrolling: boolean = false + + aboutToAppear() { + for (let i = 0; i < 100; i++) { + this.numbers.push(i) + } + } + + build() { + Stack() { + Column() { + Column() { + List({ scroller: this.scroller }) { + ListItem() { + Grid(this.gridScroller) { + ForEach(this.numbers, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + .width('100%') + .height(40) + .shadow({ radius: 10, color: '#909399', offsetX: 1, offsetY: 1 }) + .borderRadius(10) + .translate({ x: 0, y: this.translateY }) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') + .friction(0.3) + .columnsGap(15) + .rowsGap(10) + .scrollBar(BarState.Off) + .width('100%') + .height('100%') + .layoutDirection(GridDirection.Column) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.listTouchDown = true + } else if (event.type == TouchType.Up) { + this.listTouchDown = false + } + }) + } + } + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.None) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.touchDown = true + } else if (event.type == TouchType.Up) { + this.touchDown = false + } + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.onScrollFrameBegin='onScrollFrameBegin' + + if (this.scrolling && offset > 0) { + let newOffset = this.scroller.currentOffset().yOffset + if (newOffset >= 590) { + this.gridScroller.scrollBy(0, offset) + return { offsetRemain: 0 } + } else if (newOffset + offset > 590) { + this.gridScroller.scrollBy(0, newOffset + offset - 590) + return { offsetRemain: 590 - newOffset } + } + } + return { offsetRemain: offset } + }) + .onScrollStart(() => { + if (this.touchDown && !this.listTouchDown) { + this.scrolling = true + } + }) + .onScrollStop(() => { + this.scrolling = false + }) + } + .id("UIComponentListandgridListHirror0530") + .width('100%') + .height(600) + .padding({ left: 10, right: 10 }) + + Text(this.onScrollFrameBegin) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..b81e3cc84e5ffbf9725d617818d4515f51639848 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0540 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State onScrollStart:string='' + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id("UIComponentListandgridListHirror0540") + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollStart(() => { + this.onScrollStart="onScrollStart" + console.info("XXX" + "Grid onScrollStart") + }) + + Text(this.onScrollStart) + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1f326aa60be063eb4b95f5badd04eff7c9cfe4f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0550 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State onScrollStop:string='' + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id("UIComponentListandgridListHirror0550") + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollStop(() => { + this.onScrollStop="onScrollStop" + console.info("XXX" + "Grid onScrollStop") + }) + + Text(this.onScrollStop) + + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..d03480331947c7a93170fb2119446d6cd830c97d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0560 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder + pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1; i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + List() { + ListItem() { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id("UIComponentListandgridListHirror0560") + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, + isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + this.changeIndex(itemIndex, insertIndex) + this.nameReachEnd = isSuccess + '' + }) + } + } + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570.ets new file mode 100644 index 0000000000000000000000000000000000000000..48b93b3a48b10012958466106d14a9082d0911db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0570 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id("UIComponentListandgridListHirror0570") + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + this.nameReachEnd = "ReachStart" + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580.ets new file mode 100644 index 0000000000000000000000000000000000000000..64f7758f5527e1abb513fd22ce89f9f2d5815ce0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0580 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("listandgridListHirror0580") + .border({width:1}) + .height(500) + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .onDidScroll(() => { + this.nameReachEnd = 'onDidScroll' + }) + + Text(this.nameReachEnd).fontSize(30) + + Button("拖拽").fontSize(20).margin({top:5}).draggable(true).onDragStart(() => { + + }) + .id("btnListandgridListHirror0580") + + } + + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590.ets new file mode 100644 index 0000000000000000000000000000000000000000..2203a8ba96f49fabde508ea5133407dce03b2932 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0590 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id('UIComponentListandgridListHirror0590') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width(400) + .backgroundColor(0xFAEEE0) + .height(260) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDragMove(()=>{ + this.nameReachEnd = "onItemDragMove" + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c0e47d0d67ecc8a71212ca16dde98dc3362f149 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0600 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id('UIComponentListandgridListHirror0600') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width(400) + .backgroundColor(0xFAEEE0) + .height(260) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDragLeave(()=>{ + this.nameReachEnd = "onItemDragLeave" + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d1ea3312279e59ef10b3b041b1dfa8bc8ffc369 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0610 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id('UIComponentListandgridListHirror0610') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width(400) + .backgroundColor(0xFAEEE0) + .height(260) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + this.nameReachEnd = "onItemDrop" + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630.ets new file mode 100644 index 0000000000000000000000000000000000000000..a83abb1ed4bf89e3a3b51edc95e3250ca4750f8b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0630 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridListHirror0630') + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .onDidScroll(()=>{ + this.nameReachEnd='onDidScroll' + }) + + Text(this.nameReachEnd) + + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd345256232de4fced365b60a00dd0da9fd5a0b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0670 { + @State timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({ space: 20 }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) // 每行之间的分界线 + }) + } + + + Button("添加item").onClick((event: ClickEvent) => { + let list = this.timeTable.concat() + list[0].projects.push('体育') + this.timeTable = list + }).id("UIComponentListandgridListHirror0670") + + }.width('100%').height('100%') + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980.ets new file mode 100644 index 0000000000000000000000000000000000000000..a7a8597ca92ba4483636040ed91961d0cabef971 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListInterface0980 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("list") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%') + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450.ets new file mode 100644 index 0000000000000000000000000000000000000000..e519db44d29edd4318956c614bd5a4e699328f9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListInterface1450 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("list") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%') + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500.ets new file mode 100644 index 0000000000000000000000000000000000000000..8205d79d7f46abb97f3bfabee72a096a5d0146a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridListInterface1500 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("UIComponentListandgridListInterface1500") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { + console.info('first' + firstIndex) + console.info('last' + lastIndex) + console.info('center' + centerIndex) + }) + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset) + }) + .width('90%') + } + .width('600') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b0d27e30c65d1d4ddf21a7f2000ec375b6c656c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010.ets @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2024 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. + */ + +class BasicDataSource_list0010 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} + +class MyDataSource extends BasicDataSource_list0010 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public changeData(): void { + this.dataArray.splice(0, 1); + this.dataArray.splice(0, 0, "Hello other"); + this.notifyDataReload(); + } + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } +} + +@Entry +@Component +struct UIComponentListandgridListInterfaceCachedcount0010 { + private data: MyDataSource = new MyDataSource(); + @Builder itemEnd(item:number) { Row() { + Button("确认").margin("4vp").onClick(() => { + }) + Button("取消").margin("4vp").onClick(() => { + + }) + }.justifyContent(FlexAlign.SpaceEvenly) + } + aboutToAppear() { + for (let i = 0; i <= 20; i++) { + this.data.pushData(`Hello ${i}`) + } + } + + build() { + if (true) { + Column() { + Button("on data reload") + .onClick(() => { + this.data.changeData(); + }) + + List({ space: 3 }) { + LazyForEach(this.data, (item: string, index: number) => { + ListItem() { + TestListItemView({text: item}) + } + .clip(true) + .borderWidth(3) + .borderColor(Color.Blue) + .swipeAction({ + end: + { + builder: () => { this.itemEnd(index) }, + actionAreaDistance: 80, + onAction: () => { + animateTo({ duration: 1000 }, () => { + }) + }, + + onStateChange: (State) => { + console.log("1210 State: " + State) + } + }, + onOffsetChange: (offset) => { + console.log("1210 偏移量:" + offset) + } + }) }, (item: string) => item) + } + .cachedCount(3) + .height('50%') + .width('100%') + .borderWidth(3) + .borderColor(Color.Orange) + } + .justifyContent(FlexAlign.Center) + .height('100%') + } + } +} + +@Component +export struct TestListItemView { + @State text: string = ''; + @State str: string = ''; + + aboutToAppear(): void { + this.str = 'aboutToAppear item id: ' + this.text + } + + aboutToDisappear(): void { + this.str = 'aboutToDisAppear item id: ' + this.text + } + + build() { + Text(this.str) + .fontSize(50) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..778d4e69614afd01d3076904995501eacc019b63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020.ets @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2024 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. + */ + +class BasicDataSource_list0020 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} + +class MyDataSource extends BasicDataSource_list0020 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public changeData(): void { + this.dataArray.splice(0, 1); + this.dataArray.splice(0, 0, "Hello other"); + this.notifyDataReload(); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } +} + +@Entry +@Component +struct UIComponentListandgridListInterfaceCachedcount0020 { + private data: MyDataSource = new MyDataSource(); + + @Builder + itemEnd(item: number) { + Row() { + Button("确认").margin("4vp").onClick(() => { + }) + Button("取消").margin("4vp").onClick(() => { + + }) + }.justifyContent(FlexAlign.SpaceEvenly) + } + + aboutToAppear() { + for (let i = 0; i <= 20; i++) { + this.data.pushData(`Hello ${i}`) + } + } + + build() { + if (true) { + Column() { + Button("on data reload") + .onClick(() => { + this.data.changeData(); + }) + + List({ space: 3 }) { + LazyForEach(this.data, (item: string, index: number) => { + ListItemGroup({ space: 5 }) { + ListItem() { + TestListItemView({ text: item }) + } + .clip(true) + .borderWidth(3) + .borderColor(Color.Blue) + .swipeAction({ + end: + { + builder: () => { + this.itemEnd(index) + }, + actionAreaDistance: 80, + onAction: () => { + animateTo({ duration: 1000 }, () => { + }) + }, + + onStateChange: (State) => { + console.log("1210 State: " + State) + } + }, + onOffsetChange: (offset) => { + console.log("1210 偏移量:" + offset) + } + }) + + } + }, (item: string) => item) + + } + .cachedCount(3) + // .clip(false) + .height('50%') + .width('100%') + .borderWidth(3) + .borderColor(Color.Orange) + } + .justifyContent(FlexAlign.Center) + .height('100%') + } + } +} + +@Component +export struct TestListItemView { + @State text: string = ''; + @State str: string = ''; + + aboutToAppear(): void { + this.str = 'aboutToAppear item id: ' + this.text + } + + aboutToDisappear(): void { + this.str = 'aboutToDisAppear item id: ' + this.text + } + + build() { + Text(this.str) + .fontSize(50) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..4189bc3eeeb2e3d2fc93ceb1b9c03b126c030618 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0070 { + private arr: number[] = [] + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i <50; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 0, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('50').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .height(300) + .borderRadius(10).backgroundColor(0xFFFFFF) + + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0070") + .chainAnimation(true) + .scrollSnapAlign(ScrollSnapAlign.START) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .width('100%') + .height(340) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + } + + Button('回到顶部') + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0070") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollEdge(Edge.Top) + + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..e33f430b6f9e5737269c5d14348f128f21f6daeb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0140 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i <50; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 0, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('50').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .height(300) + .borderRadius(10).backgroundColor(0xFFFFFF) + + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0140") + .chainAnimation(true) + .scrollSnapAlign(ScrollSnapAlign.START) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .width('100%') + .height(340) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + } + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0140") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..1540fdc8917f5493a3ca120ff4b72b828bb13b9e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0150 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 9; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 0, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('50').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .height(300) + .borderRadius(10).backgroundColor(0xFFFFFF) + + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0150") + .chainAnimation(true) + .scrollSnapAlign(ScrollSnapAlign.START) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .width('100%') + .height(340) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + } + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0150") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..6547fa0904622051562866493cc38e010d9163ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0170 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("滑动到指定位置") + .width(150) + .height(50) + .id("btnListMirror0170") + .onClick((event: ClickEvent) => { + const yOffset: number = this.scrollerForList.currentOffset().yOffset; + this.scrollerForList.scrollTo({ xOffset: 0, yOffset: yOffset + 100 }) + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..b6e7e0981d9545e1ed88b26ae17cb5f196e1f112 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0180 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 16; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('10%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0180") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height('85%') + + Button('回到顶部') + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0180") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollEdge(Edge.Top) + + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb2315e9dfbf31fed9248a68597c77145143621c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0200 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("下一页") + .width(150) + .height(50) + .id("btnListMirror0200") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollPage({ next: true }) + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..20e6ae9d75b6728995901075b9cd2d32d52c3974 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0210 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0210") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("上一页") + .width(150) + .height(50) + .id("btnListMirror0210") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollPage({ next: false }) + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..d603f7ecbb1d87df261ab0dd79e81f9c536b5748 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0250 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 16; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0250") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height('85%') + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(50) + .id("btnListMirror0250") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d515a0dd1b04b5562456613272d3a77362d5bbf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0260 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0260") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(50) + .id("btnListMirror0260") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1946f53915a28231012dfdba28a49b48d45daab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0460 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0460") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470.ets new file mode 100644 index 0000000000000000000000000000000000000000..4bb8d7eb355fa4fabf68e658c250b64edd9f6d72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0140 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0470") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620.ets new file mode 100644 index 0000000000000000000000000000000000000000..48691dda67dc189b3fddce907910e824ba688278 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620.ets @@ -0,0 +1,62 @@ +/* + * + * * Copyright (C) 2024 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. + * + */ + +@Entry +@Component +struct UIComponentListandgridListMirror0620 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + @State text: string[] = []; + private scroller: Scroller = new Scroller(); + @State num: number = -2; + + build() { + Column({space: 10}) { + List({ space: 20 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '_scroll') + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id(item + '') + .onDragStart(() => { + }) + }, (item: string) => item) + } + .padding(20) + .scrollBar(BarState.Off) + .friction(0.6) + .listDirection(Axis.Vertical) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('100%') + .height(300) + .backgroundColor(0xDCDCDC) + .onWillScroll(() => { + this.text.push('WillScroll') + }) + .direction(Direction.Ltr) + .width("100%") + + Text(`回调:${this.text}`) + + }.height('100%').backgroundColor(Color.Gray) + .padding(10) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640.ets new file mode 100644 index 0000000000000000000000000000000000000000..52e5f6a933300fcf75bb321f09dd1ef80f15fa5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640.ets @@ -0,0 +1,60 @@ +/* + * + * * Copyright (C) 2024 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. + * + */ + +@Entry +@Component +struct UIComponentListandgridListMirror0640 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + @State text: string[] = []; + private scroller: Scroller = new Scroller(); + @State num: number = -2; + + build() { + Column({space: 10}) { + List({ space: 20 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '_scroll') + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id(item + '') + .onDragStart(() => { + }) + }, (item: string) => item) + } + .padding(20) + .scrollBar(BarState.Off) + .listDirection(Axis.Vertical) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('100%') + .height(300) + .backgroundColor(0xDCDCDC) + .onScrollVisibleContentChange(() => { + this.text.push('ScrollVisibleContentChange') + }) + .width("100%") + + Text(`回调:${this.text}`) + + }.height('100%').backgroundColor(Color.Gray) + .padding(10) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..45097598b968ca6b231071117be8c873a01dc3bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridListScrolltoindex0010 { + @State arr: number[] = []; + private listScroller: ListScroller = new ListScroller(); + @State scrollSnapAlignFlag: ScrollSnapAlign = ScrollSnapAlign.END; + + build() { + Column() { + Button('跳转到第六个') + .id('UIComponentListandgridListScrolltoindex0010_001') + .onClick(() => { + this.arr.push(1) + this.arr.push(2) + this.arr.push(3) + this.listScroller.scrollToIndex(2) + + }) + List({ space: 10, scroller: this.listScroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('item_' + item) + .width(160) + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .focusable(false) + .padding(10) + .backgroundColor(Color.Yellow) + .listDirection(Axis.Horizontal) + .scrollSnapAlign(this.scrollSnapAlignFlag) + } + .backgroundColor(0xDCDCDC) + .width('80%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..04a65d6682c2abe49e32aef86f53d7644099e680 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridListScrolltoindex0030 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + private listScroller: ListScroller = new ListScroller(); + @State scrollSnapAlignFlag: ScrollSnapAlign = ScrollSnapAlign.END; + + build() { + Column() { + Button('跳转到第3个') + .id('UIComponentListandgridListScrolltoindex0030_001') + .onClick(() => { + this.listScroller.scrollToIndex(2) + this.arr.shift() + }) + List({ space: 10, scroller: this.listScroller }) { + ListItemGroup() { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('item_' + item) + .width(160) + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + } + .focusable(false) + .padding(10) + .backgroundColor(Color.Yellow) + .listDirection(Axis.Horizontal) + .scrollSnapAlign(this.scrollSnapAlignFlag) + } + .backgroundColor(0xDCDCDC) + .width('80%') + .height('100%') + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..4f6fc8b5f12a594a9c16854ed6c13b6be14a6367 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridListScrolltoindex0040 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + private listScroller: ListScroller = new ListScroller(); + @State scrollSnapAlignFlag: ScrollSnapAlign = ScrollSnapAlign.END; + + build() { + Column() { + Button('跳转到第3个') + .id('UIComponentListandgridListScrolltoindex0040_001') + .onClick(() => { + this.listScroller.scrollToIndex(2) + this.arr.shift() + }) + List({ space: 10, scroller: this.listScroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('item_' + item) + .width(160) + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .focusable(false) + .padding(10) + .backgroundColor(Color.Yellow) + .listDirection(Axis.Horizontal) + .scrollSnapAlign(this.scrollSnapAlignFlag) + } + .backgroundColor(0xDCDCDC) + .width('80%') + .height('100%') + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..1803991f697cc2e2bba633b95142c5aa79cf73c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandcridListitencroupMirror0070 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 16; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('10%') + }, (item: number) => JSON.stringify(item)) + } + .id("UIComponentListandcridListitencroupMirror0070") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .sticky(StickyStyle.None) + .backgroundColor(0xDCDCDC) + }.height('85%') + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..4fcb0e9361dfe3d08670eb700f2f63dbe8eca2aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandcridListitencroupMirror0100 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnMirror0100") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..7178865b1d0a37039804bb1cdb12af456d97d353 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandcridListitencroupMirror0110 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnMirror0110") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580.ets new file mode 100644 index 0000000000000000000000000000000000000000..47db2e3d973dd10347870f2b48a4aac217ee70b8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 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. + */ + +// button_modifier.ets +export class MultiSelectModifier1 implements AttributeModifier { + applyNormalAttribute(instance: ListAttribute): void { + instance.multiSelectable(true) + } +} +export class MultiSelectModifier2 implements AttributeModifier { + applyNormalAttribute(instance: ListAttribute): void { + instance.multiSelectable(false) + } +} + +@Entry +@Component +struct UIComponentListAndGridModifier0580 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State multiSelectModifier1 : MultiSelectModifier1 = new MultiSelectModifier1() + @State multiSelectModifier2 : MultiSelectModifier2 = new MultiSelectModifier2() + @State index : number = 0; + // 导入对象 + controller: TextClockController = new TextClockController() + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.attributeModifier(this.index == 0 ? this.multiSelectModifier1 : this.multiSelectModifier2).height("80%") + Row() { + Button('click').width(100).padding(5).onClick(() => { + this.index = (this.index + 1) % 2; + }).margin(5).id('Button_click') + }.height("15%") + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670.ets new file mode 100644 index 0000000000000000000000000000000000000000..563b79140bb6e0f34ce740bf18d82a627217ce9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 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. + */ + +// button_modifier.ets +export class EdgeEffectModifier implements AttributeModifier { + edgeEffectParam: EdgeEffect = EdgeEffect.Spring + + // 通过构造函数,创建时传参 + constructor(edgeEffectParam?: EdgeEffect) { + this.edgeEffectParam = edgeEffectParam ? edgeEffectParam : EdgeEffect.Spring + } + applyNormalAttribute(instance: ListAttribute): void { + instance.edgeEffect(EdgeEffect.Spring) + } +} + +@Entry +@Component +struct UIComponentListAndGridModifier0670 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + private edgeEffect: EdgeEffect[] = [EdgeEffect.Spring, EdgeEffect.Fade, EdgeEffect.None] + @State index : number = 0; + // 导入对象 + controller: TextClockController = new TextClockController() + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.attributeModifier(new EdgeEffectModifier(this.edgeEffect[this.index])).height("80%") + Row() { + Button('click').width(100).padding(5).onClick(() => { + this.index = (this.index + 1) % 3; + }).margin(5).id('Button_click') + }.height("15%") + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170.ets new file mode 100644 index 0000000000000000000000000000000000000000..28d1e971e70224f7f9fdecf6080911ea688c5c2c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridModifier1170 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State layoutdirection: FlexDirection = FlexDirection.Column; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: this.layoutdirection, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + Button('Button') + .id('UIComponentListandgridModifier1170') + .onClick(() => { + this.layoutdirection = FlexDirection.ColumnReverse; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120.ets new file mode 100644 index 0000000000000000000000000000000000000000..cec685ead258308363c8cd543c7b76b8c20bcc18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120.ets @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2024 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier120 { + @State modifier1: ListModifier = new ListModifier().sticky(StickyStyle.Header); + @State modifier2: ListModifier = new ListModifier().sticky(StickyStyle.Footer); + @State modifier3: ListModifier = new ListModifier().sticky(StickyStyle.None); + private timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + }, + { + title: '星期二', + projects: ['物理', '化学', '生物'] + }, + { + title: '星期三', + projects: ['历史', '地理', '政治'] + }, + { + title: '星期四', + projects: ['美术', '音乐', '体育'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({ space: 20 }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) // 每行之间的分界线 + }) + } + .id('UIComponentListandgridModifier120') + .width('90%') + .sticky(StickyStyle.Header | StickyStyle.Footer) + .scrollBar(BarState.Off) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier120_1') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + Button('edit list') + .id('UIComponentListandgridModifier120_2') + .onClick(() => { + this.modifier1 = this.modifier3; + }) + }.width('100%').height('80%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20.ets new file mode 100644 index 0000000000000000000000000000000000000000..e23708f9b7b29b7a6f63dd3ba28441a455310963 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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 { ListItemModifier, } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier20 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State modifer1: ListItemModifier = new ListItemModifier().selectable(true); + @State modifer2: ListItemModifier = new ListItemModifier().selectable(true); + @State modifer: ListItemModifier = this.modifer1; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + .attributeModifier(this.modifer) + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + Button('Button') + .id('UIComponentListandgridModifier20') + .onClick(() => { + this.modifer = this.modifer2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bd665a9064455510d6ed940867ba057d178fb06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier230 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State scrollSnapAlign: ScrollSnapAlign = ScrollSnapAlign.START; + @State modifier: ListModifier = new ListModifier().scrollSnapAlign(ScrollSnapAlign.NONE); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier230') + .onClick(() => { + this.modifier = new ListModifier().scrollSnapAlign(this.scrollSnapAlign); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30.ets new file mode 100644 index 0000000000000000000000000000000000000000..4276b35de68ec16209a91e0729741ca7d5c2629c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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 { ListModifier, } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier30 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State modifer1: ListModifier = new ListModifier().multiSelectable(false); + @State modifer2: ListModifier = new ListModifier().multiSelectable(false); + @State modifer: ListModifier = this.modifer1; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifer) + Button('Button') + .id('UIComponentListandgridModifier30') + .onClick(() => { + this.modifer = this.modifer2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360.ets new file mode 100644 index 0000000000000000000000000000000000000000..12f1d0387fe4164d72ed2790330409c84b961a9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier360 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier1: ListModifier = new ListModifier().enableScrollInteraction(true); + @State modifier2: ListModifier = new ListModifier().enableScrollInteraction(false); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.id('UIComponentListandgridModifier360_1') + .width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier360') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40.ets new file mode 100644 index 0000000000000000000000000000000000000000..f85a79e1b333a2239ae55d193c121ced9b18907d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListItemModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier40 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier: ListItemModifier = new ListItemModifier().selectable(false); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + .selectable(true) + .attributeModifier(this.modifier) + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .contentStartOffset(10) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440.ets new file mode 100644 index 0000000000000000000000000000000000000000..031bc01d81b638121211d0e12c32a2585bbdc3e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier440 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier1: ListModifier = new ListModifier().chainAnimation(true); + @State modifier2: ListModifier = new ListModifier().chainAnimation(false); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + } + .id('UIComponentListandgridModifier440_1') + .width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier440') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470.ets new file mode 100644 index 0000000000000000000000000000000000000000..b48ed8cec45a0ddf3967836da2386c4f590af5e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier470 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier: ListModifier = new ListModifier().cachedCount(-1); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480.ets new file mode 100644 index 0000000000000000000000000000000000000000..f075bbeaa5615dc125669b33460f5b5f7160e33d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier480 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier: ListModifier = new ListModifier().cachedCount(2); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1ad040cfc593df9409a627260aa789579c89b2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier510 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier1: ListModifier = new ListModifier().cachedCount(2); + @State modifier2: ListModifier = new ListModifier().cachedCount(4); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier510') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae5a4974436c268501f765c4f4cb44cbc17bcfe8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier520 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State cachedCount: number = 2; + @State modifier: ListModifier = new ListModifier().cachedCount(1); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier520') + .onClick(() => { + this.modifier = new ListModifier().cachedCount(this.cachedCount); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c600b85dbf7eeba912557eb95e32a6583d04583 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier760 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State listDirection : Axis = Axis.Vertical; + @State modifier: ListModifier = new ListModifier().listDirection(Axis.Horizontal); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier760') + .onClick(() => { + this.modifier = new ListModifier().listDirection(this.listDirection); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8a4ba339f122ad810266d9e3d60b7d48354a714 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier810 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State alignListItem: ListItemAlign = ListItemAlign.Start; + @State modifier: ListModifier = new ListModifier().alignListItem(ListItemAlign.Center); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier810') + .onClick(() => { + this.modifier = new ListModifier().alignListItem(this.alignListItem); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d9ee558a954784ac8c467cad4902122ccd704b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier930 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentEndOffset: number = 0; + @State modifier: ListModifier = new ListModifier().contentEndOffset(10); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier930') + .onClick(() => { + this.modifier = new ListModifier().contentEndOffset(this.contentEndOffset); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce6392dad6ef663a3a44790fe41ea08bbc55b370 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier980 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State modifier: ListModifier = new ListModifier().contentStartOffset(10); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier980') + .onClick(() => { + this.modifier = new ListModifier().contentStartOffset(this.contentStartOffset); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..9abd00ee2caf1895b8add127adada9d0ad5943f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonDts0010 { + @State arr: number[] = []; + @State text: string[] = []; + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Column({ space: 10 }) { + List() { + ForEach(this.arr, (item: number) => { + ListItem() { + WaterFlow() + .width('100%') + .height(150) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .height(500) + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + .onScrollIndex(() => { + this.text.push('ScrollIndex') + }) + .onReachStart(() => { + this.text.push('ReachStart') + }) + .onReachEnd(() => { + this.text.push('ReachEnd') + }) + .onScrollFrameBegin((offset: number) => { + this.text.push('ScrollFrameBegin') + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + this.text.push('ScrollStart') + }) + .onScrollStop(() => { + this.text.push('ScrollStop') + }) + .onItemMove((from: number, to: number) => { + this.text.push('ItemMove') + return true + }) + .onWillScroll(() => { + this.text.push('WillScroll') + }) + .onDidScroll(() => { + this.text.push('DidScroll') + }) + .onScrollVisibleContentChange(() => { + this.text.push('ScrollVisibleContentChange') + }) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + Text(`回调:${Array.from(new Set(this.text)) }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..46edf9ce189207bb945991a5069591ad80a459d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020.ets @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonDts0020 { + @State arr: number[] = []; + @State text: string[] = []; + @State isRefreshing: boolean = false + + @Builder + refreshBuild() { + Column() { + Image($r('app.media.icon')) + .width(35) + .height(35) + .backgroundColor(Color.Yellow) + } + } + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Refresh({ refreshing: this.isRefreshing, builder: this.refreshBuild()}) { + Scroll() { + List() { + ForEach(this.arr, (item: number) => { + ListItem() { + WaterFlow() + .width('100%') + .height(150) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .height(500) + .onReachStart(() => { + this.text.push('ReachStart') + }) + .onReachEnd(() => { + this.text.push('ReachEnd') + }) + .onScrollFrameBegin((offset: number) => { + this.text.push('ScrollFrameBegin') + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + this.text.push('ScrollStart') + }) + .onScrollStop(() => { + this.text.push('ScrollStop') + }) + .onWillScroll(() => { + this.text.push('WillScroll') + }) + .onDidScroll(() => { + this.text.push('DidScroll') + }) + .onScrollEdge(() => { + this.text.push('ScrollEdge') + }) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + .onStateChange((refreshStatus: RefreshStatus) => { + this.text.push('StateChange') + }) + .onRefreshing(() => { + this.text.push('Refreshing') + }) + .onOffsetChange(() => { + this.text.push('OffsetChange') + }) + .backgroundColor(0x89CFF0) + Text(`回调:${Array.from(new Set(this.text)) }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f74ced453bc0c5d67d91cb94c70429799eb6284 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonDts0030 { + @State arr: number[] = []; + @State text: string[] = []; + @State isRefreshing: boolean = false + + @Builder + refreshBuild() { + Column() { + Image($r('app.media.icon')) + .width(35) + .height(35) + .backgroundColor(Color.Yellow) + } + } + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Refresh({ refreshing: this.isRefreshing, builder: this.refreshBuild()}) { + List() { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '') + .textAlign(TextAlign.Center) + .width('100%') + .height(150) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .height(500) + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + .onStateChange((refreshStatus: RefreshStatus) => { + this.text.push('StateChange') + }) + .onRefreshing(() => { + this.text.push('Refreshing') + }) + .onOffsetChange(() => { + this.text.push('OffsetChange') + }) + .backgroundColor(0x89CFF0) + Text(`回调:${Array.from(new Set(this.text)) }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..180455d21f6db1147b8e99b2d4a4efe9bfa9707e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040.ets @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 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 webview from '@ohos.web.webview'; + +@Entry +@Component +struct UIComponentListandgridXommonDts0040 { + @State text: string[] = []; + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + private webController: webview.WebviewController = new webview.WebviewController(); + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.selectedIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column({space: 10}) { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Green) + + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Yellow).id('ScrollLog_002') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(3, 'pink')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(4, 'red')) + } + .vertical(false) + .barWidth(360) + .barHeight(56) + .animationDuration(400) + .id('ScrollLog_001') + .onChange((index: number) => { + this.currentIndex = index + this.selectedIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + this.text.push('AnimationStart') + this.selectedIndex = targetIndex + }) + .onAnimationEnd(() => { + this.text.push('AnimationEnd') + }) + .onGestureSwipe(() => { + this.text.push('GestureSwipe') + }) + .customContentTransition((from: number, to: number) => { + let tabContentAnimatedTransition = {} as TabContentAnimatedTransition + this.text.push('customContentTransition') + return tabContentAnimatedTransition + }) + .onContentWillChange((currentIndex, comingIndex) => { + this.text.push('ContentWillChange') + return true + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + Text(`回调:${Array.from(new Set(this.text)) }`) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..c63de082d5461be758b6438fce6a78ef184d49ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0010 { + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State scroll: string = ''; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0010_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll0010_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll(() => { + this.scroll = 'onScroll succ' + }) + + Text('scroll: ' + this.scroll) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..15d1ee363ffcd9f2f42cba15317eff56fe46a1cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0020 { + @State willscrollstate: number = 0; + @State didscrollstate: number = 0; + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0020_002') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765.ets new file mode 100644 index 0000000000000000000000000000000000000000..f59a44bb5b76cd73074649e21f0aa1bb57d6d308 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0200765 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller() + layoutOptions1: GridLayoutOptions = { + regularSize: [1, 1], // 只支持[1, 1] + irregularIndexes: [0, 6], // 索引为0和6的GridItem占用一行 + } + layoutOptions2: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 7], // 索引为0和7的GridItem占用的列数由onGetIrregularSizeByIndex指定 + onGetIrregularSizeByIndex: (index: number) => { + if (index === 0) { + return [1, 5] + } + return [1, index % 6 + 1] + } + } + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0200765_001') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0200765_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions1) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.Off) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + }.width('100%').margin({ top: 5 }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc2c91f3d8aae3ec9932eb5958c70509ed792bf9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0240816 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0240816_001') + .onClick(() => { + this.scroller.scrollToIndex(3); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0240816_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .enableScrollInteraction(false) + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533.ets new file mode 100644 index 0000000000000000000000000000000000000000..890224f5bbdb42a11650de1e771db59f14b9f954 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0250533 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0250533_001') + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 0, + yOffset: 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0250533_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164.ets new file mode 100644 index 0000000000000000000000000000000000000000..be8ec53aa8efd9d6992abf27d5bce4bd3c818285 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0260164 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0260164_001') + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 0, + yOffset: 100 + }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0260164_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3b6b7ece095e9371488f934c5f04fd6f4279ae9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0270155 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0270155_001') + .onClick(() => { + this.scroller.scrollToIndex(5); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0270155_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .animation({ + duration: 1000, + curve: Curve.Ease + }) + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860.ets new file mode 100644 index 0000000000000000000000000000000000000000..223fbe57aff83a0646a69f6a50f4cf987fcdfee4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0280860 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0280860_001') + .onClick(() => { + this.scroller.scrollToIndex(5); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0280860_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252.ets new file mode 100644 index 0000000000000000000000000000000000000000..677202f60b32e23fc61c0ca8b63f9c587303fc22 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0290252 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0290252_001') + .onClick(() => { + this.scroller.scrollBy(0, 100); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0290252_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319.ets new file mode 100644 index 0000000000000000000000000000000000000000..881bc76e1b2e0dce20c1c9a1bf462251ac1f4446 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0300319 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0300319_001') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0300319_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603.ets new file mode 100644 index 0000000000000000000000000000000000000000..9feda8130b6b29deb0cfb60644e7450baa690f6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0310603 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0310603_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0310603_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..6866ef36be23999c2c2788157242086f21b1aff1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0320 { + @State willscrollstate: number = 0; + @State didscrollstate: number = 0; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE); + this.isFullScreen = !this.isFullScreen; + }) + } + + build() { + Column() { + Column() { + Button("横竖屏切换") + .id('UIComponentListandgridXommonOnscroll0320_001') + .onClick(() => { + this.horVerSwitch(); + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll0320_002') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887.ets new file mode 100644 index 0000000000000000000000000000000000000000..d5e09ea42b46071c7fb3e825436d62cecac0da8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0330887 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0330887_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0330887_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..e70a71b69a0ae0f49445f6b1e13bf45576b7cd97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0440 { + scroller: Scroller = new Scroller; + @State isFullScreen: boolean = false; + @State willScroll: string = ''; + @State didScroll: string = ''; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Scroll(this.scroller) { + Column() { + Button('horVerSwitch') + .id('UIComponentListandgridXommonOnscroll0440_001') + .onClick(() => { + this.horVerSwitch(); + }) + ForEach(this.arr, (item: number) => { + Text('will ' + this.willScroll) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + Text('did ' + this.didScroll) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentListandgridXommonOnscroll0440_002') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({ + snapAlign: ScrollSnapAlign.START, + snapPagination: 400, + enableSnapToStart: true, + enableSnapToEnd: true + }) + .onDidScroll(() => { + this.didScroll = 'onDidScroll succ' + }) + .onWillScroll(() => { + this.willScroll = 'onWillScroll succ' + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f837d1abe04eff75b2c183eb28b89345440df19 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource'; +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0580 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + @State willScroll: string = ''; + @State didScroll: string = ''; + @State isFullScreen: boolean = false; + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('horVerSwitch') + .id('UIComponentListandgridXommonOnscroll0580_001') + .onClick(() => { + this.horVerSwitch(); + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll0580_002') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text('will ' + this.willScroll + ',did ' + this.didScroll) + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onDidScroll(() => { + this.didScroll = 'onDidScroll succ' + }) + .onWillScroll(() => { + this.willScroll = 'onWillScroll succ' + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100.ets new file mode 100644 index 0000000000000000000000000000000000000000..f889409b0cc6078f442ecfd4fb307fe1ccea348a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll100 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll100') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100 }) + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110.ets new file mode 100644 index 0000000000000000000000000000000000000000..df8ecb9dcf6a55604afc70f4d61e2d6857826027 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll110 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll110') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, true, ScrollAlign.START); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f69cb301ad3acfb03ea237e964575b092edf782 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll120 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll120') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7dc8808af5f9cdea591878974aec97d5ee62f00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll130 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('scroll 150') + .id('UIComponentListandgridXommonOnscroll130') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0, 150); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140.ets new file mode 100644 index 0000000000000000000000000000000000000000..6cb1052adb51ae4040018a4d2b942c0701f0b55c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll140 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll140') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150.ets new file mode 100644 index 0000000000000000000000000000000000000000..8faf2b629ab909594ae3d9ef782392a2715598aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll150 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll150') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.End); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160.ets new file mode 100644 index 0000000000000000000000000000000000000000..f51d59c2a07ccbdb3cce3e615aaf3d56037716c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160.ets @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll160 { + scroller: ListScroller = new ListScroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + }, + { + title: '星期二', + projects: ['物理', '化学', '生物'] + }, + { + title: '星期三', + projects: ['历史', '地理', '政治'] + }, + { + title: '星期四', + projects: ['美术', '音乐', '体育'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({scroller:this.scroller, space: 20 }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) // 每行之间的分界线 + }) + } + .width('90%') + .height('80%') + .sticky(StickyStyle.Header | StickyStyle.Footer) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll160') + .height('5%') + .onClick(() => { + this.scroller.scrollToItemInGroup(1,1); + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8e946c448daccb1ecd26402799a3c35de61248d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll170 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State listdirection : Axis = Axis.Vertical; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll170') + .listDirection(this.listdirection) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('90%') + .height('50%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll170_button') + .height('5%') + .onClick(() => { + this.listdirection = Axis.Horizontal; + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e4bc9749e8ae80090ff44404e355cb54b677a36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll180 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll180') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + this.arr.push(10); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + this.arr.push(11); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190.ets new file mode 100644 index 0000000000000000000000000000000000000000..0738cc8ce218b9a6b53be2d4cf6e73497eb3d353 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll190 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll190') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200.ets new file mode 100644 index 0000000000000000000000000000000000000000..80694964120d4d416663fc71d0a4ec3e5167d170 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll200 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + layoutOptions1: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 6], + } + + layoutOptions2: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 7], + onGetIrregularSizeByIndex: (index: number) => { + if (index === 0) { + return [1, 5] + } + return [1, index % 6 + 1] + } + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions1) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll200') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.Off) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210.ets new file mode 100644 index 0000000000000000000000000000000000000000..b97822f134875370f39485e4fbedc9a8c97c0e98 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll210 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll210') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b73895327e9c374a8e78e14ab0dc563a66c934e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll240 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll240') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .enableScrollInteraction(false) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250.ets new file mode 100644 index 0000000000000000000000000000000000000000..2be1de83506a903959e9b020b39505c4466e5c9f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll250 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll250') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: true }) + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260.ets new file mode 100644 index 0000000000000000000000000000000000000000..1018e42a50c4b157157c12d9f285b6065b417e7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll260 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll260') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: false }) + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270.ets new file mode 100644 index 0000000000000000000000000000000000000000..97b043253d8f8e3ab11433913c32e65417a401b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll270 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll270') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, true, ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280.ets new file mode 100644 index 0000000000000000000000000000000000000000..878fb201d3e9146226739348221d91233e940f43 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll280 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll280') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290.ets new file mode 100644 index 0000000000000000000000000000000000000000..c4c02fa7bccbbcc587aec8dd3d3005cb45f7a48f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll290 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll290') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0, 150); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30.ets new file mode 100644 index 0000000000000000000000000000000000000000..5da824bd70d2530046a037d09bd5b6604324e804 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll30 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll30') + .scrollBar(BarState.On) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300.ets new file mode 100644 index 0000000000000000000000000000000000000000..7662a6dc29fb7d243d08d83ba687a1cebf74c65a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll300 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll300') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310.ets new file mode 100644 index 0000000000000000000000000000000000000000..d58b7e10af9bbee3d0ad3988cbe33a0c71875294 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll310 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll310') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.End); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8bff6837b331fe0c531b70f6812dddefe6b3459 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll330 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll330') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.numbers.push('5') + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.numbers.push('6') + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1091658e04083872e2f2e78e9a8835c9f9335bf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll340 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll340') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b5887806bb078de02fd9b69c212ead16c98ea75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll350 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + Scroll(){ + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll350') + .scrollBar(BarState.On) + .friction(0.6) + .divider({strokeWidth: 2,color: 0xFFFFFF,startMargin: 20,endMargin: 20}) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + } + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce5dd9879848b6c3a34bf393fc1482f4b77bbe8f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll360 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll360') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b90842997379f04e86a05c1aad86d80a235cbc3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +// xxx.ets +import { curves } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll380 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll380') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390.ets new file mode 100644 index 0000000000000000000000000000000000000000..f51a82469127334b033c837f1e8a8be55bd934e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll390 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll390') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: true }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400.ets new file mode 100644 index 0000000000000000000000000000000000000000..cf960788735ca5e64100b61634184c15c4659fa2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll400 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll400') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: false }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410.ets new file mode 100644 index 0000000000000000000000000000000000000000..0be69908697943d5b8b427d4356724af00e0a740 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 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. + */ +// xxx.ets +import { curves } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll410 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('button') + .id('UIComponentListandgridXommonOnscroll410') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0, 150); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420.ets new file mode 100644 index 0000000000000000000000000000000000000000..6873d34c9cf445d4a655c45ff018a9c05520b137 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll420 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('button') + .id('UIComponentListandgridXommonOnscroll420') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true });; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d2ccec9a31cf50c8f12a4c84fd6e63fd92242b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll430 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('button') + .id('UIComponentListandgridXommonOnscroll430') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom, { velocity: 700 }); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450.ets new file mode 100644 index 0000000000000000000000000000000000000000..a06c43e54e5498513ea80f43318705a9d1d874b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll450 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll450') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .edgeEffect(EdgeEffect.Spring) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + this.arr.push(10); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + this.arr.push(11); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460.ets new file mode 100644 index 0000000000000000000000000000000000000000..823e87aae500ca4a9516c5524ab65ff124546811 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll460 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll460') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .edgeEffect(EdgeEffect.Spring) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6860d415149aa0d5dcd36024b4578a6aa7af064 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll470 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll470') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500.ets new file mode 100644 index 0000000000000000000000000000000000000000..e4b2b31f3eb2aa0ba365542550f0b7a591f5cd72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll500 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll500') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .enableScrollInteraction(false) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll500_button') + .height('5%') + .onClick(() => { + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510.ets new file mode 100644 index 0000000000000000000000000000000000000000..ae043844ad6ae33ed8f0b1503d8c7faa11efa4fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll510 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll510') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: true }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520.ets new file mode 100644 index 0000000000000000000000000000000000000000..9aa0d793deaabe7d23262a85884a26ef54c90e6a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll520 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll520') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: false }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530.ets new file mode 100644 index 0000000000000000000000000000000000000000..45d46a139369d69d09c253432322d3a319ef9964 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll530 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll530') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(10,true,ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540.ets new file mode 100644 index 0000000000000000000000000000000000000000..253483aa9349a2668c8ff0d8d16968ed104ae4ec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll540 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll540') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(10,false,ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550.ets new file mode 100644 index 0000000000000000000000000000000000000000..4afca785ba1164ed27a962187f27b8331eafcdef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll550 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll550') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0,150); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560.ets new file mode 100644 index 0000000000000000000000000000000000000000..05a0cc03b3d1074924471deb1e37f97570429416 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll560 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll560') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570.ets new file mode 100644 index 0000000000000000000000000000000000000000..5cd0dfc84adffbb3c853b9dc5f77726739010b3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll570 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll570') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590.ets new file mode 100644 index 0000000000000000000000000000000000000000..724b91bab47e0b49fde5e3a03a355bc33f7d157f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll590 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll590') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + this.dataSource.deleteItem(19); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + this.dataSource.deleteItem(18); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60.ets new file mode 100644 index 0000000000000000000000000000000000000000..003e48f72f69704bf922490ffa7e8a811b7f95db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll60 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll60') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .chainAnimation(true) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600.ets new file mode 100644 index 0000000000000000000000000000000000000000..65a0438c6c1af278aecf55d6ff599ee41ce457cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll600 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll600') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610.ets new file mode 100644 index 0000000000000000000000000000000000000000..7922af91fe881fcba96bfbf49a529548ad69640a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll610 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State txt1:string = '' + @State txt2:string = '' + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column({space: 10}){ + Text(this.txt1).fontSize(20).margin(10) + Text(this.txt2).fontSize(20).margin(10) + } + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('scroll') + .height(400) + .scrollable(ScrollDirection.Vertical) // 滚动方向纵向 + .scrollBar(BarState.On) // 滚动条常驻显示 + .scrollBarColor(Color.Gray) // 滚动条颜色 + .scrollBarWidth(10) // 滚动条宽度 + .friction(0.6) + .edgeEffect(EdgeEffect.None) + .onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + console.info('+++++onWillScroll'+yOffset+' ' +xOffset) + console.info(xOffset + ' ' + yOffset) + this.txt1 = xOffset.toString() + }) + .onDidScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + console.info('+++++onDidScroll' + yOffset+' ' +xOffset) + this.txt2 = xOffset.toString() + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70.ets new file mode 100644 index 0000000000000000000000000000000000000000..aadd959eb24073e21882ac2d1ddf0ccd7f103b61 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll70 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll70') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .lanes(this.lan) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80.ets new file mode 100644 index 0000000000000000000000000000000000000000..92699964858d363a99c44884b62b3ff0e6d9382c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll80 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll80') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .enableScrollInteraction(false) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a683b944e9edc0d200dc98aadae1afe926a9754 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll90 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll90') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } }) + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/WaterFlowDataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e558f9a5defe259dd08942c83aade7e95b477ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..293b925976f2c12b2f7d301dde5f1834c35a15fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListAndGridXommonReport0110 { + private data: number[] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25] + scroller: Scroller = new Scroller(); + private irregularData: number[] = []; + @State index : number = 2; + @State itemIndex: number = 0; + @State message: ScrollState = 0; + + layoutOptions: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: this.irregularData, + }; + + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions) { + ForEach(this.data, (item: number, index: number) => { + GridItem() { + Text(item.toString()) + }.columnEnd(2) + }, (item: string) => item) + }.onScroll((scrollOffset: number, scrollState: ScrollState) => { + if (scrollState == ScrollState.Idle) { + this.message = ScrollState.Idle + this.scroller.scrollTo({xOffset:0, yOffset:10}) + } + }) + .columnsTemplate('1fr lfr 2fr') + .columnsGap(10) + .width('90%') + .height('50%') + Row() { + Text(this.message == ScrollState.Idle? " ScrollState.Idle" : "") + Button('click').width(100).padding(5).onClick(() => { + this.scroller.scrollTo({xOffset:0, yOffset:500}) + }).margin(5).id('Button_click') + }.height("15%") + }.width('100%') + .margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..74693af5a505ea03f669cb9d2a05d59658e33c25 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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 ArrayList from '@ohos.util.ArrayList'; + + +@Entry +@Component +struct UIComponentListandgridXommonReport0120 { + private data: number[] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25] + scroller: Scroller = new Scroller(); + private irregularData: number[] = []; + @State index : number = 2; + @State itemIndex: number = 0; + @State message: ScrollState = ScrollState.Fling; + + layoutOptions: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: this.irregularData, + }; + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions) { + ForEach(this.data, (item: number, index: number) => { + GridItem() { + Text(item.toString()) + }.columnEnd(2) + }, (item: string) => item) + }.onScroll((scrollOffset: number, scrollState: ScrollState) => { + if (scrollState == ScrollState.Fling) { + this.message = ScrollState.Fling + this.scroller.scrollTo({xOffset:0, yOffset:10}) + } + }) + .columnsTemplate('1fr lfr 2fr') + .columnsGap(10) + .width('90%') + .height('50%') + Row() { + Text(this.message == ScrollState.Fling? " ScrollState.Fling" : "ss") + }.height("15%") + }.width('100%') + .margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..f90f5d9839fb1b0c9a5cc12386a51c35599ecb49 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0130 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0130_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0130_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..7568bb92d18f8aaca1987ad2ae0b655ac005a9ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0140 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0140_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0140_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..37a66ba93aeba6eda4e70e06c76a51b5187e0312 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0150 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0150_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0150_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..11948c4d7ff5083edb628996f864bd6994bae5a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0160 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0160_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0160_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..509e9efc0539632cbc61d005346a3765560bcdb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0170 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0170_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0170_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..40e56b176f82850a2813c44e8cdc955974846af9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0180 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0180_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 600 + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0180_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7a7f49de19cf6f49b2fb2757c27dcc2378c7de9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0190 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0190_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0190_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .chainAnimation(true) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..ef796a34a33e3b6a2954da9b11c9778b116f1b5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0200 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0200_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0200_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..ea9b3275b3102d3a68b22af7d4b327fddce2a1b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0210 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0210_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0210_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..29587806d94d9e206eaeea4b3cba2603a6e10f84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0220 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0220_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0220_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((state: ScrollState) => { + this.scrollState = state; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..f28cc2fcbd78c0800fe26bb34615d46bbc9296ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0230 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0230_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0230_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d7b77c717583cc806c43e7ba30ed4425c81367a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0240 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0240_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0240_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7b410767b924556d18dfa9daad2906ec9a217f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0250 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0250_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0250_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..e99cff4566e4f7c93bafd3a86a5c0ba2032873b2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0260 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0260_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0260_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .chainAnimation(true) + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..b5afa80c9541531a24639fcbe7a959f97131cb55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0270 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0270_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0270_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((state: ScrollState) => { + this.scrollState = state; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..1b673f1866bb03d8a2e8f4beec8126e58d3c1660 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0280 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0280_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0280_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((state: ScrollState) => { + this.scrollState = state; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..f54452af583667f62ade0ea5bc98dfdbcf8c26d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0290 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0290_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0290_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..65ce6a552a7372821f8932be66a3edcf243e0351 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0300 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0300_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0300_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..dfcf531c2b6f349522234e3221b7b520c3c80864 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0310 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0310_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0310_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..884421876679c435f6dee0d65f95fad0adf8a8d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0320 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0320_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 600, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0320_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d6f7b812411a6739ea4eca7e657fd5d6cd28e17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0330 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0330_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 600 + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0330_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..787b3c6c37e5a0139020b2e35f3e408b3bb61ba2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0340 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0340_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0340_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..73dd4433499adc77dbdb84cfebb29b4856275a89 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0350 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0350_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0350_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b51be4bdbfca0bf28ae9ca729ee8a9115aeba0c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10.ets @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport10 { + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + @State numbers: number[] = []; + @State translateY: number = 0; + @State Text: string = ''; + private scroller: Scroller = new Scroller(); + private gridScroller: Scroller = new Scroller(); + private touchDown: boolean = false; + private listTouchDown: boolean = false; + private scrolling: boolean = false; + + aboutToAppear() { + for (let i = 0; i < 100; i++) { + this.numbers.push(i) + } + } + + build() { + Stack() { + Column() { + Row() { + Text('Head') + } + + Column() { + List({ scroller: this.scroller }) { + ListItem() { + Grid() { + GridItem() { + Text('GoodsTypeList1') + } + .backgroundColor(this.colors[0]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList2') + } + .backgroundColor(this.colors[1]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList3') + } + .backgroundColor(this.colors[2]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList4') + } + .backgroundColor(this.colors[3]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList5') + } + .backgroundColor(this.colors[4]) + .columnStart(0) + .columnEnd(1) + } + .scrollBar(BarState.Off) + .columnsGap(15) + .rowsGap(10) + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsTemplate('1fr') + .width('100%') + .height(200) + } + + ListItem() { + Grid(this.gridScroller) { + ForEach(this.numbers, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + .width('100%') + .height(40) + .shadow({ radius: 10, color: '#909399', offsetX: 1, offsetY: 1 }) + .borderRadius(10) + .translate({ x: 0, y: this.translateY }) + }, (item: string) => item) + }.id('UIComponentListandgridXommonReport10') + .columnsTemplate('1fr 1fr') + .friction(0.3) + .columnsGap(15) + .rowsGap(10) + .scrollBar(BarState.Off) + .width('100%') + .height('100%') + .layoutDirection(GridDirection.Column) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.listTouchDown = true + } else if (event.type == TouchType.Up) { + this.listTouchDown = false + } + }) + } + } + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.None) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.touchDown = true + } else if (event.type == TouchType.Up) { + this.touchDown = false + } + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + if (this.scrolling && offset > 0) { + let newOffset = this.scroller.currentOffset().yOffset; + if (newOffset >= 590) { + this.gridScroller.scrollBy(0, offset); + return { offsetRemain: 0 }; + } else if (newOffset + offset > 590) { + this.gridScroller.scrollBy(0, newOffset + offset - 590); + return { offsetRemain: 590 - newOffset }; + } + } + this.Text ='ScrollState'+ state; + return { offsetRemain: offset } + }) + .onScrollStart(() => { + if (this.touchDown && !this.listTouchDown) { + this.scrolling = true + } + }) + .onScrollStop(() => { + this.scrolling = false + }) + Text(this.Text) + } + .width('100%') + .height('80%') + .padding({ left: 10, right: 10 }) + } + + Row() { + Text('Top') + .width(30) + .height(30) + .borderRadius(50) + } + .padding(5) + .borderRadius(50) + .backgroundColor('#ffffff') + .shadow({ radius: 10, color: '#909399', offsetX: 1, offsetY: 1 }) + .margin({ right: 22, bottom: 15 }) + .onClick(() => { + this.scroller.scrollTo({ xOffset: 0, yOffset: 0 }) + this.gridScroller.scrollTo({ xOffset: 0, yOffset: 0 }) + }) + } + .align(Alignment.BottomEnd) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ed9e42732a0132997745c0781dca8e607834082 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport100 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport100') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onScroll((offset: number, state: ScrollState) => { + if(state == 1){ + this.Text ='ScrollState:'+state; + } + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + Text(this.Text) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40.ets new file mode 100644 index 0000000000000000000000000000000000000000..266fc104659df23a31e6332d007a936713d26f20 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport40 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }).onScrollFrameBegin((offset: number, state: ScrollState) => { + this.Text ='ScrollState'+ state; + return { offsetRemain: offset }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + + Button('button') + .id('UIComponentListandgridXommonReport40') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50.ets new file mode 100644 index 0000000000000000000000000000000000000000..59a10fc00317650b85f104c146fa81de17548b5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport50 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }).onScrollFrameBegin((offset: number, state: ScrollState) => { + this.Text ='ScrollState'+ state; + return { offsetRemain: offset }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + + Button('button') + .id('UIComponentListandgridXommonReport50') + .onClick(() => { + this.scroller.scrollToIndex(5, true, ScrollAlign.START); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60.ets new file mode 100644 index 0000000000000000000000000000000000000000..c839a221230b3d424de6628ff331eeb18140a800 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport60 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport60') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }).onScrollFrameBegin((offset: number, state: ScrollState) => { + this.Text ='ScrollState'+ state; + return { offsetRemain: offset }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80.ets new file mode 100644 index 0000000000000000000000000000000000000000..a2e97950838300edcd63262298366cb4cf17d3d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport80 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport80') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onScroll((offset: number, state: ScrollState) => { + if(state == 1){ + this.Text ='ScrollState:'+state; + } + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + Text(this.Text) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90.ets new file mode 100644 index 0000000000000000000000000000000000000000..eeb6b9c75a87a5b824177fa2bb5eb8550efa286e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport90 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport90') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onScroll((offset: number, state: ScrollState) => { + if(state == 2){ + this.Text ='ScrollState:'+state; + } + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + Text(this.Text) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193.ets new file mode 100644 index 0000000000000000000000000000000000000000..b122c1b7a84407e2855e3c9689752555f937d6eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentListandgridXommonScrollto0110193 { + @State numbers: string[] = [] + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr ') + .height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(6) + .minCount(2) + .cellLength(0) + .layoutDirection(GridDirection.Row) + } + .width('90%').margin({ top: 5, left: '5%', right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822.ets new file mode 100644 index 0000000000000000000000000000000000000000..b132a46ef23ca1f11c766b1485ed71546f1e1424 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822.ets @@ -0,0 +1,65 @@ +/* + * + * * Copyright (C) 2024 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. + * + */ + +@Entry +@Component +struct UIComponentListandgridXommonScrollto0250_822 { + @State numbers: String[] = [] + @State text: String[] = [] + scroller: Scroller = new Scroller() + + aboutToAppear(): void { + for (let i = 0; i < 50; i++) { + this.numbers.push(i + '') + } + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + } + .id('0') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .backgroundColor(0xFAEEE0) + .height('60%') + .onReachStart(() => { + this.text.push('ReachStart') + }) + .onReachEnd(() => { + this.text.push('ReachEnd') + }) + + Text(`触顶/底回调:${this.text}`) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273.ets new file mode 100644 index 0000000000000000000000000000000000000000..edbd7bb9326672bf063b1a63d9b2fe8d8e90cd57 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 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 { GridModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto0260273 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State yOffset: number = 800 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('Button1') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollTo({ + xOffset: 0, + yOffset: this.yOffset + 350, + animation: { duration: 500, canOverScroll: true } + }) + }).id('btn1') + Button('Button') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollTo({ + xOffset: 0, + yOffset: 0 + }) + }).id('btn') + Button('Button2') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollTo({ + xOffset: 0, + yOffset: this.yOffset + 650, + animation: { duration: 500, canOverScroll: true } }) + }).id('btn2') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230.ets new file mode 100644 index 0000000000000000000000000000000000000000..077e6064e37545c1e717a049d954948a921081bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto230 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State heigh :number = 300; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(this.heigh) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto230") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370.ets new file mode 100644 index 0000000000000000000000000000000000000000..f02fb924c9ed757058a440ba2659249892b38c1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto370 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State heigh: number = 300; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(this.heigh) + .edgeEffect(EdgeEffect.Spring) + Button('Button') + .id("UIComponentListandgridXommonScrollto370") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510.ets new file mode 100644 index 0000000000000000000000000000000000000000..670d14f51678a1bd62c3c9d62514e0460a0b1b2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto510 { + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State heigh: number = 300; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(this.heigh) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + Button('Button') + .id("UIComponentListandgridXommonScrollto510") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570.ets new file mode 100644 index 0000000000000000000000000000000000000000..83768853588bfa278e2d9e2811e0ac5094379486 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto570 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.arr.push(12); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto570") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580.ets new file mode 100644 index 0000000000000000000000000000000000000000..097abd4714dd22addfcbdb242461bfe17a3be595 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto580 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { + this.arr.push(11); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto580") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a8d606832f5b7d3678469795398a765246b911a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto590 { + scroller: Scroller = new Scroller(); + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(300) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + .onReachStart(() => {this.arr.push(10,11)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto590") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600.ets new file mode 100644 index 0000000000000000000000000000000000000000..83c08ec471bfd280c07ed4169b7767a16a872077 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto600 { + scroller: Scroller = new Scroller(); + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(300) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + .onReachEnd(() => {this.arr.push(10,11)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto600") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610.ets new file mode 100644 index 0000000000000000000000000000000000000000..337fda0d2caa5a417b09a41f59f172689ca981ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto610 { + scroller: Scroller = new Scroller(); + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(300) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + return { offsetRemain: offset } + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto610") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620.ets new file mode 100644 index 0000000000000000000000000000000000000000..f467b5fca4ae283e762f47f07ef24fb742843e21 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto620 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScrollStart(() => { + this.arr.push(11); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto620") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630.ets new file mode 100644 index 0000000000000000000000000000000000000000..112f9786ca40bb48043156c918cb0cf8b37ea078 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto630 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScrollStop(() => { + this.arr.push(12); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto630") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640.ets new file mode 100644 index 0000000000000000000000000000000000000000..dac89edcef3953de3ea055a1a139ab17f855bca1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto640 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScroll((scrollOffset: number, scrollState: ScrollState) => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto640") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650.ets new file mode 100644 index 0000000000000000000000000000000000000000..776405b486bdbab568db8198eb2821a145c4f829 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto650 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScrollIndex((firstIndex: number, lastIndex: number) => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto650") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8f55b8813bd2922e420d4768527306cc71fbcbf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto660 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onReachStart(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto660") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a0dcd0d38504f1473b8e4d71815dd034b025232 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto670 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onReachEnd(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto670") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680.ets new file mode 100644 index 0000000000000000000000000000000000000000..3774b1e566af2703817de83e317dcc7d1682b116 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto680 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onReachStart(() => {this.dataSource.deleteItem(20)}) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + return { offsetRemain: offset } + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto680") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690.ets new file mode 100644 index 0000000000000000000000000000000000000000..f554a7428adf6699bc6729c4a82cb91f263e926b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto690 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScrollStart(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto690") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700.ets new file mode 100644 index 0000000000000000000000000000000000000000..428a71c5b00702f752d8caaaa4122d72554a5457 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto700 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScrollStop(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto700") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f71ac9192df203cba0e231a7a3940c38aedfdb5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto90 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + scroller: Scroller = new Scroller(); + @State heigh :number = 300; + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(this.heigh) + Button('Button') + .id("UIComponentListandgridXommonScrollto90") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/WaterFlowDataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..4e558f9a5defe259dd08942c83aade7e95b477ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..59006cf0d1db6e2a46fbbd86963cb4f64cd22444 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0050 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0050') + .onClick(() => { + this.scroller.scrollToIndex(-1, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4a8562e23100dc9f10a80dfddf672879534ff6d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0060 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0060') + .onClick(() => { + this.scroller.scrollToIndex(0, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..b45969455a38ab69a404fb65814af836cf730dcc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0070 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0070') + .onClick(() => { + this.scroller.scrollToIndex(13, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c928ea19e7534b0a3c6370b4be6ce05eba2adb7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0080 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0080') + .onClick(() => { + this.scroller.scrollToIndex(30, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857.ets new file mode 100644 index 0000000000000000000000000000000000000000..467120523d0ed0988dbdbaf8a3317225bf8a5e92 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0100857 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonSmooth0100857') + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('下滑100vp') + .id('UIComponentListandgridXommonSmooth0100857_001') + .onClick(() => { + this.scroller.scrollBy(0, 100) + }) + Button('滚动到指定位置') + .id('UIComponentListandgridXommonSmooth0100857_002') + .onClick(() => { + this.scroller.scrollToIndex(5) + }) + }.width('100%').margin({ top: 5 }) + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..5c8cbeb2fe2c6b35d4008be483168808261ceb56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0110 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .onClick(() => { + this.scroller.scrollToIndex(24, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b08a69bb59501c4c82936418711a6c80424b156 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0110629 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonSmooth0110629') + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('下滑100vp') + .id('UIComponentListandgridXommonSmooth0110629_001') + .onClick(() => { + this.scroller.scrollBy(0, 100) + }) + Button('滚动到指定位置') + .id('UIComponentListandgridXommonSmooth0110629_002') + .onClick(() => { + this.scroller.scrollToIndex(5) + }) + }.width('100%').margin({ top: 5 }) + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..55bde0ddbbba04927b5fdc514afce4ec2b072818 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170.ets @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0170 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0170') + .onClick(() => { + this.scroller.scrollToIndex(-1, false,); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a5ac2f020a267c00c7969d73800f7f7fba1fac0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0180 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0180') + .onClick(() => { + this.scroller.scrollToIndex(0, false); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..4ef19d8c6e14d2adc28b8d35d197c012ea7ad439 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0190 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0190') + .onClick(() => { + this.scroller.scrollToIndex(4, false,); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f3908edb8a6b8d168794f0e29bc0448bcab5797 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0200 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0200') + .onClick(() => { + this.scroller.scrollToIndex(100, false,); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..1220083e4be6dbc525c195603a71cea8dd585c85 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0210 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0210') + .onClick(() => { + this.scroller.scrollToIndex(5); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..66ba02e53b9a43cae129ad8ae27f2e72275bf635 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0220 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0220') + .onClick(() => { + this.scroller.scrollToIndex(5,true,ScrollAlign.END); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/WaterFlowDataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..60644b7d88fa8851f1a7695ded264907b0f41eff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385.ets new file mode 100644 index 0000000000000000000000000000000000000000..1139e3e915ed5f086943788bb8c6f1d6377ec2df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0210137385 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo2); + Text(this.msgInfo1); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = '2.trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = '1.trigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + .id('UIComponentListandgridXonhofOnscroll0210137385'); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0210137385_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3058cf015a0747f2bd23b9040dac40f95ccc758 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0220134528 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo2); + Text(this.msgInfo1); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = '2.trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = '1.trigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + .id('UIComponentListandgridXonhofOnscroll0220134528'); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0220134528_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ea72cc64c92996679cdf90a28d9a3f61ee196e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0230457155 { + private scroller: Scroller = new Scroller() + @State numbers: String[] = ['0', '1', '2', '3'] + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + build() { + Column() { + Text(this.msgInfo1); + Text(this.msgInfo2); + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + } + .width('90%') + .scrollBar(BarState.On) + .scrollable(ScrollDirection.Vertical) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = 'trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = 'trigger onWillScroll' + }) + .id('UIComponentListandgridXonhofOnscroll0230457155'); + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) { + Text() + .width(40) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0').id('BarText').id('UIComponentListandgridXonhofOnscroll0230457155_001'); + }.width(40).backgroundColor('#ededed'); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784.ets new file mode 100644 index 0000000000000000000000000000000000000000..164cc7cb8e5ae4e841ef4f52dc37d075ffc3477b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784.ets @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2024 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 { uiObserver as observer } from '@kit.ArkUI'; +import screen from '@ohos.screenshot'; +import { common } from '@kit.AbilityKit'; +import { mediaquery, window } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0320784 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State msgInfo: string = 'inital value'; + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + + build() { + Column({ space: 5 }) { + Text(this.msgInfo); + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0320784_001'); + + Button('Landscape') + .onClick(() => { + this.changeOrientation(true); + }).id('UIComponentListandgridXonhofOnscroll0320784_002'); + Button('Portrait') + .onClick(() => { + this.changeOrientation(false); + }).id('UIComponentListandgridXonhofOnscroll0320784_003'); + + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + console.info('trigger onDidScroll') + this.msgInfo = this.msgInfo+'\ntrigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + console.info('trigger onWillScroll') + this.msgInfo = this.msgInfo+'\ntrigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685.ets new file mode 100644 index 0000000000000000000000000000000000000000..5631260449cf553b8854cd97bfdc66c5f7543fbc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0340685 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo1); + Text(this.msgInfo2); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = 'trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = 'trigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + .id('UIComponentListandgridXonhofOnscroll0340685'); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0340685_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..03a1b9af807d6f808be48967502360b4cf183552 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030.ets @@ -0,0 +1,51 @@ +@Entry +@Component +struct UIComponentOtherAlphabetindexerArrayvalue0030 { + @State value: string[] = ['#', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100.ets new file mode 100644 index 0000000000000000000000000000000000000000..be83b0e53c9964ec1847e583dc0796d4b320bb33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 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 { Font } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface100 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .font(undefined) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120.ets new file mode 100644 index 0000000000000000000000000000000000000000..f5fde31c3f43e5f23d8008751e95dc93f5a7f38d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface120 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(undefined) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160.ets new file mode 100644 index 0000000000000000000000000000000000000000..a2047bf3c40b97eea12ecdd78d4cafe47b2e253f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface160 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface160') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(undefined) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220.ets new file mode 100644 index 0000000000000000000000000000000000000000..42b0d41c68c341f8a6190ef4ea1684700ab5dabb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface220 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface220') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(undefined) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270.ets new file mode 100644 index 0000000000000000000000000000000000000000..0d9f09f1176091f1733da98c29d304b71e31c6c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface270 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface270') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont(undefined) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc13ea875d3a84b724ab89b3d4f1c34f31117ee7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface280 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface280') + .autoCollapse(true) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupPosition({x:50.0,y:50.0}) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a3c6694aea96a6010fcc6153ff68f6094cbd781 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(undefined) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320.ets new file mode 100644 index 0000000000000000000000000000000000000000..db6e801b5ec773b84e700785b926bec80db16b31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface320 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface320') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .selected(undefined) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad5ba57a249ecc7404fe5d24f94d28bc8e2faede --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface350 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface350') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410.ets new file mode 100644 index 0000000000000000000000000000000000000000..355eac8a8d5d6cd536ab458caa410329f5b7c472 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface410 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface410') + .color(undefined) + .autoCollapse(false) + .selectedColor(undefined) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb4f250206b445f5d499bb8a58f35db4efd093f8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface460 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface460') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont(undefined) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50.ets new file mode 100644 index 0000000000000000000000000000000000000000..11803172d13c26e226fe1d5c321c7892f771d6f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface50') + .color(undefined) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510.ets new file mode 100644 index 0000000000000000000000000000000000000000..29f8ebf2fee424cc345f3ec05600b38ec07e57d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface510 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface510') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(undefined) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b88951c57780805f8c27c4bbd7b9be693999042 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0060 { + @State value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .popupItemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f05b0b1417091e133c1af996f7ddb8b8b680288 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0070 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .popupItemBorderRadius(undefined) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..bf9c5be761c2c578a18d1208af4acc02503fa75a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0160 { + @State value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1ea39e36e366148e1a3df9a68ed749199cb4ec9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0170 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(undefined) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..0c7bbf028042e3bee5b254416cc165e545d8762d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0340 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .popupBackgroundBlurStyle(null) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..7b1da1bf4e87f2e845b5eb6612fae34eaa100886 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0350 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..96eb7a131c1d6713beaa806d866a35a27af78a2f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0360 { + @State selectedFontValue: Font = { size: 16, weight: FontWeight.Bolder }; + @State popupBackgroundBlurStyleValue: BlurStyle = BlurStyle.COMPONENT_REGULAR; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + @State ButtonValue: string = "modification"; + + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 1 }) + .id('AlphabetIndexerFlag') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont(this.selectedFontValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(4) + .popupBackgroundBlurStyle(this.popupBackgroundBlurStyleValue) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("BACKGROUND_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.BACKGROUND_THICK + }).id("btn01") + } + ListItem() { + Button("BACKGROUND_THIN").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.BACKGROUND_THIN + }).id("btn02") + } + ListItem() { + Button("BACKGROUND_ULTRA_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.BACKGROUND_ULTRA_THICK + }).id("btn03") + } + ListItem() { + Button("COMPONENT_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_THICK + }).id("btn04") + } + ListItem() { + Button("COMPONENT_THIN").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_THIN + }).id("btn05") + } + ListItem() { + Button("COMPONENT_ULTRA_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_ULTRA_THICK + }).id("btn06") + } + ListItem() { + Button("COMPONENT_ULTRA_THIN").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_ULTRA_THIN + }).id("btn07") + } + ListItem() { + Button("NONE").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.NONE + }).id("btn08") + } + ListItem() { + Button("Thick").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.Thick + }).id("btn09") + } + ListItem() { + Button("Thin").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.Thin + }).id("btn10") + } + }.margin(100) + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d7ac5f3e1f08c2e6c75d7cd2afa491d492b6907 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0370 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..229f5c766493e1f5e30d86242ebf616cd82414ad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0400 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed193421471cecb6bd0db2689a164eaea54919da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10.ets @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface10 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ ]; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface10') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20.ets new file mode 100644 index 0000000000000000000000000000000000000000..09ead909d7b926f7ff666cfcd0653558b53dcf83 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e5cd6db9a6134c472deeffcc7350e91e743bf7b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: -2 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50.ets new file mode 100644 index 0000000000000000000000000000000000000000..42bcdcff458bc04d965b04fdc880b261d726a6ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue:['A', 'B', 'C', 'D', 'E', 'F', 'G'], selected: 20 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60.ets new file mode 100644 index 0000000000000000000000000000000000000000..775e1dd763c4140638b84d1f7af57773fce9b168 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer60 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .selected(-3) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e4b91103097d83fc806c06a77dbe8e46a1f8d6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer70 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue:['A', 'B', 'C', 'D', 'E', 'F', 'G'], selected: 7 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..14a608cbd34f2143dbd2bef2f5b6927ebae81837 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth0190 { + @State value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .width(Infinity) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(0xff0000) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e1e2d25ad13a11362260ac655579a37669c8604 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth0260 { + @State value: string[] = ['#', 'A', 'BBBBBBBBBBB', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .width(80) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(0xff0000) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270.ets new file mode 100644 index 0000000000000000000000000000000000000000..668beb0cdc8eac92f7b5b7ba31435144734d4e51 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth270 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface270') + .autoCollapse(true) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .popupBackground(0xD2B48C) + .font({size:'10.0vp',style:FontStyle.Normal,weight:FontWeight.Medium,family:'HarmonyOS Sans'}) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280.ets new file mode 100644 index 0000000000000000000000000000000000000000..24dcada82ed3c965c66019888ea651dfa9a08dd0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth280 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerWidth280') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupPosition(undefined) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290.ets new file mode 100644 index 0000000000000000000000000000000000000000..e10a6914b39c2cc38b8a44b348203b77acc61c02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth290 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface290') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(false) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ed0648b319599fbcca6a3639a21d6f7b1a2ea14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth300 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface300') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8f386efddd5a6d2c5fd134428bf61b45649c6dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherListPerformance0030 { + @State arr: number[] = []; + @State flag: boolean = true; + + aboutToAppear() { + for (let i = 0; i < 6; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Column({ space: 10 }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(150).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Gray) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: Color.Red, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .id('ScrollLog_001') + .height(500) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..90e2f77ce274136911e8636fbd0c3d3a6ca0c451 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentOtherListPerformance0040 { + @State numbers1: String[] = ['0', '1', '2', '3', '4'] + @State numbers2: String[] = ['0', '1','2','3','4','5'] + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + + Grid(undefined, this.layoutOptions3) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height("100%") + .textAlign(TextAlign.Center) + } + .height("100%") + .width('100%') + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10.ets new file mode 100644 index 0000000000000000000000000000000000000000..182fab6eaebc9f17d3b5c68ab51a397fff163dcb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier10 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢'] + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier10') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100.ets new file mode 100644 index 0000000000000000000000000000000000000000..9634ecf5565968b5332e0bf85a85d93ac3a09aa4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier100 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060.ets new file mode 100644 index 0000000000000000000000000000000000000000..2df6525166669363fff0833d970f722498450e3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1060 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1060') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.None) + .enablePaging(false) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070.ets new file mode 100644 index 0000000000000000000000000000000000000000..113268940df24ea921a105280aa01e4fb6bb5c38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1070 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1070') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.None) + .enablePaging(true) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120.ets new file mode 100644 index 0000000000000000000000000000000000000000..35844f71a48ddf25b8f09f9cbce6a9b7ce4a8241 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1120 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1120') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(-66) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130.ets new file mode 100644 index 0000000000000000000000000000000000000000..ccf8c4245f64a6c04908f4e503e43448f16d3c43 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1130 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1130') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140.ets new file mode 100644 index 0000000000000000000000000000000000000000..397282d339314bb5dd5c53066937fb239e114aec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1140 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + + .id('UIComponentScrollAlphabetindexermodifier1140') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(1) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150.ets new file mode 100644 index 0000000000000000000000000000000000000000..029fcfc65cc4f6428df3e690b809ec0ecd2e4ca6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1150 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1150') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(100) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160.ets new file mode 100644 index 0000000000000000000000000000000000000000..b80baef4726f89b5c6cba54758b9dd3e429f6250 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1160 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1160') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(undefined) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550.ets new file mode 100644 index 0000000000000000000000000000000000000000..f85313e190aa8dd0a59f59ee451dab0f4f8c8274 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 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 { InputMethodListDialog } from '@ohos.inputMethodList'; + +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1550 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentScrollAlphabetindexermodifier1550') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.CENTER, snapPagination:150}) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbd763ed381693cf084519ac170efda75c2988ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1560 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentScrollAlphabetindexermodifier1560') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.NONE, snapPagination:[30,60,90,120],enableSnapToEnd:false }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620.ets new file mode 100644 index 0000000000000000000000000000000000000000..d8f86bce0cd75016cf39590fd501d2ff719943c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1620 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentScrollAlphabetindexermodifier1620') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.NONE, snapPagination:[30,60,90,120],enableSnapToEnd:true }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7bc4d53c8aa34c659c8f16911103d134be436be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1630 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.NONE, snapPagination:[30,60,90,120],enableSnapToEnd:true }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640.ets new file mode 100644 index 0000000000000000000000000000000000000000..ec7fec61dd3741e5760b38a8845ed7390cfa0fc6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1640 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier1640') + .autoCollapse(false) + .selectedColor(Color.Yellow) + .selectedColor(Color.Blue) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650.ets new file mode 100644 index 0000000000000000000000000000000000000000..afc1da0004460d2853ceba8083a2bb1e5d187795 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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 { AlphabetIndexerModifier, GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1650 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + @State modifier1: AlphabetIndexerModifier = new AlphabetIndexerModifier().selectedColor(Color.Yellow); + @State modifier2: AlphabetIndexerModifier = new AlphabetIndexerModifier().itemSize(-2); + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier1650') + .autoCollapse(false) + .selectedColor(Color.Yellow) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(-2) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupItemBackgroundColor(undefined) + .attributeModifier(this.modifier1) + .attributeModifier(this.modifier2) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fd5d165e6f1c472596fe7eec242e131b7b314f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"1%") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f70e2ccfe0acc3365fdeaccbd98c745852050bf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier290 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier290') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground('app.color.green') + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1dcdddeb7a44be5376d514bbad50cade5f0e873 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier30') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"10fp") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300.ets new file mode 100644 index 0000000000000000000000000000000000000000..79c178ca95a1bb6e7bbcf51043f32c7fa9d0074e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier300 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier300') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(-123) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310.ets new file mode 100644 index 0000000000000000000000000000000000000000..43b3d4c6f1563e6394eb4703e081d5675e3998c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier310 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier310') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xaabbcc) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320.ets new file mode 100644 index 0000000000000000000000000000000000000000..d7cd51265be5a69a945d9f55dbb793e55b01101a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier320 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier320') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Yellow) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330.ets new file mode 100644 index 0000000000000000000000000000000000000000..05386b00a5b1455b04a5e1e0f5a40a1b3bc08d62 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier330 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier330') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground('rgb(255,100,255)') + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340.ets new file mode 100644 index 0000000000000000000000000000000000000000..5e92f05e6da36df92efba8c47c9c73dc9b30e1ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier340 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier340') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + // .popupColor($r("app.color.green")) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc49e0226963ebcaa617a11f7908e24cc6afc59a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier350 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier350') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(-123) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360.ets new file mode 100644 index 0000000000000000000000000000000000000000..f45f56753241c89c2b26cf6d7bb7fddbde3d289b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier360 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier360') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xaabbcc) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d23cb009f162881d2ecd12174e703f986c2d492 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier370 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier370') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(Color.Yellow) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce405aad76a1989351ea33b186ac1d75c5b833de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier380 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier380') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8efb83463bc57f1f10025943c49d8c15443220c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier390 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier390') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:-20,weight:400,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40.ets new file mode 100644 index 0000000000000000000000000000000000000000..c43467877c199b17ccf7be5e950f318ade5a5180 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier40 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier40') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"101px") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return [] ; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400.ets new file mode 100644 index 0000000000000000000000000000000000000000..d6afed3464ba4a522f3df3af54b61a3d3c391e66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier400 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier400') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:-8,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410.ets new file mode 100644 index 0000000000000000000000000000000000000000..393b6512e86665fd0a37b0c6e26799a4795700ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier410 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier410') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:10,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420.ets new file mode 100644 index 0000000000000000000000000000000000000000..50732ee127a77967df5a6d831abb32e10919b2e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier420 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier420') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:400,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430.ets new file mode 100644 index 0000000000000000000000000000000000000000..96824166f05ff0c5301ed696b837bc85e52ede76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier430 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier430') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:500,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440.ets new file mode 100644 index 0000000000000000000000000000000000000000..28ec7232cade891e848d8bfb8fb0c311aaac9f36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier440 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier440') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:20,weight:400,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450.ets new file mode 100644 index 0000000000000000000000000000000000000000..5feb8bd43d6e924d41cda8763d9b15d1138dc76b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier450 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier450') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:20,weight:400,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9633b09ccbc7f8f97161c0cef321ab756ea800b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier460 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier460') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(Color.Red) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470.ets new file mode 100644 index 0000000000000000000000000000000000000000..643bb23ee8196416cca17545711f64fae25794d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier470 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier470') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xffffff) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a3f1cdbafbdea0eb75b95852b2e8c30a04bc998 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier480 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier480') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + // .popupItemBackgroundColor($r("app.color.bule")) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490.ets new file mode 100644 index 0000000000000000000000000000000000000000..4994330bd964355f3532b6f88540d771b9f70028 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier490 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier490') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor('rgba(255,100,255,0.5)') + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50.ets new file mode 100644 index 0000000000000000000000000000000000000000..d0c5591eac9eb6bf9a334eac605d3f491f383061 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier50') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"10px") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500.ets new file mode 100644 index 0000000000000000000000000000000000000000..786cd84c71b18ce1f9937ca0b911889913557805 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier500 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier500') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510.ets new file mode 100644 index 0000000000000000000000000000000000000000..37e68956cc7bf42e918468caaf097533228e397e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier510 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier510') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:-20,weight:400,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520.ets new file mode 100644 index 0000000000000000000000000000000000000000..7f05a1a8a55abff36cb2fe7cf6b68ae55d958be0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier520 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier520') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:-8,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ffe7037173cdfb6a13a56de0fb80f05f5a406d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier530 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier530') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:10,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540.ets new file mode 100644 index 0000000000000000000000000000000000000000..3f340df56efada518f142b52d2ff909ef64267eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier540 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier540') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:400,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550.ets new file mode 100644 index 0000000000000000000000000000000000000000..994f23052c907a2de0c1af8282a54bac11dd50ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier550 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier550') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:500,family:"Harmony0S Sans",style:FontStyle.Italic }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560.ets new file mode 100644 index 0000000000000000000000000000000000000000..1f0d26a7aa8fc56ebb4522526e5464943ed755dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier560 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier560') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:20,weight:400,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbaedd728168053c754df09b7463e19ae26b2008 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier570 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier570') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + // .popupItemFont({size:20,weight:500,family:$r("app.string.button_font_sans"),style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3dcbd812f106ef36384170381ccb56f0e2c0108 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier580 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier580') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition(undefined) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590.ets new file mode 100644 index 0000000000000000000000000000000000000000..c09dbe69736c2f90e6833d8f8ec88a981f68d107 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier590 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier590') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:-30, y:-20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60.ets new file mode 100644 index 0000000000000000000000000000000000000000..e06f8e2a15a3e43c374dc5194a4a0ef8ed05033b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier60 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier60') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600.ets new file mode 100644 index 0000000000000000000000000000000000000000..18b9e52c61d1a4735d543dd81dc8b338023f34dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier600 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier600') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:-30, y:20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610.ets new file mode 100644 index 0000000000000000000000000000000000000000..faccb713c19b6fff86ab57d5e6b8b38883a2f648 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier610 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier610') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:30, y:-20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620.ets new file mode 100644 index 0000000000000000000000000000000000000000..28b3b2be37385714410a4a95d64b29e8ca7b88e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier620 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier620') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:30, y:20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d2a005a4db97b816cbb57d228b95d9236c742c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630.ets @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier630 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier630') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor('rgb(255,100,255)') + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640.ets new file mode 100644 index 0000000000000000000000000000000000000000..a492564923647b94f2dfed56f7cadda1b9d11562 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier640 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier640') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + // .popupSelectedColor($r("app.color.green")) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650.ets new file mode 100644 index 0000000000000000000000000000000000000000..79abe791677f2f9e87080ae68cbeeff4c859e3c0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier650 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier650') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(-123) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660.ets new file mode 100644 index 0000000000000000000000000000000000000000..6252d5c760858806160a5ee4725d0848099fe8cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier660 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier660') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0xaabbcc) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670.ets new file mode 100644 index 0000000000000000000000000000000000000000..d091b15940ac19695247f22d47075378222adb1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier670 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier670') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680.ets new file mode 100644 index 0000000000000000000000000000000000000000..12cb9f03c7269922f2b96608c0e2aebbecd4628c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier680 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier680') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor('$r("app.color.green“)') + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690.ets new file mode 100644 index 0000000000000000000000000000000000000000..20f835bb98033b01a568abf25858ffb098ebd7d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier690 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier690') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(-123) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a09f75bd45bdc019e320ecbe94595a2f8e34913 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier70 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier70') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,-10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700.ets new file mode 100644 index 0000000000000000000000000000000000000000..edbffae9b7ad7c51508047b47ef8e152c75e0420 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier700 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier700') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(0xaabbcc) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710.ets new file mode 100644 index 0000000000000000000000000000000000000000..de671dc1b2fc7901bc9d669dc1b7f02999686af8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier710 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier710') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f6f81e609a1ae20d55e7866508d4fa9001e162d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier80 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier80') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90.ets new file mode 100644 index 0000000000000000000000000000000000000000..862cf2146c8da2ae4c8c6a439427a2891614899c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier90 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier90') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940.ets new file mode 100644 index 0000000000000000000000000000000000000000..17ef62d679d4e7e1c561b539d6d938181cbda0ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier940 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier940') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(false) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ad83cfe1c3cbf0e4eaaf8564356fa12ae4e2e2f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier950 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier950') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d3443b9c60471acd1ca5e54a38358117c0a3677 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier960 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier960') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(undefined) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..21aa3dc941685e931023a6475eca968beafcd777 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0230 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0230_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + Button('改变位置') + .id('UIComponentScrollScrollCetitemrect0230_002') + .onClick(() => { + this.gridPosition = 20 + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebd284f1e9fb64c957fddf64a25e5eb4c2b5cb5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0240 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0240_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + Button('改变位置') + .id('UIComponentScrollScrollCetitemrect0240_002') + .onClick(() => { + this.gridPosition = 20 + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..e93d264b96a963e11458b9f32894ba416b828e93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0270 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0270_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + Button('改变位置') + .id('UIComponentScrollScrollCetitemrect0270_002') + .onClick(() => { + this.gridPosition = 20 + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..04161bd4501adb56947c3935f3dbf969c462e8e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0290 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + .visibility(Visibility.Hidden) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0290_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10.ets new file mode 100644 index 0000000000000000000000000000000000000000..d1cbcd2d04bcd2b663a1f7d0a27b799867efe4da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra10 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra10') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100.ets new file mode 100644 index 0000000000000000000000000000000000000000..8099cf53467c46a2814e3777671a2d6a9ad8fcaf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra100 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .listDirection(Axis.Horizontal) + Button('Button') + .id('UIComponentScrollScrollExtra100') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.arr.unshift(this.arr[0]-1); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f12019e92dcfc876f3c66dede3c4d2e948707f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra110 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State heightValue: number = 100; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(this.heightValue) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra110') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.heightValue = this.heightValue+10; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120.ets new file mode 100644 index 0000000000000000000000000000000000000000..09540a94febbbe255e29e00c4a2ae1c5cfa3e75f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra120 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State widthtValue: number = 100; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthtValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra120') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.widthtValue = this.widthtValue+10; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130.ets new file mode 100644 index 0000000000000000000000000000000000000000..e010710af5fbffc5d6b5b7c827fd847390cc2df3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra130 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra130') + .onClick(() => { + this.scroller.scrollToIndex(20,true,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140.ets new file mode 100644 index 0000000000000000000000000000000000000000..94fd6e25849064461cf762bf8f8e537ccc771396 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra140 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra140') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150.ets new file mode 100644 index 0000000000000000000000000000000000000000..a2021f70f493b045d187a63fbf77b591669ab771 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra150 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra150') + .onClick(() => { + this.scroller.scrollToIndex(-1,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160.ets new file mode 100644 index 0000000000000000000000000000000000000000..6870663c74f0de820795074f5f1693b30f9c853f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra160 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra160') + .onClick(() => { + this.scroller.scrollToIndex(200,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170.ets new file mode 100644 index 0000000000000000000000000000000000000000..57c707b5dae261a1ade577dc14355576437c7c33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra170 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra170') + .onClick(() => { + this.scroller.scrollToIndex(undefined,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a8d204d215a2738af8e9ff89c1b73533407a82a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra180 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra180') + .onClick(() => { + this.scroller.scrollToIndex(null,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a1b94732cd7ae1be9e541689d67517f6c7ee1e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra190 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State SpaceValue: number = 2; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: this.SpaceValue, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra190') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + this.SpaceValue = this.SpaceValue + 10; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20.ets new file mode 100644 index 0000000000000000000000000000000000000000..e22fd790219ca2171c212ef19299efa4df75142e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +class ListandgridListAnimation016_DataSource implements IDataSource { + private list: number[] = []; + + constructor(list: number[]) { + this.list = list; + } + + totalCount(): number { + return this.list.length; + } + + getData(index: number): number { + return this.list[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentScrollScrollExtra20 { + @State arr: ListandgridListAnimation016_DataSource = new ListandgridListAnimation016_DataSource([]); + @State showList: number[] = []; + private scroller: Scroller = new Scroller(); + private isSmooth: boolean = true; + + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 30; i++) { + list.push(i); + } + this.arr = new ListandgridListAnimation016_DataSource(list); + } + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + LazyForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra20') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210.ets new file mode 100644 index 0000000000000000000000000000000000000000..918df61cf3c553b63ba0152dab531a71cb0d06af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra210 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra210') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(-5) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220.ets new file mode 100644 index 0000000000000000000000000000000000000000..a849794b4864e9a027f71c4ba2d54605db8b9058 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra220 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra220') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(2000) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230.ets new file mode 100644 index 0000000000000000000000000000000000000000..328dad9ddf32aee1a745117c1e3ab1d1fe9beb46 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra230 { + @State numbers: string= ('1fr 1fr 1fr 1fr'); + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State widthValue: number = 100; + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate(this.numbers) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra230') + .onClick(() => { + this.numbers = ('1fr 1fr 1fr'); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b7b11b929740f759df29a5b341e6f55d187c9b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra240 { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State layoutDirection : GridDirection = GridDirection.Row; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(100) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .layoutDirection(this.layoutDirection) + .maxCount(30) + .minCount(10) + .cellLength(100) + .columnsGap(10) + .rowsGap(10) + + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra240') + .onClick(() => { + this.scroller.scrollToIndex(10,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(5) }); + this.layoutDirection = GridDirection.Column; + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250.ets new file mode 100644 index 0000000000000000000000000000000000000000..44f4b2577e5b951a4be5136d3f95b33c2e7f1bc9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State widthValue: number = 100 + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra250') + .onClick(() => { + this.arr.unshift(this.arr[0]-1); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260.ets new file mode 100644 index 0000000000000000000000000000000000000000..10f593946fdaa161fb408c81530adf545b09cdb5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra260 { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State heightValue: number = 100; + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(this.heightValue) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('next page') + .id('UIComponentScrollScrollExtra260') + .onClick(() => { + this.heightValue = this.heightValue + 10; + + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e30907cbc02cc95563f9057cd1d498277b36c9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra0270 { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State widthValue: number = 100; + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('next page') + .id('UIComponentScrollScrollExtra270') + .onClick(() => { + this.widthValue = this.widthValue + 10; + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280.ets new file mode 100644 index 0000000000000000000000000000000000000000..66126ebd3eec209aeed6942b65b16e2bd520d47b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra280 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.CENTER); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra280') + .onClick(() => { + this.scroller.scrollToIndex(20,true,ScrollAlign.CENTER); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d545dfe8cf5147221d0458c9528c45c337b9076 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra290 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.CENTER); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra290') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30.ets new file mode 100644 index 0000000000000000000000000000000000000000..06d5f4ec4fbe34bed4f02077ef01f6ba07244f11 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra30 { + scroller: Scroller = new Scroller(); + private timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + }, + { + title: '星期二', + projects: ['物理', '化学', '生物'] + }, + { + title: '星期三', + projects: ['历史', '地理', '政治'] + }, + { + title: '星期四', + projects: ['美术', '音乐', '体育'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({ space: 20,scroller: this.scroller }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) + }) + } + .width('90%') + .sticky(StickyStyle.Header | StickyStyle.Footer) + .scrollBar(BarState.On) + Button('Button') + .id('UIComponentScrollScrollExtra30') + .onClick(() => { + this.scroller.scrollToIndex(2,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + + }) + }.width('100%').height('80%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310.ets new file mode 100644 index 0000000000000000000000000000000000000000..c2b2aa821434f4d942dacb952a6faf42405277f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra310 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra310') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(-5) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd85f6c99d45bf73c1434adbead9bcef20fe3844 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra320 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra320') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(2000) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330.ets new file mode 100644 index 0000000000000000000000000000000000000000..3aa98c9baeaa68d738431d362763ddb855c3608f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra330 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + layoutOptions1: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 6], + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions1) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.On) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340.ets new file mode 100644 index 0000000000000000000000000000000000000000..779e8a852dfa7e3e424445efd974c03e4b99b0b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340.ets @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0; + + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item); + }; + + aboutToAppear() { + console.info('new item:' + this.item); + }; + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +}; + +@Entry +@Component +struct UIComponentScrollScrollExtra340 { + minSize: number = 80; + maxSize: number = 180; + fontSize: number = 24; + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + dataCount: number = this.dataSource.totalCount(); + private itemHeightArray: number[] = []; + @State sections: WaterFlowSections = new WaterFlowSections(); + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 }; + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + }; + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + }; + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + }; + + getSize() { + let ret = Math.floor(100) + return (ret > this.minSize ? ret : this.minSize); + }; + + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + this.itemHeightArray.push(this.getSize()); + } + }; + + aboutToAppear() { + this.setItemSizeArray() + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra340') + .height('5%') + .onClick(() => { + let totalCount: number = this.dataSource.totalCount(); + let newSection: SectionOptions = { + itemsCount: totalCount, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + }; + let oldLength: number = this.sections.length(); + this.sections.splice(0, oldLength, [newSection]); + this.scroller.scrollToIndex(50,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + .height(100) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 10; i++) { + this.dataSource.addLastItem() + } + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 10; + this.sections.update(-1, newSection); + } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0ab507f508ac845a522cb207b28daa1dde655cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra350 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colume: string = '1fr 1fr'; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra350') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.colume = '1fr 1fr 1fr'; + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate(this.colume) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f652ed0981471d5465cf299c6a42c672e3908ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360.ets @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra360 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State layoutdirection : FlexDirection = FlexDirection.Row; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr ') + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .layoutDirection(this.layoutdirection) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + + }) + Row() { + Button('Button') + .height('5%') + .id('UIComponentScrollScrollExtra360') + .onClick(() => { + this.layoutdirection = FlexDirection.Column; + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370.ets new file mode 100644 index 0000000000000000000000000000000000000000..ecbb0117cbc1764b2560cf549ed33b0908e5f564 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370.ets @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra370 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State heightValue: number = 200; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra370') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.dataSource.add1stItem(); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380.ets new file mode 100644 index 0000000000000000000000000000000000000000..c07658777f56cdd31a8342b4edd5657fcf1d8e56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380.ets @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra380 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State heightValue: number = 200; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra380') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.heightValue = this.heightValue + 10; + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390.ets new file mode 100644 index 0000000000000000000000000000000000000000..0409538423e83ea93fb3aeacc2b5e0755ac79ae5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra390 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State widthValue: number = 200; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra390') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.widthValue = this.widthValue + 10; + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width(this.widthValue) + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40.ets new file mode 100644 index 0000000000000000000000000000000000000000..e1a9332459fe6353e95c660cfcc8970926818ff3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra40 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State widthtValue: number = 2; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: this.widthtValue, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra40') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.widthtValue = this.widthtValue + 2; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400.ets new file mode 100644 index 0000000000000000000000000000000000000000..0817428ef588ca0701b07bdaabdeaf6c7d4c1fb8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra400 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra400') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,true,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410.ets new file mode 100644 index 0000000000000000000000000000000000000000..89969b2a8607b713cea134141c33b7289bf63304 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra410 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra410') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c6df508886aa7de1844886c09fc48a569b2b5a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra430 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra430') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(-5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440.ets new file mode 100644 index 0000000000000000000000000000000000000000..b99d8ba018d5582dd152bb79d7b0bb03f9a316cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra440 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra440') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(200) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50.ets new file mode 100644 index 0000000000000000000000000000000000000000..7b71a1d538b47d11607f91ed83c4e067dd5cbc16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra50 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra50') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60.ets new file mode 100644 index 0000000000000000000000000000000000000000..7fb7e8feea903f1180c173853e18b256825ec7d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60.ets @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2024 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra60 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra60') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()); + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f07de94bab5f915cc9e6945aac7698b316376af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra70 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State LanestValue: number = 2; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .listDirection(Axis.Vertical) + .lanes(this.LanestValue) + Button('Button') + .id('UIComponentScrollScrollExtra70') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.LanestValue = this.LanestValue + 1; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80.ets new file mode 100644 index 0000000000000000000000000000000000000000..a77d58e362b887aabbc4ce42e9803aa0827bf14f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra80 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State listDirection: Axis = Axis.Vertical; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .listDirection(this.listDirection) + Button('Button') + .id('UIComponentScrollScrollExtra80') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.listDirection = Axis.Horizontal; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90.ets new file mode 100644 index 0000000000000000000000000000000000000000..6cac6ba6e7671cc7ddd1287c0788a7e16762f5fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra90 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State SpaceValue: number = 10; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .offset({x:0,y:this.SpaceValue}) + Button('Button') + .id('UIComponentScrollScrollExtra90') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + this.SpaceValue = this.SpaceValue +10 + + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/WaterFlowDataSource.ets new file mode 100644 index 0000000000000000000000000000000000000000..60644b7d88fa8851f1a7695ded264907b0f41eff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430.ets new file mode 100644 index 0000000000000000000000000000000000000000..ed2cc98590251c11a7aa68d2d5e63d7787d4a459 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollLog0430 { + @State arr: number[] = []; + @State flag: boolean = true; + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Scroll() { + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '') + .width('100%') + .height(150) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .enableScrollInteraction(this.flag) + .scrollable(ScrollDirection.Vertical) + .padding(30) + .width('100%') + .height(500) + .border({ + width: 2 + }) + + Button('切换enableScrollInteraction').onClick((event: ClickEvent) => { + this.flag = !this.flag; + }).id('ScrollLog_002') + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440.ets new file mode 100644 index 0000000000000000000000000000000000000000..648bfc7d6ce0f12c68a220ad09645cbd35929c52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollLog0440 { + @State arr: number[] = []; + @State flagNum: number = 0; + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Scroll() { + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '') + .width('100%') + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .height('100%') + .onWillScroll(() => { + this.flagNum = 1; + }) + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .scrollable(ScrollDirection.Vertical) + .padding(30) + .width('100%') + .height('60%') + .onWillScroll(() => { + this.flagNum = 2; + }) + .border({ + width: 2 + }) + + Text(`触发滚动回调组件:${ this.flagNum === 1 ? 'List' : 'Scroll' }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSwiper/UIComponentSwiper002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSwiper/UIComponentSwiper002.ets new file mode 100644 index 0000000000000000000000000000000000000000..3904c8400c45bc73ee2d186918bfcda725972fbf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSwiper/UIComponentSwiper002.ets @@ -0,0 +1,144 @@ +import { On } from '@ohos.UiTest'; + +class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: StringData[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): StringData { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} + +class MyDataSource extends BasicDataSource { + private dataArray: StringData[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): StringData { + return this.dataArray[index]; + } + + public addData(index: number, data: StringData): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: StringData): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } +} + +@Observed +class StringData { + message: NestedString; + constructor(message: NestedString) { + this.message = message; + } +} + +@Observed +class NestedString { + message: string; + constructor(message: string) { + this.message = message; + } +} + +@Entry +@Component +struct UIComponentSwiper002 { + @State data: MyDataSource = new MyDataSource(); + @State numbers: string[] = []; + + aboutToAppear() { + for (let i = 1;i <= 15; i++) { + this.numbers.push(i + '') + } + for (let i = 0; i <= 22; i++) { + this.data.pushData(new StringData(new NestedString(`Hello ${i}`))); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + GridItem() { + Text('4') + .fontSize(16) + .backgroundColor(0xFAEEE0) + .width(40) + .height(40) + .textAlign(TextAlign.Center) + }.rowStart(3).rowEnd(1) + LazyForEach(this.data, (item: StringData, index: number) => { + GridItem() { + Row() { + Text(index+'').fontSize(24).backgroundColor(0xF9CF93) + } + }.width(40).height(40).borderColor(Color.Red) + + }, (item: StringData, index: number) => JSON.stringify(item) + index.toString()) + }.width(400).height(700) + .layoutDirection(GridDirection.Row) + .rowsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + + } + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..f0e1408953c54cfd73730e641c4756ccf341c207 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0010 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0010') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..ea6b3f2c3aba69725d47cdd51d5ac26d13580262 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0020 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0020') + .onClick(() => { + this.theme = ThemeColorMode.DARK; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..79073fa782c27d8520844f0205380e146269ce4b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0040 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.DARK; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0040') + .onClick(() => { + this.theme = ThemeColorMode.DARK; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba66f25e67a81a2164b9ef9f72d4e3e02ff04121 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0050 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0050') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..aadaa87e0abd73f0569330a2fdf9249503c68a37 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0060 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0060') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..1cd8ca6036c41f05ad75555cb658a7496bb9d9e9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0070 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0070') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd80bde298d4134e0ae6b7dd888757dc54f48194 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 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 { common } from '@kit.AbilityKit' +import { window } from '@kit.ArkUI' + +@Entry +@Component +struct UICoypokentScrollScrollGetitenrect0250 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 + @State grid_width: number = 400 + @State grid_height:number = 200 + @State itemX:string = '' + @State itemY:string = '' + @State itemWidth:string = '' + @State itemHeight:string = '' + @State isFullScreen:boolean = false + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('grid') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(this.grid_width) + .backgroundColor(0xFAEEE0) + .height(this.grid_height) + + Text('x: '+this.itemX) + Text('Y: '+this.itemY) + Text('width: '+this.itemWidth) + Text('height: '+this.itemHeight) + + Row({space:8}){ + Button('getItemRect').id('btn1') + .onClick(() => { + this.itemX = this.scroller.getItemRect(0).x.toString() + this.itemY = this.scroller.getItemRect(0).y.toString() + this.itemWidth = this.scroller.getItemRect(0).width.toString() + this.itemHeight = this.scroller.getItemRect(0).height.toString() + }) + Button('横竖屏切换').id('btn2').onClick(() => { + this.horVerSwitch() + }) + } + + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..b87128b99ca2a34a929d9d5b857743a3790f6b02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 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. + */ + +@Entry +@Component +struct UICoypokentScrollScrollGetitenrect0260 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 + @State grid_width: number = 400 + @State grid_height:number = 300 + @State itemX:string = '' + @State itemY:string = '' + @State itemWidth:string = '' + @State itemHeight:string = '' + + + build() { + Scroll() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('grid') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(this.grid_width) + .backgroundColor(0xFAEEE0) + .height(this.grid_height) + + Text('x: '+this.itemX).fontSize(20) + Text('Y: '+this.itemY).fontSize(20) + Text('width: '+this.itemWidth).fontSize(20) + Text('height: '+this.itemHeight).fontSize(20) + Button('getItemRect').id('btn1').width(200).height(80) + .onClick(() => { + this.itemX = this.scroller.getItemRect(0).x.toString() + this.itemY = this.scroller.getItemRect(0).y.toString() + this.itemWidth = this.scroller.getItemRect(0).width.toString() + this.itemHeight = this.scroller.getItemRect(0).height.toString() + }) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..9de1a1913575f49bfe43c4042fec05567f058672 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 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. + */ +class MyGridModifier implements AttributeModifier { + isDark: boolean = false + applyNormalAttribute(instance: GridAttribute): void { + if (this.isDark) { + instance.rowsTemplate('1fr 1fr 1fr 1fr 1fr') + } else { + instance.columnsTemplate('1fr 1fr 1fr 1fr 1fr') + } + } +} +@Entry +@Component +struct UICoypokentScrollScrollGetitenrect0300 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 + @State grid_width: number = 400 + @State grid_height:number = 200 + @State itemX:string = '' + @State itemY:string = '' + @State itemWidth:string = '' + @State itemHeight:string = '' + @State isFullScreen:boolean = false + @State modifier: MyGridModifier = new MyGridModifier() + + build() { + Scroll() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('grid') + .attributeModifier(this.modifier) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(this.grid_width) + .backgroundColor(0xFAEEE0) + .height(this.grid_height) + + Text('x: '+this.itemX) + Text('Y: '+this.itemY) + Text('width: '+this.itemWidth) + Text('height: '+this.itemHeight) + + Row({space:8}){ + Button('getItemRect').id('btn1') + .onClick(() => { + this.itemX = this.scroller.getItemRect(0).x.toString() + this.itemY = this.scroller.getItemRect(0).y.toString() + this.itemWidth = this.scroller.getItemRect(0).width.toString() + this.itemHeight = this.scroller.getItemRect(0).height.toString() + }) + Button('切换主轴').id('btn2').onClick(() => { + this.modifier.isDark = !this.modifier.isDark + }) + } + + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c3543c4bd1ee8062020703fcea17576444c31d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30.ets new file mode 100644 index 0000000000000000000000000000000000000000..b4067fd8e6011e3b1a26ee79e0a19136edb7ee88 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(true) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button') + .id('UiComponentAlphabetindexerAttributeAutocollapse30') + .onClick(() => { + this.value = ['A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I']; + }) + .margin({left:50}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40.ets new file mode 100644 index 0000000000000000000000000000000000000000..0fe161d38004cd0937b57144e33c3e27c0d77966 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse40 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(true) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button') + .id('UiComponentAlphabetindexerAttributeAutocollapse40') + .onClick(() => { + this.value = [ '#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M']; + }) + .margin({left:50}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50.ets new file mode 100644 index 0000000000000000000000000000000000000000..c16ea9c472e8950a96aabc4db9d6abf3c4e6979a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = [ '#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(true) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button') + .id('UiComponentAlphabetindexerAttributeAutocollapse50') + .onClick(() => { + this.value = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M']; + }) + .margin({left:50}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..62f85ea3b0e0f736c57275ca188d4d114a605442 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UiComponentCanvasModifier0530 { + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + private context1: OffscreenCanvas = new OffscreenCanvas(600, 400); + private img: ImageBitmap = new ImageBitmap("common/images/example.jpg"); + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() => { + let offContext = this.context1.getContext("2d", this.settings) + offContext.beginPath() + offContext.lineWidth = 15 + offContext.lineJoin = 'bevel' + offContext.moveTo(50, 50) + offContext.lineTo(150, 150) + offContext.lineTo(250, 50) + offContext.stroke() + offContext.transform(0,0,0,0,0,0) + let image = this.context1.transferToImageBitmap() + this.context.transferFromImageBitmap(image) + }) + } + .width('100%') + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790.ets new file mode 100644 index 0000000000000000000000000000000000000000..47b6d7096aa9a924dfb054ea9f486fbc2b0c93f7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 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. + */ +@Entry +@Component +struct UiComponentCanvasModifier3790 { + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + private context1: OffscreenCanvas = new OffscreenCanvas(600, 400); + private img: ImageBitmap = new ImageBitmap("common/images/example.jpg"); + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() => { + let offContext = this.context1.getContext("2d", this.settings) + offContext.beginPath() + offContext.lineWidth = 15 + offContext.lineJoin = 'bevel' + offContext.moveTo(50, 50) + offContext.lineTo(150, 150) + offContext.lineTo(250, 50) + offContext.stroke() + offContext.setLineDash([5,5,]) + let image = this.context1.transferToImageBitmap() + this.context.transferFromImageBitmap(image) + }) + } + .width('100%') + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 5cc05ce92cff61b76d701a3fe495c11c73638078..b2e770b69df1ed8c7746182601d71f178d73cf1f 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1801,6 +1801,551 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0130", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0140", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0150", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0160", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0170", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0180", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0190", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0200", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0230", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0410", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier440", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0450", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0460", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0470", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier210", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier220", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier370", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier380", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0260", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier400", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0420", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140", + "testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370", + "testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500", + "testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717", + "testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215", + "testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260", + "testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300", + "testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250", + "testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440", + "testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430", + "testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030", + "testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822", + "testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260", + "testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010", + "testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030", + "testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629", + "testability/pages/ArkuiScrollbarScroll/ArkuiScrollbarScroll0890", + "testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020", + "testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010", + "testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050", + "testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620", + "testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070", + "testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110", + "testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528", + "testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779", + "testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409", + "testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115", + "testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330", + "testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632", + "testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060", + "testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070", + "testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007", + "testability/pages/UIComponentGrid/UIComponentGrid001", + "testability/pages/UIComponentGrid/UIComponentGrid002", + "testability/pages/UIComponentGrid/UIComponentGrid003", + "testability/pages/UIComponentGrid/UIComponentGrid004", + "testability/pages/UIComponentGrid/UIComponentGrid005", + "testability/pages/UIComponentGrid/UIComponentGrid006", + "testability/pages/UIComponentGrid/UIComponentGrid007", + "testability/pages/UIComponentGrid/UIComponentGrid008", + "testability/pages/UIComponentGrid/UIComponentGrid009", + "testability/pages/UIComponentGrid/UIComponentGrid010", + "testability/pages/UIComponentGrid/UIComponentGrid011", + "testability/pages/UIComponentSwiper/UIComponentSwiper002", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610", + "testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980", + "testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450", + "testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040", + "testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530", + "testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70", + + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360" ] }