diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentScrollSwiperIgnoreBlankTest/UIComponentScrollSwiperIgnoreBlank.test.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentScrollSwiperIgnoreBlankTest/UIComponentScrollSwiperIgnoreBlank.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc8399f8971b308565e19ffb01d4a191d77ac827 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/test/UIComponentScrollSwiperIgnoreBlankTest/UIComponentScrollSwiperIgnoreBlank.test.ets @@ -0,0 +1,686 @@ +/** + * Copyright (c) 2025 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, Level } from '@ohos/hypium'; +import { BusinessError, commonEventManager } from '@kit.BasicServicesKit'; +import { Driver, ON ,Component, UiWindow } from '@kit.TestKit'; +import { uiAppearance } from '@kit.ArkUI'; +import Settings from '../model/Settings'; +import windowSnap from '../model/snapShot'; +import Logger from '../model/Logger'; +import Utils from '../model/Utils'; + + +let TAG = 'RunTimeTest'; + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +export default function UIComponentScrollSwiperIgnoreBlank() { + describe('UIComponentScrollSwiperIgnoreBlank', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error(`[${TAG}_afterEach]`, `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info(`[${TAG}_afterEach]`, `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + afterAll(() => { + + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0010 + * @tc.desc Set front margin ignore blank space on homepage + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0010', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0010'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0010"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0020 + * @tc.desc Set front margin ignore blank space on medium page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0020', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0020'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0020"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0030 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0030 + * @tc.desc Set front margin ignore blank space on last page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0030', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0030'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0030"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0040 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0040 + * @tc.desc Set front margin without ignoring blank space on homepage + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0040', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0040'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0040"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0050 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0050 + * @tc.desc Set front margin without ignoring blank space on medium page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0050', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0050'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0050"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0060 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0060 + * @tc.desc Set front margin without ignoring blank space on last page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0060', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0060'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0060"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0070 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0070 + * @tc.desc Set front margin ignore blank space + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0070', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0070'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0070"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0080 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0080 + * @tc.desc Set front margin without ignoring blank space + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0080', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0080'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0080"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0090 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0090 + * @tc.desc Set front margin with second parameter as null + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0090', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0090'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0090"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0100 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0100 + * @tc.desc Set front margin without specifying second parameter + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0100', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0100'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0100"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0110 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0110 + * @tc.desc Reset front margin + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0110', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0110'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0110"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0120 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0120 + * @tc.desc Set front margin and get its value + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0120', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0120'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0120"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_03'), 1000); + await driver.waitForIdle(500, 1000); + await button.click(); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0130 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0130 + * @tc.desc Set next margin ignore blank space on homepage + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0130', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0130'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0130"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0140 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0140 + * @tc.desc Set next margin ignore blank space on medium page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0140', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0140'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0140"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0150 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0150 + * @tc.desc Set next margin ignore blank space on last page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0150', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0150'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0150"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0160 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0160 + * @tc.desc Set next margin without ignoring blank space on home page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0160', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0160'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0160"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0170 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0170 + * @tc.desc Set next margin without ignoring blank space on medium page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0170', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0170'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0170"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0180 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0180 + * @tc.desc Set next margin without ignoring blank space on last page + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0180', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0180'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0180"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0190 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0190 + * @tc.desc Set next margin ignore blank space + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0190', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0190'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0190"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0200 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0200 + * @tc.desc Set next margin without ignoring blank space + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0200', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0200'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0200"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0210 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0210 + * @tc.desc Set rear margin with second parameter as null + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0210', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0210'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0210"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0220 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0220 + * @tc.desc Reset rear margin + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0220', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0220'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0220"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0230 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0230 + * @tc.desc Set next margin without specifying second parameter + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0230', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0230'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0230"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0240 + * @tc.desc Set next margin and get its value + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0240', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0240'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0240"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_03'), 1000); + await driver.waitForIdle(500, 1000); + await button.click(); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0250 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0250 + * @tc.desc Set both front and next margins ignoring blank space + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0250', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0250'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0250"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_01'); + await button.click(); + await driver.waitForIdle(500, 1000); + await button.click(); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_02'); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0260 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0260 + * @tc.desc Set both front and next margins without ignoring blank space + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0260', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0260'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0260"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_01'); + await button.click(); + await driver.waitForIdle(500, 1000); + await button.click(); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_02'); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0270 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0270 + * @tc.desc Set front margin across multiple pages in one group + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0270', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0270'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0270"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0280 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0280 + * @tc.desc Set next margin across multiple pages in one group + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0280', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0280'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0280"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_01'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0290 + * @tc.desc Set both front and next margins in loop scenario 01 + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0290', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0290'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0290"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_01'); + await button.click(); + await driver.waitForIdle(500, 1000); + await button.click(); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_02'); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0300 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0300 + * @tc.desc Set both front and next margins in loop scenario 02 + * @tc.level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0300', Level.LEVEL3, async (done: Function) => { + TAG = 'SUB_ACE_UI_COMPONENT_SCROLL_SWIPER_IGNOREBLANK_0300'; + let pageName = "UIComponentScrollSwiperIgnoreBlank0300"; + Logger.info(`[${TAG}]`, `Case start.`); + Settings.createWindow('testability/pages/UIComponentScrollSwiperIgnoreBlank/' + pageName); + let driver: Driver = Driver.create(); + let button: Component = await driver.waitForComponent(ON.id(pageName + '_02'), 1000); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_01'); + await button.click(); + await driver.waitForIdle(500, 1000); + await button.click(); + await driver.waitForIdle(500, 1000); + await windowSnap.snapShot(TAG + '_02'); + await Utils.sleep(1000); + Logger.info(`[${TAG}]`, `Case finish.`); + done(); + }) + + }) +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0010.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..c4a1384c4945df965c2d6aceb21a9f2624ac4a24 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0010.ets @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0010 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 UIComponentScrollSwiperIgnoreBlank0010 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0010'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + // @State prevMarginSecondValue: boolean | number = 1; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0010 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0010([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0010(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0020.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..e910f06cb1ad5ecd484424c05489fc7f3edd48fe --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0020.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0020 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 UIComponentScrollSwiperIgnoreBlank0020 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0020'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 1; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0020 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0020([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0020(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0030.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..36d18beb994bb6ad74e7ac10f60f5e6d6eb6a0f2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0030.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0030 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 UIComponentScrollSwiperIgnoreBlank0030 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0030'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0030 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0030([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0030(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0040.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..608ca4cdaf1f28f0463dbe1706b7092e3e3fecb6 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0040.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0040 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 UIComponentScrollSwiperIgnoreBlank0040 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0040'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0040 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0040([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0040(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0050.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..b534ebdb45d19e2ca23b74b58154b34c74accce8 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0050.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0050 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 UIComponentScrollSwiperIgnoreBlank0050 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0050'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 1; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0050 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0050([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0050(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0060.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..7c96feb4461d89096688ee5c4d783dac61ed35dd --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0060.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0060 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 UIComponentScrollSwiperIgnoreBlank0060 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0060'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0060 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0060([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0060(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0070.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e39040393372b4febae343139e3b0ff29155001 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0070.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0070 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 UIComponentScrollSwiperIgnoreBlank0070 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0070'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0070 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0070([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0070(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0080.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bf710b1ef4035c0423d4d7b0592452a674aef17 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0080.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0080 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 UIComponentScrollSwiperIgnoreBlank0080 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0080'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0080 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0080([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0080(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0090.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..299e92e03e80ecf056cb19e2ef7b97f3ece9d611 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0090.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0090 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 UIComponentScrollSwiperIgnoreBlank0090 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0090'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean | null = null; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0090 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0090([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0090(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0100.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..a36f6e089e99402cf3d71b7817fd9a56db373ee2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0100.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0100 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 UIComponentScrollSwiperIgnoreBlank0100 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0100'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0100 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0100([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0100(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0110.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..089e4905fa07de803e706b91b94c56ed2b8c5f65 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0110.ets @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0110 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 UIComponentScrollSwiperIgnoreBlank0110 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0110'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0110 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0110([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0110(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue) + .prevMargin(this.prevMarginFirstValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0120.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..d32328c7fe25083b6d65a1a234e7391d98e293fb --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0120.ets @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0120 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 UIComponentScrollSwiperIgnoreBlank0120 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0120'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0120 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0120([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0120(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + Button('get') + .id(this.name + '_03') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.message = 'prevMargin: ' + this.prevMarginFirstValue.toString(); + }) + + Text(this.message) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0130.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..7dcf9d2043b6fa65912732d7c071ed14baf2b323 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0130.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0130 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 UIComponentScrollSwiperIgnoreBlank0130 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0130'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0130 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0130([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0130(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0140.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..155dc07ef2082a28bbe6ae9afb229274e7f0ae78 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0140.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0140 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 UIComponentScrollSwiperIgnoreBlank0140 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0140'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 1; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0140 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0140([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0140(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0150.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..5b0b56996dd16d7ccac3923d7078945b52ad9f33 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0150.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0150 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 UIComponentScrollSwiperIgnoreBlank0150 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0150'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0150 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0150([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0150(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0160.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..94b5dad07e1e6560841b77ddb930ebb4e886b85e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0160.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0160 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 UIComponentScrollSwiperIgnoreBlank0160 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0160'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0160 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0160([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0160(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0170.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..8fb3e364cd71f7ae4209a90612fa1ce6defc34ec --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0170.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0170 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 UIComponentScrollSwiperIgnoreBlank0170 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0170'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 1; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0170 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0170([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0170(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0180.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..f45a5212a74be05db2c657db1a8e7d93caeddc76 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0180.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0180 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 UIComponentScrollSwiperIgnoreBlank0180 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0180'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0180 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0180([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0180(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0190.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..e1dbb3a9e72e8ea47f51508b2691daa3adf27b78 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0190.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0190 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 UIComponentScrollSwiperIgnoreBlank0190 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0190'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0190 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0190([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0190(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0200.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..f630e4cef9904766ef04adcbcaed7239d5320f77 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0200.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0200 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 UIComponentScrollSwiperIgnoreBlank0200 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0200'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0200 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0200([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0200(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0210.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..b30eae9f18f3865c399e124808cb4079ed84c13c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0210.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0210 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 UIComponentScrollSwiperIgnoreBlank0210 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0210'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean | null = null; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0210 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0210([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0210(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0220.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..fcf2e4b2849359594986e782da88f214fef836e3 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0220.ets @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0220 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 UIComponentScrollSwiperIgnoreBlank0220 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0220'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 0; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0220 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0220([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0220(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue) + .nextMargin(this.nextMarginFirstValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0230.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8d805d2bd15d10de2ddf26e64882fb0707d947a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0230.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0230 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 UIComponentScrollSwiperIgnoreBlank0230 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0230'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0230 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0230([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0230(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0240.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c2bf161929b3c71b6548f3f047a341d82ef3b71 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0240.ets @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0240 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 UIComponentScrollSwiperIgnoreBlank0240 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0240'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0240 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0240([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0240(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + Button('get') + .id(this.name + '_03') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.message = 'prevMargin: ' + this.nextMarginFirstValue.toString(); + }) + + Text(this.message) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Medium) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0250.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb0af5b46a67f310ef48b6854cc3d71410ed0a32 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0250.ets @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0250 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 UIComponentScrollSwiperIgnoreBlank0250 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0250'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0250 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0250([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0250(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0260.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..79de182078900113b463c4b03e5af938ad37d0f2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0260.ets @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0260 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 UIComponentScrollSwiperIgnoreBlank0260 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0260'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = false; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0260 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0260([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0260(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0270.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0f8f5ac84d64dbb933a412fa321c28796c787e7 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0270.ets @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0270 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 UIComponentScrollSwiperIgnoreBlank0270 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0270'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 0; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0270 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0270([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0270(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + .displayCount(2) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0280.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..401e67004d7c59fc15765901d3ff11f830315939 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0280.ets @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0280 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 UIComponentScrollSwiperIgnoreBlank0280 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0280'; + @State message: string = this.name; + @State loopValue: boolean = false; + @State indexValue: number = 2; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0280 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0280([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0280(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + .displayCount(2) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0290.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..e3b2ad3a80b023105b0edbd2253f1a6407ab0e5e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0290.ets @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0290 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 UIComponentScrollSwiperIgnoreBlank0290 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0290'; + @State message: string = this.name; + @State loopValue: boolean = true; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = true; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = true; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0290 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0290([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0290(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0300.ets b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c3966a906bcb5e9f43615e11c39bade4fa52d84 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_03/entry/src/ohosTest/ets/testability/pages/UIComponentScrollSwiperIgnoreBlank/UIComponentScrollSwiperIgnoreBlank0300.ets @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2025 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. + */ + +class MyDataSource_UIComponentScrollSwiperIgnoreBlank0300 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 UIComponentScrollSwiperIgnoreBlank0300 { + @State name: string = 'UIComponentScrollSwiperIgnoreBlank0300'; + @State message: string = this.name; + @State loopValue: boolean = true; + @State indexValue: number = 0; + @State nextMarginFirstValue: Length = 10; + @State nextMarginSecondValue: boolean = false; + @State prevMarginFirstValue: Length = 10; + @State prevMarginSecondValue: boolean = false; + private swiperController: SwiperController = new SwiperController(); + private data: MyDataSource_UIComponentScrollSwiperIgnoreBlank0300 = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0300([]); + + aboutToAppear(): void { + let list: number[] = []; + for (let i = 0; i < 3; i++) { + list.push(i); + } + this.data = new MyDataSource_UIComponentScrollSwiperIgnoreBlank0300(list); + } + + + build() { + Column() { + Text(this.name) + .fontSize(20) + .fontColor(Color.Black) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + .margin({ + left: 6, + right: 6, + top: 10, + bottom: 10 + }) + + Swiper(this.swiperController) { + Text('Page 0') + .width('100%') + .height(160) + .backgroundColor(Color.Blue) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 1') + .width('100%') + .height(160) + .backgroundColor(Color.Orange) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + Text('Page 2') + .width('100%') + .height(160) + .backgroundColor(Color.Green) + .fontSize(30) + .fontColor(Color.Red) + .fontWeight(FontWeight.Bold) + .textAlign(TextAlign.Center) + } + .index(this.indexValue) + .indicator( + Indicator.digit() + .top(200) + .fontColor(Color.Gray) + .selectedFontColor(Color.Gray) + .digitFont({ + size: 20, + weight: FontWeight.Bold + }) + .selectedDigitFont({ + size: 20, + weight: FontWeight.Normal + }) + ) + .loop(this.loopValue) + .duration(1000) + .itemSpace(0) + .displayArrow(true, false) + .prevMargin(this.prevMarginFirstValue, this.prevMarginSecondValue) + .nextMargin(this.nextMarginFirstValue, this.nextMarginSecondValue) + + Row({ space: 12 }) { + Button('showPrevious') + .id(this.name + '_01') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showPrevious(); + }) + + Button('showNext') + .id(this.name + '_02') + .borderRadius(20) + .backgroundColor(0x317aff) + .fontSize(16) + .fontWeight(FontWeight.Bold) + .margin(10) + .onClick(() => { + this.swiperController.showNext(); + }) + + } + .justifyContent(FlexAlign.Center) + .width('80%') + .margin(10) + + } + .justifyContent(FlexAlign.Center) + .width('100%') + .height('100%') + } +}