diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..11de16ebb3a3e455b798f2cddc14af0bb33dd4dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabScrollableTest/ArkUITabScrollable.test.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabScrollable() { + + describe('ArkUITabScrollable', () => { + + + /* +* @tc.number ArkUI_Tabs_scrollable_001 +* @tc.name ArkUI_Tabs_scrollable_001 +* @tc.desc 1 、启 动 应 用 + 2、 设置属性scrollable参数为正常值 + 3 、 重 新 设 置 正 常 值 后 重 复 步 骤 1 和2 +*/ + it('ArkUI_Tabs_scrollable_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_scrollable_001 start.`); + Settings.createWindow("testability/pages/ArkUITabScrollable/ArkUITabScrollable001") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkUITabScrollable001_002')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_scrollable_001 finish.`); + done() + }) + + /* +* @tc.number ArkUI_Tabs_scrollable_002 +* @tc.name ArkUI_Tabs_scrollable_002 +* @tc.desc 1 、启 动 应 用 + 2、 设置属性scrollable参数为正常值 + 3 、 重 新 设 置 正 常 值 后 重 复 步 骤 1 和2 +*/ + it('ArkUI_Tabs_scrollable_002', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_scrollable_002 start.`); + Settings.createWindow("testability/pages/ArkUITabScrollable/ArkUITabScrollable002") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkUITabScrollable002_002')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_scrollable_002 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c54c62e50087aef0663c201d92e3872ec5d61b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test.ets @@ -0,0 +1,195 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsIconStyleSelectedColor() { + + describe('ArkUITabsIconStyleSelectedColor', () => { + + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 + * @tc.desc selectedColor: 0xFFFFFFFFFFFFFFFF + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_027 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 + * @tc.desc selectedColor: null + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_029 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 + * @tc.desc selectedColor: undefined + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_028 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 + * @tc.desc selectedColor: "rgba(255,100,255,0.5)" + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_024 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 + * @tc.desc selectedColor:$r("sys.color.toast_outer_border_color") + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_026 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 + * @tc.desc selectedColor: $r("sys.color.titlebar_title_tertiary_color") + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_025 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 + * @tc.desc selectedColor: 0x808080 + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_014 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 + * @tc.desc selectedColor: 0xa52a2a + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_013 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 + * @tc.desc selectedColor: Color.Black + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_001 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 + * @tc.desc selectedColor: Color.Gray + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_004 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 + * @tc.desc selectedColor: Color.Red + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_008 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022 + * @tc.name ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022 + * @tc.desc selectedColor: “#ff000000" + */ + it('ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_SELECTEDCOLOR_022$ finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5df21352c8310e8a539de155a98c44ffa69edaa4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test.ets @@ -0,0 +1,181 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsIconStyleUnselectedColor() { + + describe('ArkUITabsIconStyleUnselectedColor', () => { + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 + * @tc.desc unselectedColor:0xFFFFFFFFFFFFFFFF + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_026 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 + * @tc.desc unselectedColor: null + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_028 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 + * @tc.desc unselectedColor: undefined + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_027 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 + * @tc.desc unselectedColor: "#ff000000" + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_021 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 + * @tc.desc unselectedColor: "rgb(255,100,255)" + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_022 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 + * @tc.desc unselectedColor: $r("sys.color.toast_outer_border_color") + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_024 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 + * @tc.desc unselectedColor: 0x008000 + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_014 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 + * @tc.desc unselectedColor: 0xffc0cb + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_016 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 + * @tc.desc unselectedColor: Color.Black + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_029 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 + * @tc.desc unselectedColor: Color.Brown + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_002 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 + * @tc.name ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 + * @tc.desc unselectedColor: Color.Orange + */ + it('ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_ICONSTYLE_UNSELECTEDCOLOR_005 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..39aa137013fb9b01355f0d53bc35741995205ece --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test.ets @@ -0,0 +1,469 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsLabelStyleSelectedColor() { + + describe('ArkUITabsLabelStyleSelectedColor', () => { + + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_027 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_027 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_027', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor027_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_027 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_029 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_029 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_029', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_029 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor029_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_029 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_013 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_013 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_013', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_013 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor013_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_013 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_017 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_017 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_017', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_017 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor017_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_017 finish.`); + done() + }) + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_019 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_019 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_019', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_019 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor019_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_019 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_001 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_001 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor001_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_001 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_003 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_003 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_003', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_003 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor003_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_003 finish.`); + done() + }) + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_005 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_005 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_005', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor005_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_005 finish.`); + done() + }) + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_007 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_007 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_007', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_007 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor007_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_007 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_selectedColor_011 + * @tc.name ArkUI_Tabs_LabelStyle_selectedColor_011 + * @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_selectedColor_011', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor011_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_011 finish.`); + done() + }) + + /* +* @tc.number ArkUI_Tabs_LabelStyle_selectedColor_009 +* @tc.name ArkUI_Tabs_LabelStyle_selectedColor_009 +* @tc.desc 1、启动应用 + 2、设置属性selectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_selectedColor_009', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_009 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleSelectedColor009_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_selectedColor_009 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor028_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_028 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor021_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_021 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor023_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_023 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor024_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_024 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor026_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_026 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor025_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_025 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor012_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_012 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 + * @tc.name ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 + * @tc.desc selectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleSelectedcolor015_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_SELECTEDCOLOR_015 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d7dd0377579ace102aa8506ceea577bf63d48457 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test.ets @@ -0,0 +1,349 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsLabelStyleUnselectedColor() { + + describe('ArkUITabsLabelStyleUnselectedColor', () => { + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_026 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_026 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_026', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_026 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor026_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_026 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_028 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_028 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_028', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_028 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor028_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_028 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_027 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_027 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_027', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_027 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor027_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_027 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_021 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_021 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_021', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_021 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor021_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_021 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_022 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_022 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置异常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_022', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_022 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor022_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_022 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_025 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_025 + * @tc.desc 1、启动应用 + * 2、设置属性unbselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_025', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_025 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor025_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_025 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_011 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_011 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_011', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor011_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_011 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_012 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_012 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_012', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_012 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor012_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_012 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_017 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_017 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_017', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_017 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor017_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_017 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_001 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_001 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_unselectedColor_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor001_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_001 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_005 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_005 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_005', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor005_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_005 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_unselectedColor_008 + * @tc.name ArkUI_Tabs_LabelStyle_unselectedColor_008 + * @tc.desc 1、启动应用 + 2、设置属性unselectedColor参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_unselectedColor_008', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStyleUnselectedColor008_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_unselectedColor_008 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 + * @tc.name ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 + * @tc.desc unselectedColor: + */ + it('ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleUnselectedcolor024_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_UNSELECTEDCOLOR_024 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..1279dfa79c2cf91afd023b941364d0ad5a29eda1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test.ets @@ -0,0 +1,386 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsLabelStylefont() { + + describe('ArkUITabsLabelStylefont', () => { + + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_005 + * @tc.name ArkUI_Tabs_LabelStyle_font_005 + * @tc.desc 1、创建tabs,设置SubTabBarStyle样式 + 2、设置镜像效果 + */ + it('ArkUI_Tabs_LabelStyle_font_005', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont005_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_005 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_016 + * @tc.name ArkUI_Tabs_LabelStyle_font_016 + * @tc.desc 1、启动应用 + 2、设置属性font参数为异常值 + 3、重新设置正常值后重复步疆1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_016', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_016 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont016_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_016 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_015 + * @tc.name ArkUI_Tabs_LabelStyle_font_015 + * @tc.desc 1、启动应用 + 2、设置属性font参数为异常值 + 3、重新设置正常值后重复步疆1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_015', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_015 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont015_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_015 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_011 + * @tc.name ArkUI_Tabs_LabelStyle_font_011 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_011', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_011 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_007 + * @tc.name ArkUI_Tabs_LabelStyle_font_007 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_007', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_007 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_007 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_010 + * @tc.name ArkUI_Tabs_LabelStyle_font_010 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_010', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_010 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_010 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_008 + * @tc.name ArkUI_Tabs_LabelStyle_font_008 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_008', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_008 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_008 finish.`); + done() + }) + + /* + * @tc.number ArkUI_Tabs_LabelStyle_font_009 + * @tc.name ArkUI_Tabs_LabelStyle_font_009 + * @tc.desc 1、启动应用 + 2、设置属性font参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_LabelStyle_font_009', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_009 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_009 finish.`); + done() + }) + + /* +* @tc.number ArkUI_Tabs_LabelStyle_font_020 +* @tc.name ArkUI_Tabs_LabelStyle_font_020 +* @tc.desc 1、启动应用 + 2、设置属性font参数为异常值 + 3、重新设置正常值后重复步骤1和2 +*/ + it('ArkUI_Tabs_LabelStyle_font_020', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_020 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('ArkUITabsLabelStylefont020_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `ArkUI_Tabs_LabelStyle_font_020 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_006 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_006 + * @tc.desc font: {size: -1} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_006', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_006 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_006 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_019 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_019 + * @tc.desc font: undefined + */ + it('ARKUI_TABS_LABELSTYLE_FONT_019', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_019 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_019 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_001 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_001 + * @tc.desc font: {size: 20} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_001', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont001_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_001 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_003 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_003 + * @tc.desc font: {size: 50%} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_003', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_003 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont003_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_003 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_004 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_004 + * @tc.desc font: {size: 10} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_004', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_004 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont004_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_004 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_018 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_018 + * @tc.desc font: {size: 10} + */ + it('ARKUI_TABS_LABELSTYLE_FONT_018', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_018 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont018_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_018 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_017 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_017 + * @tc.desc style:FontStyle.Normal + */ + it('ARKUI_TABS_LABELSTYLE_FONT_017', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_017 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont017_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_017 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_013 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_013 + * @tc.desc weight:200 + */ + it('ARKUI_TABS_LABELSTYLE_FONT_013', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_013 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont013_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_013 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_LABELSTYLE_FONT_012 + * @tc.name ARKUI_TABS_LABELSTYLE_FONT_012 + * @tc.desc weight: FontTeight.Bolder + */ + it('ARKUI_TABS_LABELSTYLE_FONT_012', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_012 start.`); + Settings.createWindow("testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUITabsLabelstyleFont012_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ARKUI_TABS_LABELSTYLE_FONT_012 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..50df4505f457169bd9cb023f924b37aae115f956 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function ArkUITabsSingleSelectedcolor() { + + describe('ArkUITabsSingleSelectedcolor', () => { + /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 + * @tc.desc selectedColor: "rgb(255,100,255)" + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_011', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_011 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 + * @tc.desc selectedColor: Color.White + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_002', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_002 finish.`); + done() + }) + /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 + * @tc.desc selectedColor: Color.Green + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_005', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_005 finish.`); + done() + }) /* + * @tc.number ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 + * @tc.name ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 + * @tc.desc selectedColor: 0xffffff + */ + it('ARKUI_TABS_SINGLE_SELECTEDCOLOR_008', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_SELECTEDCOLOR_008 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..cb90a868a6f555e5f0c2f8ac4310ce9d9eb771ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function ArkUITabsSingleUnselectedcolor() { + + describe('ArkUITabsSingleUnselectedcolor', () => { + /* + * @tc.number ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 + * @tc.name ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 + * @tc.desc selectedColor: Color.Transparent + */ + it('ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 start.`); + Settings.createWindow("testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003") + await Utils.sleep(2000) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `ARKUI_TABS_SINGLE_UNSELECTEDCOLOR_003 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..60afbf12b9eabdc4f3d0fe3375a6ec0824d79360 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUITabsVerticalTest/ArkUITabsVertical.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkUITabsVertical() { + + describe('ArkUITabsVertical', () => { + + /* + * @tc.number ArkUI_Tabs_vertical_001 + * @tc.name ArkUI_Tabs_vertical_001 + * @tc.desc 1、启动应用 + 2、设置属性vertical参数为正常值 + 3、重新设置正常值后重复步骤1和2 + */ + it('ArkUI_Tabs_vertical_001', 0, async (done: Function) => { + Logger.error('TEST', `ArkUI_Tabs_vertical_001 start.`); + Settings.createWindow("testability/pages/ArkUITabsVertical/ArkUITabsVertical001") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkUITabsVertical001_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `ArkUI_Tabs_vertical_001 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e2b67bdc172852aa4e57d4a08a69a6c80abed03b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function FunctionJichuWaterFlow() { + + describe('FunctionJichuWaterFlow', () => { + + + /* + * @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 + * @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 + * @tc.desc 1、安装hap包 + 2、打开应用 + */ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_0350 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 +* @tc.name SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的参数:设置参数footer +*/ + it('SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 start.`); + Settings.createWindow("testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(100) + let refreshListItem0 :Component = await driver.findComponent(ON.id('FunctionJichuWaterFlow001806_001')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y-400) + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y,pos.x,pos.y-400) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_FUNCTION_JICHU_WATERFLOW_001806 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets index 3f4effdb9f5a809147de218c0b8958bdda3f98c6..92199af358b5aa99740bb47cee01507a9b4be0d4 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -41,6 +41,39 @@ import ComponentTextRicheditorInterfaceTests import ComponentTextRicheditorShortKcutKeysTests from './ComponentTextRicheditorShortKcutKeys/ComponentTextRicheditorShortKcutKeysTests.test'; +import UIComponentNavTabsOnWillShow from './UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test'; +import UIComponentNavTabsContentAdapt from './UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test'; +import ArkUITabScrollable from './ArkUITabScrollableTest/ArkUITabScrollable.test'; +import ArkUITabsLabelStylefont from './ArkUITabsLabelStylefontTest/ArkUITabsLabelStylefont.test'; +import ArkUITabsLabelStyleSelectedColor from './ArkUITabsLabelStyleSelectedColorTest/ArkUITabsLabelStyleSelectedColor.test'; +import ArkUITabsLabelStyleUnselectedColor from './ArkUITabsLabelStyleUnselectedColorTest/ArkUITabsLabelStyleUnselectedColor.test'; +import UIComponentListAndGridWaterFlowAdd from './UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test'; +import UIComponentListAndGridWaterSections from './UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test'; +import UIComponentNavModifier from './UIComponentNavModifierTest/UIComponentNavModifier.test'; +import UIComponentNavTabsAction from './UIComponentNavTabsActionTest/UIComponentNavTabsAction.test'; +import UIComponentNavTabsBlurStyle from './UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test'; +import UIComponentNavTabsCachedCount from './UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test'; +import UIComponentNavTabsImproTrace from './UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test'; +import UIComponentNavTabsInterception from './UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test'; +import UIComponentNavTabsInterface from './UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test'; +import UIComponentNavTabsMirror from './UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test'; +import UIComponentTabTabBarSymbol from './UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test'; +import UIComponentOtherRefreshPromptText from './UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test'; +import UIComponentOtherRefreshInterface from './UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test'; +import UIComponentOtherRefreshInterAction from './UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test'; +import UIComponentOtherRefreshAbility from './UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test'; +import FunctionJichuWaterFlow from './FunctionJichuWaterFlowTest/FunctionJichuWaterFlow.test'; +import UIComponentNavTabsSubTabbarStyle from './UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test'; +import ArkUITabsVertical from './ArkUITabsVerticalTest/ArkUITabsVertical.test'; +import UIComponentNavTabsHeight from './UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test'; +import UIComponentNavTabsWidth from './UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test'; +import UIComponentNavTabsEdgeeffect from './UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test'; +import UIComponentNavTabsExpandsafearea from './UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test'; +import ArkUITabsIconStyleSelectedColor from './ArkUITabsIconStyleSelectedColorTest/ArkUITabsIconStyleSelectedColor.test'; +import ArkUITabsIconStyleUnselectedColor from './ArkUITabsIconStyleUnselectedColorTest/ArkUITabsIconStyleUnselectedColor.test'; +import ArkUITabsSingleSelectedcolor from './ArkUITabsSingleSelectedcolorTest/ArkUITabsSingleSelectedcolor.test'; +import ArkUITabsSingleUnselectedcolor from './ArkUITabsSingleUnselectedcolorTest/ArkUITabsSingleUnselectedcolor.test'; + export default function testsuite() { ComponentTextRicheditorFontfeatures(); ComponentTextRicheditorCustomColors(); @@ -55,4 +88,38 @@ export default function testsuite() { ComponentTextRicheditorOnWillChangeTests(); ComponentTextRicheditorInterfaceTests(); ComponentTextRicheditorShortKcutKeysTests(); + + UIComponentNavTabsOnWillShow(); + UIComponentNavTabsContentAdapt(); + ArkUITabScrollable(); + ArkUITabsLabelStylefont(); + ArkUITabsLabelStyleSelectedColor(); + ArkUITabsLabelStyleUnselectedColor(); + UIComponentListAndGridWaterFlowAdd(); + UIComponentListAndGridWaterSections(); + UIComponentNavModifier(); + UIComponentNavTabsAction(); + UIComponentNavTabsBlurStyle(); + UIComponentNavTabsCachedCount(); + UIComponentNavTabsImproTrace(); + UIComponentNavTabsInterception(); + UIComponentNavTabsInterface(); + UIComponentNavTabsMirror(); + UIComponentTabTabBarSymbol(); + UIComponentOtherRefreshPromptText(); + UIComponentOtherRefreshInterface(); + UIComponentOtherRefreshInterAction(); + UIComponentOtherRefreshAbility(); + FunctionJichuWaterFlow(); + UIComponentNavTabsSubTabbarStyle(); + ArkUITabsVertical(); + UIComponentNavTabsHeight(); + UIComponentNavTabsWidth(); + UIComponentNavTabsEdgeeffect(); + UIComponentNavTabsExpandsafearea(); + ArkUITabsIconStyleSelectedColor(); + ArkUITabsIconStyleUnselectedColor(); + ArkUITabsSingleSelectedcolor(); + ArkUITabsSingleUnselectedcolor(); + } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..60f88eae7f2cd19c24f4b358609875b5c652dbe9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterFlowAddTest/UIComponentListAndGridWaterFlowAdd.test.ets @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridWaterFlowAdd() { + + describe('UIComponentListAndGridWaterFlowAdd', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + .columnsTemplate("1fr 1fr") + .itemConstraintSize({minWidth:'0%',maxWidth:'50%',minHeight:'0%',maxHeight:'100%'}) + 3.编译安装demo + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011") + await Utils.sleep(1000) + + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0270_011 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap(“”) + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0130_072 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap(10) + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0140_666 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap('5vp') +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0160_890 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 + * @tc.desc 1、添加Waterflow组件 + 2、在string.json里设置string: + "name":'width_20","value':“20" + 3、设置Waterflow的属性:columnsGap($r(app.string.width_20')) + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0150_827 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:columnsGap("abc") +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0170_444 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap(“”) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0280_056 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap(10) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0290_223 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 +* @tc.desc 1、添加Waterflow组件 + 2、在string.json里设置string + "name":"height_20°,"value':‘20° + 3、设置Waterflow的属性:rowsGap($r('app.string.height_20')) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0300_414 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap('5vp') + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0310_330 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 + * @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性:rowsGap('abc') + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0320_534 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflov的属性: + columnsTemplate("1fr 1fr") + rowsTemplate("1fr 1fr 1fr') + layoutDirection(FlexDirection.ColumnReverse) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0080_458 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflov的属性: + columnsTemplate("1fr 1fr") + rowsTemplate("1fr 1fr 1fr') + layoutDirection(FlexDirection.Column) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0090_321 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + columnsTemplate(”1fr 1fr") + rowsTemplate(“ifr 1fr 1fr”) + layoutDirection(FlexDirection.RowReverse) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0100_678 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + columnsTemplate(”1fr 1fr") + rowsTemplate(“ifr 1fr 1fr”) + layoutDirection(FlexDirection.Row) +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0110_972 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 +* @tc.desc 1、添加Waterflow组件 + 2、设置Waterflow的属性: + colunnsTenplate(”1fr 1fr") + rowsTemplate(“1fr lfr 1fr') + 不设置layoutDirection +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_ADD_0120_725 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0bd9f7c778dbe844413096c0c1d2d53ffcbd3ec4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridWaterSectionsTest/UIComponentListAndGridWaterSections.test.ets @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridWaterSections() { + + describe('UIComponentListAndGridWaterSections', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 + * @tc.desc 1、创建分组瀑布流 + 2、splice方法中替换的分组不设置返回高 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0560_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0560 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的columnsGap +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0380_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0380_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0380 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 +* @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的crossCount +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0370_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0370_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0370 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 +* @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的crossCount +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0390_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0390_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的margin +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0410_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0410_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0410 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的rowsGap +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0400_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0400_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的返回高度 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0420_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0420_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0420 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 + * @tc.desc 1、创建分组瀑布流,不设置crossCount + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0500 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 + * @tc.desc 创建分组瀑布流,不设置columnsGap + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0510 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 + * @tc.desc 创建分组瀑布流,不设置rowsGap + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0520 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 +* @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 +* @tc.desc 创建分组瀑布流,不设置margin +*/ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0530 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 + * @tc.desc 1、创建分组瀑布流 + 2、push进一个分组 + 3、改变分组的返回高度 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentListAndGridWaterSections0540_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_WATERFLOW_SECTIONS_0540 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..12e9b46a299fc7bf8c4a3c3f58caf88fc3e9c9d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavModifierTest/UIComponentNavModifier.test.ets @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentNavModifier() { + + describe('UIComponentNavModifier', () => { + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 + * @tc.desc 1、添加Tabs组件 + 2、分割线设置为0xFF0000 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier046") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0460 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 + * @tc.desc 1、添加Tabs组件 + 2、设置endMargin(-10) + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier053") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier053_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0530 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 + * @tc.desc 1、添加Tabs组件 + 2、设置endMargin(-10) + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier056") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier056_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0560 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 + * @tc.desc 1、添加Tabs组件 + 2、设置endMargin(-10) + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier058") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier058_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0580 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 + * @tc.desc 1、添加Tabs组件 + 2、barWidth设置为Resource + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier083") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier083_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0830 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 + * @tc.desc 1、添加Tabs组件 + 2、分割线设置为0xffc0cb + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier048") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0480 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 + * @tc.desc 1、添加Tabs组件 + 2、分割线设置为Color.Blue + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier045") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0450 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 + * @tc.desc 1、添加Tabs组件 + 2、strokeWidth设置为string类型 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier041") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier041_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0410 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 + * @tc.desc 1、添加Tabs组件 + 2、strokeWidth设置为Resource类 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier044") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier044_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0440 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 +* @tc.desc 1、添加Tabs组件 + 2、分割线设置为Color.Blue +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier043") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier043_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0430 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 + * @tc.desc 1、添加Tabs组件 + 2、fadingEdge设置为false + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier060") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0600 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 + * @tc.desc 1、添加Tabs组件 + 2、背景色设置为’#ffffff’ + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier065") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier065_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0650 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 + * @tc.desc 1、添加Tabs组件 + 2、背景色设置为’#ffffff’ + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier063") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier063_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0630 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 + * @tc.desc 1、添加Tabs组件 + 2、背景色设置为’#ffffff’ +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier066") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier066_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0660 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 + * @tc.desc 1、添加Tabs组件 + 2、设置barWidth为'100% + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0810") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0810 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 + * @tc.desc 1、添加Tabs组件 + 2、设置barWidth为负值 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0770") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0770 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 +* @tc.desc 1、添加Tabs组件 + 2、设置barHeight为250 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0860") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0860 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 + * @tc.desc 1、添加Tabs组件 + 2、设置barHeight为小于0的数 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0840") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0840 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 + * @tc.desc 1、添加Tabs组件 + 2、设置animationDuration设置为小于0 + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0900") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('green')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0900 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 + * @tc.desc 1、添加Tabs组件 + 2、设置animationDuration设置为百分比 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0920") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('green')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0920 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 +* @tc.desc 1、添加Tabs组件 + 2、barGridAlign设置为gutter +*/ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0370") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavModifier0370_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavModifier0370_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0370 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 + * @tc.desc barGridAlign设置为sm + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0380") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0380 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0130 + * @tc.desc barGridAlign设置为lg + */ + it('SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400 start.`); + Settings.createWindow("testability/pages/UIComponentNavModifier/UIComponentNavModifier0400") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_MODIFIER_0400 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c7a17f444b30e9d3ddceef1830970449312938a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsActionTest/UIComponentNavTabsAction.test.ets @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsAction() { + + describe('UIComponentNavTabsAction', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 + * @tc.desc 1、添加Tabs组件 + 2、设置多个TabContent + 3、多次改变窗口大小,切换前后台 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsAction0011_002')); + await Utils.sleep(200) + await button.click() + await Utils.sleep(200) + await button.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsAction0011_001')); + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+100,pos.y,pos.x-300,pos.y) + await Utils.sleep(1000) + let pos1 = await tabsCenter.getBoundsCenter() + await driver.swipe(pos1.x-100,pos1.y,pos1.x+300,pos1.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0011 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 + * @tc.desc 1、在pink页面点击 + 2、点击页签切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar1:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(100) + await tabBar1.click() + await Utils.sleep(100) + let tabBar2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(100) + await tabBar2.click() + await Utils.sleep(100) + await tabBar1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0030 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 + * @tc.desc 1、添加tabs组件设置100个子组件 + 2、点击页签切换页面 + 3、滑动页面切换 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar:Component = await driver.findComponent(ON.id('tab1')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsAction0012_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await Utils.sleep(100) + + await driver.swipe(pos.x-100,pos.y,pos.x+356,pos.y) + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_ACTION_0012 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e5dabdb4539a51fcdee9aad9e8d08db5c89be36e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsBlurStyleTest/UIComponentNavTabsBlurStyle.test.ets @@ -0,0 +1,1645 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsBlurStyle() { + + describe('UIComponentNavTabsBlurStyle', () => { + + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0016_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0016 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0015_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0015 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0014_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0014 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 +* @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0013_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0013 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0012_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0012 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0017_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0017 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0011_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0011 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 + * @tc.desc 1、设置13个按钮,点击后给Tabs页签组件模糊效果改为Thin、Regular、Thick、 + BACKGROUND_THIN、BACKGROUND_REGULAR、BACKGROUND_THICK、 + BACKGROUND_ULTRA_THICK、NONE、 + COMPONENT_ULTRA_THIN、 + COMPONENT_THIN、COMPONENT_REGULAR、 + COMPONENT_THICK、COMPONENT_ULTRA_THICK + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow,Blue、Green + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + let button3: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_003')); + await Utils.sleep(100) + await button3.click() + await Utils.sleep(100) + let button4: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_004')); + await Utils.sleep(100) + await button4.click() + await Utils.sleep(100) + let button5: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_005')); + await Utils.sleep(100) + await button5.click() + await Utils.sleep(100) + let button6: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_006')); + await Utils.sleep(100) + await button6.click() + await Utils.sleep(100) + let button7: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_007')); + await Utils.sleep(100) + await button7.click() + await Utils.sleep(100) + let button8: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_008')); + await Utils.sleep(100) + await button8.click() + await Utils.sleep(100) + let button9: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_009')); + await Utils.sleep(100) + await button9.click() + await Utils.sleep(100) + let button10: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_010')); + await Utils.sleep(100) + await button10.click() + await Utils.sleep(100) + let button11: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_011')); + await Utils.sleep(100) + await button11.click() + await Utils.sleep(100) + let button12: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_012')); + await Utils.sleep(100) + await button12.click() + await Utils.sleep(100) + let button13: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0010_013')); + await Utils.sleep(100) + await button13.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(100) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0049 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度,设置 + TabBar背景颜色为backgroundColor(0xF5F5F5),设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、设置分割线线宽为strokeWidth(1),颜色为红色 + 4、添加padding设置为10vp + 5、添加按钮Button(“关闭模糊效果),添加点击效果,backgroundBlurStyle参数设置为NONE + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0048_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0048_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0048 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Fixed),所有TabBar平均分配barWidth宽度;设置 + SelecteMode =Selectedlode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0042 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Fixed),所有TabBar平均分配barWidth宽度; + * 设置Selectedlode =Selectedlode.BOARD; + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0046 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度; + 设置Selectedllode =Selectedlode.BOARD,BarMode参数设为Scrollable + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barVidth(80) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0043 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度;设置Selectedilode =Selectedlode.BOARD; + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0045 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedllode =Selectedllode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barHeight(300) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0044 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 + * @tc.desc 1、设置Tabs组件barMode(Bar)ode.Scrollable),使得每一个TabBar均使用实际布局宽度 + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0038 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 + * @tc.desc 1、设置Tabs组件barMode(BarIode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + * 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0041 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 + * @tc.desc 1、设置Tabs组件barMode(BarIode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + * 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(100) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、设置分割线线宽为strokeWidth(1),颜色为红色 + 4、添加padding设置为10vp + 5、添加按钮Button(“关闭模糊效果),添加点击效果,backgroundBlurStyle参数设置为NONE + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0039_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0039_002')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(100) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0039 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Fixed),所有TabBar平均分配barWidth宽度; + * 设置Selectedllode =Selectedlode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、YellowBlue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0033 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedilode =Selectedlode.BOARD,BarMode参数设为Scrollable + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(80) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0034 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedllode =Selectedlode.BOARD; + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 3、添加padding设置为10vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0036 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度; + * 设置Selectedllode =Selectedlode.BOARD + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barHeight(300) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0035 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度 + 2、Tabs组件中添加四个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green + 对Tabs组件添加Magin设置为12vp + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0032 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置bar0verlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(50) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0031 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 + * @tc.desc 1、设置Tabs组件barMode(Barode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置bar0verlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、TabBar设置barWidth(100) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 + * @tc.desc 1、设置Tabs组件barMode(BarMode.Scrollable),使得每一个TabBar均使用实际布局宽度, + * 设置TabBar背景颜色为backgroundColor(0xF5F5F5), + * 设置barOverlap(true) + 2、Tabs组件中添加六个TabContent,分别设置SubTabBarStyle为Pink、Yellow、Blue、Green、red、blue + 3、设置分割线线宽为strokeWidth(1),颜色为红色 + 4、添加padding设置为10vp + 5、添加按钮Button(“关闭模糊效果),添加点击效果,backgroundBlurStyle参数设置为NONE + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + await driver.delayMs(1000) + let button1: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0029_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0029_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0029 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0018_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0018 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsBlurStyle0019_001')) + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0019 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0021 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0022 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0023 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0024 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0025 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0026 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0027 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0028 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0047 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0051 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0052 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0053 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 + * @tc.desc nav width +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0110 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0160 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0170 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0180 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0190 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200', 0, async (done: Function) => { + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210', 0, async (done: Function) => { + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0210 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220', 0, async (done: Function) => { + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `ccSUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0220 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0230 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0240 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0250 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0260 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0270 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0280 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0290 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0300 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0310 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0320 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0340 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0350 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0360 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0370 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0380 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0390 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_BLURSTYLE_0400 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..764434b8c2b2c931b4e999d6ff9f380ce62b05fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsCachedCountTest/UIComponentNavTabsCachedCount.test.ets @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsCachedCount() { + + describe('UIComponentNavTabsCachedCount', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 + * @tc.desc 1、创建tabs,设置BarPosition.Start 2、设置preloadItens[1,3] + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs014_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 + * @tc.desc 1、创建tabs,设置BarPosition.End 2、设置preloadItens[1,3] + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs015_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 + * @tc.desc 1、创建tabs,设置BarPosition动态改变 + 2、设置preloadItens[1,3] + 3、动态切换BarPosition + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabs016_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CACHEDCOUNT_0160 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cf0a074255dab4bb0c450dc5eb0aca3e305bd01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsContentAdaptTest/UIComponentNavTabsContentAdapt.test.ets @@ -0,0 +1,699 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsContentAdapt() { + + describe('UIComponentNavTabsContentAdapt', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0310_001')); + await Utils.sleep(1000) + await tabBar1.click() + await Utils.sleep(1000) + await tabBar1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0310 finish.`); + done() + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 + * @tc.desc 创建横向tabs(BarPosition.Start),设置width为auto,设置每个页面宽度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 + * @tc.desc 创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 + * @tc.desc 创建横向tabs(BarPosition.End),设置height为auto,设置每个页面高度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 + * @tc.desc 创建横向tabs(BarPosition.End),设置width为auto,设置每个页面宽度不同 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width为auto,设置每个页面宽度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0110 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 + * @tc.desc 1、创建纵向tabs(BarPosition.End),设置height为auto,设置每个页面高度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 + * @tc.desc 1、创建纵向tabs(BarPosition.End),设置width为auto,设置每个页面宽度不同 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0130 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同,设置barPosition可以动态切换 + 2、动态切换barPosition属性观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabs033_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0330 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width可以动态切换(200、‘auto'、‘100%、-100) + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt034_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0340 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height可以动态切换入参(300、‘auto',50%’、-1) + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_002')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_003')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt035_004')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0350 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height可以动态切换入参(300、‘auto',50%’、-1) + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt007_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0070 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置width和height为auto,设置每个页面高度、宽度不同,设置vertical可以动态切换 + 2、动态切换vertical属性观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt032_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0320 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同,scrollable属性设置为false + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同,设置divider大小可以动态改变 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt027_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt027_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0270 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同, + * 设置divider可以动态改变颜色、前后Margin + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + let button5:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt028_005')); + await Utils.sleep(1000) + await button5.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0280 finish.`); + done() + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 +* @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto, + 设置每个页面高度不同,设置barOverlap为true + 2、编译安装查看效果 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0300 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同;设置border可以改变 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0080_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0080_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto,设置每个页面高度不同;设置border可以改变 + 2、编译安装查看效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0050 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 + * @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto + 2、页签为BottomTabbarStyle样式,动态切换barheight观察自适应情况 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0210_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0210 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 +* @tc.desc 1、创建横向tabs(BarPosition.Start),设置height为auto + 2、页签为BottomTabbarStyle样式,动态切换barwidth观察自适应情况 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0150_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width为auto + 2、页签为BottomTabbarStyle样式,动态切换barheight观察自适应情况 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0240_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 + * @tc.desc 1、创建纵向tabs(BarPosition.Start),设置width为auto + 2、页签为BottomTabbarStyle样式,动态切换barwidth观察自适应情况 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsContentAdapt0180_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0180 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0220_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0220 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0160_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0160 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0250_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0250 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0190_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0190 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0170_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0170 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 + * @tc.desc 纵向 tabs(BarPosition.Start), height: auto, change barwidth + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0200_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0200 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 + * @tc.desc 横向 tabs(BarPosition.Start), height: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0230_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0230 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 + * @tc.desc 纵向 tabs(BarPosition.Start), width: auto, change barheight + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentNavTabsContentadapt0260_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_CONTENTADAPT_0260 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c40fb8c1875d17bc8c262d644cbe1c6663924561 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsEdgeeffectTest/UIComponentNavTabsEdgeeffect.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsEdgeeffect() { + + describe('UIComponentNavTabsEdgeeffect', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0230 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EDGEEFFECT_0270 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..48b15dd262f8ad2dd0b7efab5b306eed1b0bdd05 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsExpandsafeareaTest/UIComponentNavTabsExpandsafearea.test.ets @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsExpandsafearea() { + + describe('UIComponentNavTabsExpandsafearea', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090") + await Utils.sleep(2000) + // let driver: Driver = Driver.create() + // let button: Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0050_001')) + // await button.click() + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0090 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0120 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0070 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0060 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0040 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0030 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0100 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 + * @tc.desc scroller+tab + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_EXPANDSAFEAREA_0110 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..aad3189a1be0291fbf0d0170441db0c00781eb86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsHeightTest/UIComponentNavTabsHeight.test.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsHeight() { + + describe('UIComponentNavTabsHeight', () => { + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 +* @tc.desc 1、创建tabs组件,设置tabs组件height为auto + 2、动态切换观察效果 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_HEIGHT_0010 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebabf71df0bd7811fd4ea809df34b7dce2e32766 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsImproTraceTest/UIComponentNavTabsImproTrace.test.ets @@ -0,0 +1,354 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsImproTrace() { + + describe('UIComponentNavTabsImproTrace', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、使用index切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0150_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0150_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、使用changeindex切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0140_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0140_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、更改tabscontent宽高 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0120_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0120_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、横竖屏旋转 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0080_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0080_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、滑动页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0040_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0040_002')); + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+250,pos.x-350,pos.y+250) + await Utils.sleep(1000) + await driver.swipe(pos.x,pos.y+250,pos.x+350,pos.y+250) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、滑动页签边缘, 触发边缘回弹效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0060_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0060_002')); + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y+250,pos.x+200,pos.y+250) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、滑动页面切换页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0070_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0070_002')); + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+300,pos.y,pos.x-300,pos.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、点击不同页签切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0030_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabBar:Component = await driver.findComponent(ON.id('2')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、自定义页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0020 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 + * @tc.desc 1、设置不同初始index值 + 2、设置不同的vertical(排列方向)、barMode(布局模式)、barHeight(页签高度)、barGridAlign(栅格)、direction(镜像)等属性 + 3、设置不同的页签样式,包括子页签、底部页签(image、svg、symbol格式)、自定义页签等,设置不同页签属性,如selectedMode、layoutMode、symmetricExtensible等 + 4、进入页面查看 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(100) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_002')); + await Utils.sleep(500) + await button2.click() + await Utils.sleep(100) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_003')); + await Utils.sleep(500) + await button3.click() + await Utils.sleep(100) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_004')); + await Utils.sleep(500) + await button4.click() + await Utils.sleep(100) + let button5:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_005')); + await Utils.sleep(500) + await button5.click() + await Utils.sleep(100) + let button6:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_006')); + await Utils.sleep(500) + await button6.click() + await Utils.sleep(100) + let button7:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_007')); + await Utils.sleep(500) + await button7.click() + await Utils.sleep(100) + let button8:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_008')); + await Utils.sleep(500) + await button8.click() + await Utils.sleep(100) + let button9:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0160_009')); + await Utils.sleep(500) + await button9.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、镜像测试 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0130_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsImproTrace0130_002')); + await Utils.sleep(500) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 + * @tc.desc 1、tabs组件,设置2000个子组件,TabBar设置为Scrollable + 2、首次进入页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_IMPROTRACE_0010 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..e30fe0a5afa1508c0979cc14c8e1a4cf22feb6db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterceptionTest/UIComponentNavTabsInterception.test.ets @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsInterception() { + + describe('UIComponentNavTabsInterception', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 + * @tc.desc 1、创建纵向Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return false,编译安装 + 3、手指滑动素引2页到素引3页 + 4、手指滑动素引4页到素引3页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0130_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x-56,pos.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 + * @tc.desc 1、创建Tabs包合5个TabContent,index=0 + 2、设置onContentVillChange接口,如果comingIndex为3,return false; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0040_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 + * @tc.desc 1、创建Tabs包合5个TabContent,index=0 + 2、设置onContentVillChange接口,如果comingIndex为3,return false; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0060_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 + * @tc.desc 1、创建Tabs包合5个TabContent,index=0 + 2、设置onContentVillChange接口,如果comingIndex为3,return false; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar:Component = await driver.findComponent(ON.id('我的')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWillChange接口,如果comingIndex为3,return true; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0050_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWillChange接口,如果comingIndex为3,return true; + 设置TabsController.changeIndex。编译安装 + 3、点击按钮切换到素引3的页签(调用changeIndex) + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0070_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWillChange接口,如果currentIndex为2,coningIndex为3,return false,编译安装 + 3、手指滑动索引2页面到素引3页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0010_002')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0010_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x+100,pos.y,pos.x-356,pos.y) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 + * @tc.desc 1、创建Tabs包含5个TabContent,index=3 + 2、设置onContentVil1Change接口,如果comingIndex为3,return true,编译安装 + 3、手指滑动素引2页到素引3页 + 4、手指滑动素引4页到索引3页 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0030_002')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0030_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x+100,pos.y,pos.x-356,pos.y) + await Utils.sleep(2000) + + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0030_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + + await driver.swipe(pos.x-100,pos.y,pos.x+356,pos.y) + await Utils.sleep(1000) + + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0030 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0,设置TabContent可动态改变个数 + 2、设置onContentWil1Change接口,如果comingIndex为3,return false,编译安装 + 3、点击按钮动态减少、增加TabContent + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0150_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterception0150_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 + * @tc.desc 1、创建Tabs包含5个TabContent,index=0 + 2、设置onContentWil1Change接口,如果comingIndex为3,return true,编译安装 + 3、点击素引3页的tabbar + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar:Component = await driver.findComponent(ON.id('我的')); + await Utils.sleep(1000) + await tabBar.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERCEPTION_0090 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..826714182f47bfdb0b6470b6407a34dc0c625ce6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsInterfaceTest/UIComponentNavTabsInterface.test.ets @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsInterface() { + + describe('UIComponentNavTabsInterface', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 + * @tc.desc 1、添加Tabs组件 + 2、设置index:0 + 3、设置TabContent数量为4 + 4、设置barwidth超过容器宽度 + 6、不设置属性fadingEdge + 7、编译安装 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 + * @tc.desc 1、添加Tabs组件 + 2、添加TabContent + 3、设置选中位置为新添加的位置 + 4、编译安装 + 5、动态增加tab页签个数 + 6、观察选中状态的位置 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsInterface1190_001')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 + * @tc.desc 1、添加Tabs组件 + 2、添加TabContent + 3、第一个tabcontent右滑 + 4、边缘效果未结束前点击返回 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220") + await Utils.sleep(1000) + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let tabsCenter :Component = await driver.findComponent(ON.id('UIComponentNavTabsInterface1220_001')) + await Utils.sleep(1000) + let pos = await tabsCenter.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x-100,pos.y) + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_INTERFACE_1220 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..66e339f31b8f9cc6d50f0b85ff6ea41ee5e74db9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsMirrorTest/UIComponentNavTabsMirror.test.ets @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsMirror() { + + describe('UIComponentNavTabsMirror', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 + * @tc.desc 1、创建横向tabs页签位置BarPosition.Start,设置barOverlap属性 + 2、设置direction可以动态改变 + 3、动态切换镜像方向观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror010_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0100 finish.`); + done() + }) + + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0070 + * @tc.desc 1、创建tabs布局方向可以动态改变更新转测版本,新建ets页面 + 2、设置direction可以动态改变 + 3、动态切换属性观察效果 + */ + it('SUB_ACE_UI_0OMPONENT_NAV_TABS_MIRROR_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_0OMPONENT_NAV_TABS_MIRROR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0070_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_0OMPONENT_NAV_TABS_MIRROR_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 + * @tc.desc 1、创建横向tabs页签位置可以动态改变 + 2、设置direction可以动态改变 + 3、动态切换镜像方向观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0030_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 + * @tc.desc 1、创建横向tabs页签位置BarPosition.Start + 2、设置direction可以动态改变 + 3、动态切换镜像方向观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0090_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0090 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 + * @tc.desc 1、创建tabs,设置SubTabBarStyle样式 + 2、设置镜像效果 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0110_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 + * @tc.desc 1、创建tabs,设置SubTabBarStyle样式 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0160_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0160 finish.`); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 + * @tc.desc 1、创建tabs,设置BottomTabBarStyle样式 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0120_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0120 finish.`); + done() + }) + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 + * @tc.desc 1、创建tabs,设置BottomTabBarStyle样式 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0140_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 + * @tc.desc 1、创建tabs,设置tabbar布局模式设为BarMode.Scrollable + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0130_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 + * @tc.desc 1、创建tabs,tabbar设置padding动态改变 + 2、设置镜像效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0150_001')); + await Utils.sleep(500) + await button1.click() + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0150_002')); + await Utils.sleep(500) + await button2.click() + await Utils.sleep(100) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0150 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 + * @tc.desc 1、创建tabs嵌套横向list + 2、设置镜像效果 + 3、切换页签 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let tabBar0:Component = await driver.findComponent(ON.id('Tab0')); + await Utils.sleep(1000) + await tabBar0.click() + await Utils.sleep(1000) + let tabBar1:Component = await driver.findComponent(ON.id('Tab1')); + await Utils.sleep(1000) + await tabBar1.click() + await Utils.sleep(1000) + await tabBar0.click() + await Utils.sleep(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0260_001')); + await Utils.sleep(200) + await button.click() + await Utils.sleep(200) + await button.click() + await Utils.sleep(200) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0260 finish.`); + done() + }) + + + /* +* @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 +* @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 +* @tc.desc 1、创建tabs嵌套web + 2、设置镜像效果 + 3、切换页签 +*/ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror0250_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 + * @tc.desc 1、创建tabs,设置divider的前后Margin动态改变 + 2、设置direction可以动态改变 + 3、动态切换属性观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_002')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + let button3:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_003')); + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(1000) + let button4:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_004')); + await Utils.sleep(1000) + await button4.click() + await Utils.sleep(1000) + let button5:Component = await driver.findComponent(ON.id('UIComponentNavTabsMirror080_005')); + await Utils.sleep(1000) + await button5.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_MIRROR_0080 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..acfc595c35a3fcee873ac41bd734968ed43fc563 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsOnWillShowTest/UIComponentNavTabsOnWillShow.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsOnWillShow() { + + describe('UIComponentNavTabsOnWillShow', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 + * @tc.desc 1、创建tabs组件,包含子组件TabContent + 2、点击底部页签或侧边页签 +*/ + it('SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('tab2')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('tab_2')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TABS_ONWILLSHOW_0190 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..577359a2b716e31c682a93610342017ec229f0fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsSubTabbarStyleTest/UIComponentNavTabsSubTabbarStyle.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsSubTabbarStyle() { + + describe('UIComponentNavTabsSubTabbarStyle', () => { + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 + * @tc.desc 1、创建tabs组件 + 2、页签为SubTabbarStyle样式,页签设置为svg图片+文本 + 3、切换页面 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(100) + await button1.click() + await Utils.sleep(100) + let button2:Component = await driver.findComponent(ON.id('Yellow')); + await Utils.sleep(100) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_SUBTABBARSTYLE_0010 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..54b79ec31f3f5ba9066214dd83618a1c419187a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentNavTabsWidthTest/UIComponentNavTabsWidth.test.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentNavTabsWidth() { + + describe('UIComponentNavTabsWidth', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 + * @tc.name SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 + * @tc.desc 1、创建tabs组件,设置tabs组件width为auto + 2、动态切换观察效果 + */ + it('SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 start.`); + Settings.createWindow("testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_NAV_TABS_WIDTH_0010 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..a86014eb02d477754646809d0d45533d8da4a822 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshAbilityTest/UIComponentOtherRefreshAbility.test.ets @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshAbility() { + + describe('UIComponentOtherRefreshAbility', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 + * @tc.desc 创建Refresh组件,设置refreshOffset(-1),编译安装 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0080 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 + * @tc.desc 创建Refresh组件,设置refreshOffset(0),编译安装 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 + * @tc.desc 创建Refresh组件,组件高度为499,设置refreshOffset(500),编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 + * @tc.desc 创建Refresh组件,设置refreshOffset(70),编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 + * @tc.desc 创建Refresh组件,设置refreshOffset(60.5)编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 + * @tc.desc 创建Refresh组件,设置pullToRefresh值可以动态修改,编译安装 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button:Component = await driver.findComponent(ON.id('UIComponentOtherRefreshAbility0040_001')); + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_ABILITY_0040 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5982175f3a3a9ba4c186c19b9337d12d3bae81f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterActionTest/UIComponentOtherRefreshInterAction.test.ets @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshInterAction() { + + describe('UIComponentOtherRefreshInterAction', () => { + + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 + * @tc.desc 1、进入list builder不设置宽高页面 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 + * @tc.desc 1、进入list设置高度大于刷新区域页面 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 + * @tc.desc 1、进入list固定高度页面 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 + * @tc.desc 1、进入list builder宽高设置百分比 + 2、下拉组件刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+400) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERACTION_0410 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..5243db1f0b868ca6b54197d73bfb65d499e168e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshInterfaceTest/UIComponentOtherRefreshInterface.test.ets @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshInterface() { + + describe('UIComponentOtherRefreshInterface', () => { + + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 + * @tc.desc 1、Refresh的offset参数:string :'0'设置friction:100 + 2、页面下拉 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0140 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 + * @tc.desc 1、Refresh的offset参数:nunber :-100,设置friction:100 + 2、页面下拉 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 + * @tc.desc 1、Refresh的offset参数:number :0 设置friction:100 + 2、页面下拉 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_INTERFACE_0180 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1c73b54f9e9d514fe6d425f5bc1449316efd3d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherRefreshPromptTextTest/UIComponentOtherRefreshPromptText.test.ets @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentOtherRefreshPromptText() { + + describe('UIComponentOtherRefreshPromptText', () => { + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 + * @tc.desc 1、创建refresh,设置自定义文本为Resource类型的混合内容 + 2、下拉刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 + * @tc.desc 1、创建refresh,设置自定义文本为Resource类型的特殊字符 + 2、下拉刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0100 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 + * @tc.desc 1、创建refresh,设置自定义文本为字符串类型的混合内容 + 2、下拉刷新 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0060 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 +* @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 +* @tc.desc 1、创建refresh,设置自定义文本为字符串类型的特殊字符 + 2、下拉刷新 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0050 finish.`); + done() + }) + + /* +* @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 +* @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 +* @tc.desc 1、创建refresh,设置自定义文本为字符串类型的超长文本 + 2、下拉刷新 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0120 finish.`); + done() + }) + /* +* @tc.number SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 +* @tc.name SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 +* @tc.desc 1、创建refresh,设置自定义文本为字符串类型的超长文本 + 2、下拉刷新 +*/ + it('SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let refreshListItem0 :Component = await driver.findComponent(ON.id('0')) + await Utils.sleep(200) + let pos = await refreshListItem0.getBoundsCenter() + await Utils.sleep(100) + await driver.swipe(pos.x,pos.y,pos.x,pos.y+200) + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_OTHER_REFRESH_PROMPTTEXT_0040 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..17371bd33b6103d8cb1a19d02cc62a1ef53345e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentTabTabBarSymbolTest/UIComponentTabTabBarSymbol.test.ets @@ -0,0 +1,417 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentTabTabBarSymbol() { + + describe('UIComponentTabTabBarSymbol', () => { + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + * 2、icon使用TabBarSymbol引入其他资源;selected态传系统Symbol资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('Blue')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + let button2:Component = await driver.findComponent(ON.id('Pink')); + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0040 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 + * @tc.desc 1、创建tabs,BottomTabBarStyle,icon使用TabBarSymbol + * 2、normal态SymbolGlphlIodifier设置fontSize设置大于vidth和height的值 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0090 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier设置null + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0120 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier设置undefined + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier渲染策略为MULTIPLE_COLOR,设置4个fontcolor属性 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0070 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier渲染策略为OPACITY,设置4个fontcolor属性 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0080 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSyabol + * 2、normal态SymbolGlphlIodifier渲染策略为单色,设置4个fontcolor属性 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0060 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、normal态SymbolGlphlIodifier设置可以动态切换入参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0140_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0140 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、nornal态SymbolGlyphModifier设置可以动态切换入 +参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0130_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0130 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、nornal态SymbolGlyphModifier设置可以动态切换入参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0260_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、nornal态SymbolGlyphModifier设置可以动态切换入参 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + let button1:Component = await driver.findComponent(ON.id('UIComponentTabTabBarSymbol0190_001')); + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、selected态SymbolGlphlIodifier不设置 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0180 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、selected态SymbolGlphlIodifier设置null + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0160 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + * 2、selected态SymbolGlphlIodifier设置undefined + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + 2、icon使用TabBarSymbol引入其他资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0030 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + * 2、icon使用TabBarSymbol引入系统media资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0020 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 + * @tc.desc 1、创建tabs,使用BottomTabBarStyle样式 + * 2、icon使用TabBarSymbol引入系统symbol资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0010 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSymbol + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 + * @tc.desc 1、创建tabs,BottonTabBarStyle,icon使用TabBarSynbol + * 2、normal态SymbolGlphIodifier引入系统symbol资源 + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0150 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 + * @tc.desc TabBarSynbol.normal & selected + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentTabTabbarTabbarsymbol0050_001')) + await button.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0050 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0240 finish.`); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 + * @tc.name SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 + * @tc.desc nav width + */ + it('SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 start.`); + Settings.createWindow("testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250") + await Utils.sleep(1000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TAB_TABBAR_TABBARSYMBOL_0250 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable001.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce563b90c4e724a4f104d65714b79b980ab56ab3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable001.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabScrollable001 { + @State scrollable: boolean = true; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(false).scrollable(this.scrollable).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('ArkUITabScrollable001_001') + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.scrollable = !this.scrollable; + }).id('ArkUITabScrollable001_002'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable002.ets new file mode 100644 index 0000000000000000000000000000000000000000..227af26c95835a6b4bb6af9f4ea1a932470f76de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabScrollable/ArkUITabScrollable002.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabScrollable0012 { + @State scrollable: boolean = true; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(false).scrollable(this.scrollable).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('ArkUITabScrollable002_001') + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.scrollable = !this.scrollable; + }).id('ArkUITabScrollable002_002'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb8627a2dce1480130aa67c08cdc253782708e37 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor001 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Black }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004.ets new file mode 100644 index 0000000000000000000000000000000000000000..33230a59147f3975f24f3603ec1f7893e5317662 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor004 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Gray }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: Color.Gray }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008.ets new file mode 100644 index 0000000000000000000000000000000000000000..b7e659d37151d474a06f026c894bc423acaa36b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor008 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Red }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: Color.Red }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013.ets new file mode 100644 index 0000000000000000000000000000000000000000..81885689f95d87e504dceb85a967758d6a0d6c68 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor013 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0xa52a2a }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: 0xa52a2a }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014.ets new file mode 100644 index 0000000000000000000000000000000000000000..526dc72ce4d26c23f54977415ac60f0f1039cacc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor014 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0x808080 }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: 0x808080 }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bdbf643db4447f2c2867e7ddf9a8b6562035c1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor022 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: "#ff000000" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: "#ff000000" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..d53645f86da7899cb5041b1107a4fab5a70a04f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: "rgba(255,100,255,0.5)" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: "rgba(255,100,255,0.5)" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e01b109a06668fd66fb3b426888f84df5bfb992 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor025 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: $r("sys.color.titlebar_title_tertiary_color") }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: $r("sys.color.titlebar_title_tertiary_color") }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..245d756fd9edf1296183ec92b2ce7b17f6426116 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor026 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..25d18afa27537b2d0b0e30491962a6dc9fe898f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor027 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..35ba4cc2be89f3501c69d426b10f46731770e0b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor028 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: undefined }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: undefined }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029.ets new file mode 100644 index 0000000000000000000000000000000000000000..894d8261d83f94e60be7984185f1277d3be45726 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleSelectedColor029 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: null }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ selectedColor: null }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a4d2db019bc0d3d93b465cefa8e098c91dd3ca5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor002 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: Color.Brown }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: Color.Brown }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..308ecaacc1f21bd33660512c798f8ffb1f4d6ca7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor005 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: Color.Orange }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: Color.Orange }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014.ets new file mode 100644 index 0000000000000000000000000000000000000000..4ecbc71ea63d93239376fa9c974d1166c45c2bea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor014 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: 0x008000 }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: 0x008000 }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016.ets new file mode 100644 index 0000000000000000000000000000000000000000..65a40b9871fa0f47bef4c783db92752631238ba5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor016 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: 0xffc0cb }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: 0xffc0cb }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021.ets new file mode 100644 index 0000000000000000000000000000000000000000..2284a438a92220937581b822af538eeff0839891 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor021 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: "#ff000000" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: "#ff000000" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022.ets new file mode 100644 index 0000000000000000000000000000000000000000..f988abd067cb87f6da9fecb698428247cf4aff67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor022 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: "rgb(255,100,255)" }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: "rgb(255,100,255)" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..cd5e60d077f3aeb46a91369c5d9e0085cdcf4a34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: $r("sys.color.toast_outer_border_color") }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f3c4e3e136fd82a5fefef1487e6f3fed11a57d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor026 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: 0xFFFFFFFFFFFFFFFF }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..a334b5c50862bdb667eada21d6054e33dfb525d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor027 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: undefined }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: undefined }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fd1583cd146e63b08e79e15e8c146cb67eb0bc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor028 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: null }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: null }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029.ets new file mode 100644 index 0000000000000000000000000000000000000000..c147e8ad505fc52d4204096c343b4b4b814d1eb6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsIconStyleUnselectedColor029 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ unselectedColor: Color.Black }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .iconStyle({ unselectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..1613875cecad8683e273e64299f04911230b9722 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor001 { + @State labelSelectedColor: number = Color.Black; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Black) { + this.labelSelectedColor = Color.Green; + } + else + { + this.labelSelectedColor = Color.Black; + } + }).id('ArkUITabsLabelStyleSelectedColor001_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ef507ac66923b2cc463f92088f5d6a565277fe4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor003 { + @State labelSelectedColor: number = Color.Brown; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Brown) { + this.labelSelectedColor = Color.Green; + } + else + { + this.labelSelectedColor = Color.Brown; + } + }).id('ArkUITabsLabelStyleSelectedColor003_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b749e4d54a19f29810bb45707b5f17ed3ea9dd1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor005 { + @State labelSelectedColor: number = Color.Green; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Green) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.Green; + } + }).id('ArkUITabsLabelStyleSelectedColor005_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007.ets new file mode 100644 index 0000000000000000000000000000000000000000..14e22b1c6a709eb5cdf4528dc1c2b77602f72399 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor007 { + @State labelSelectedColor: number = Color.Pink; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Pink) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.Pink; + } + }).id('ArkUITabsLabelStyleSelectedColor007_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009.ets new file mode 100644 index 0000000000000000000000000000000000000000..6739639bab6b0fb57e70d83663e61c235fd5f91e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor009 { + @State labelSelectedColor: number = Color.White; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.White) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.White; + } + }).id('ArkUITabsLabelStyleSelectedColor009_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011.ets new file mode 100644 index 0000000000000000000000000000000000000000..54e8c1345996f3ff3a72a72d4091940f06e9315e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor011 { + @State labelSelectedColor: number = Color.Transparent; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == Color.Transparent) { + this.labelSelectedColor = Color.Yellow; + } + else + { + this.labelSelectedColor = Color.Transparent; + } + }).id('ArkUITabsLabelStyleSelectedColor011_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012.ets new file mode 100644 index 0000000000000000000000000000000000000000..e39e813c4fed2f64f7bcf8c06545c3771f1f8e01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor012 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = 0x000000; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor012_001') + .onClick(() => { + this.selectedColor = 0xffffff; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013.ets new file mode 100644 index 0000000000000000000000000000000000000000..929d7feef0bbe548da86be553c034dfbef70ffe9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor013 { + @State labelSelectedColor: number = 0x00FF00; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x00FF00) { + this.labelSelectedColor = 0xa52a2a; + } + else + { + this.labelSelectedColor = 0x00FF00; + } + }).id('ArkUITabsLabelStyleSelectedColor013_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015.ets new file mode 100644 index 0000000000000000000000000000000000000000..5acdd9e4200d953ad69cc87fb7e524849db679f9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor015 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = 0x008000; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor015_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017.ets new file mode 100644 index 0000000000000000000000000000000000000000..3abc891632575a58f7456de37dca83b8cb19ca36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor017 { + @State labelSelectedColor: number = 0x00FF00; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x00FF00) { + this.labelSelectedColor = 0xffc0cb; + } + else + { + this.labelSelectedColor = 0x00FF00; + } + }).id('ArkUITabsLabelStyleSelectedColor017_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019.ets new file mode 100644 index 0000000000000000000000000000000000000000..48f91e0810a544e7cc759ccfe37c754b32452caa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor019 { + @State labelSelectedColor: number = 0x00FF00; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x00FF00) { + this.labelSelectedColor = 0xffffff; + } + else + { + this.labelSelectedColor = 0x00FF00; + } + }).id('ArkUITabsLabelStyleSelectedColor019_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021.ets new file mode 100644 index 0000000000000000000000000000000000000000..e627174e33ce0242a451b1e8ef8e1d545b7543bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor021 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = '#ffffff'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor021_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023.ets new file mode 100644 index 0000000000000000000000000000000000000000..eb707990bb88d38adfe8b6dbfebbe3c4ac3fde5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor023 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = "rgb(255,100,255)"; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor023_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..39b3424104e8b5a1be0dbb70c301931d34ed4061 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = "rgba(255,100,255,0.5)"; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor024_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025.ets new file mode 100644 index 0000000000000000000000000000000000000000..7fb514c010eff71e5d92dce7f846e47c3c76de0f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor025 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = '#ff0000ff'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor025_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..f73061a7eb2772b59a967afeecab893a1380cc7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor026 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor = $r('sys.color.titlebar_title_tertiary_color'); + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor026_001') + .onClick(() => { + this.selectedColor = Color.Black; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..38310e87969e61309f5489c1bd11ef3cb7375f7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor027 { + @State labelSelectedColor: number = 0x0000FF; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == 0x0000FF) { + this.labelSelectedColor = 0xFFFFFFFFFFFFFFFF; + } + else + { + this.labelSelectedColor = 0x0000FF; + } + }).id('ArkUITabsLabelStyleSelectedColor027_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..34b2ea5db5b616cc0dcc590e4727ae240d31cb38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleSelectedcolor028 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State selectedColor: ResourceColor | undefined = undefined; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('selectedColor') + .id('ArkUITabsLabelstyleSelectedcolor028_001') + .onClick(() => { + this.selectedColor = 0xfffffffffffffff; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ selectedColor: this.selectedColor }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029.ets new file mode 100644 index 0000000000000000000000000000000000000000..156a1898f7be046b2e3a0b7386e4be3c70f5b6d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleSelectedColor029 { + @State labelSelectedColor: string = '#00FF00'; + build() { + Column({ space: 5 }) { + Button('selectedColor设置').width('50%') + .onClick(() => { + if(this.labelSelectedColor == '#00FF00') { + this.labelSelectedColor = 'null'; + } + else + { + this.labelSelectedColor = '#00FF00'; + } + }).id('ArkUITabsLabelStyleSelectedColor029_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: this.labelSelectedColor })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001.ets new file mode 100644 index 0000000000000000000000000000000000000000..65ea22a683e9b86a6981228216dec0f503047eaa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor001 { + @State labelUnselectedColor: number = Color.Blue; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == Color.Blue) { + this.labelUnselectedColor = Color.Red; + } + else + { + this.labelUnselectedColor = Color.Blue; + } + }).id('ArkUITabsLabelStyleUnselectedColor001_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..0869713503b40c26d459555c00e3460716b131f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor005 { + @State labelUnselectedColor: number = Color.Orange; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == Color.Orange) { + this.labelUnselectedColor = Color.Red; + } + else + { + this.labelUnselectedColor = Color.Orange; + } + }).id('ArkUITabsLabelStyleUnselectedColor005_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008.ets new file mode 100644 index 0000000000000000000000000000000000000000..190e975d33b19c4edd02219bde199dbb30a8332a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor008 { + @State labelUnselectedColor: number = Color.White; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == Color.White) { + this.labelUnselectedColor = Color.Red; + } + else + { + this.labelUnselectedColor = Color.White; + } + }).id('ArkUITabsLabelStyleUnselectedColor008_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Yellow })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011.ets new file mode 100644 index 0000000000000000000000000000000000000000..030351cac742add88a0d44ce51e3c28651ac67c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor011 { + @State labelUnselectedColor: number = 0x000000; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0x000000) { + this.labelUnselectedColor = 0xFF0000; + } + else + { + this.labelUnselectedColor = 0x000000; + } + }).id('ArkUITabsLabelStyleUnselectedColor011_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7616de76b4419456e8c41383d96ce65f3236fca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor012 { + @State labelUnselectedColor: number = 0xa52a2a; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0xa52a2a) { + this.labelUnselectedColor = 0xFF0000; + } + else + { + this.labelUnselectedColor = 0xa52a2a; + } + }).id('ArkUITabsLabelStyleUnselectedColor012_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017.ets new file mode 100644 index 0000000000000000000000000000000000000000..fae35e541b7cd8e1b6fc9df8e305e7b4dbfb63e5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor017 { + @State labelUnselectedColor: number = 0xFF0000; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0xFF0000) { + this.labelUnselectedColor = 0x00FF00; + } + else + { + this.labelUnselectedColor = 0xFF0000; + } + }).id('ArkUITabsLabelStyleUnselectedColor017_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021.ets new file mode 100644 index 0000000000000000000000000000000000000000..846a07903dc9de6799aee48df6ce915ec7b98226 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor021 { + @State labelUnselectedColor: string = '#ff000000'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == '#ff000000') { + this.labelUnselectedColor = '#FF0000'; + } + else + { + this.labelUnselectedColor = '#ff000000'; + } + }).id('ArkUITabsLabelStyleUnselectedColor021_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022.ets new file mode 100644 index 0000000000000000000000000000000000000000..356eb5b358b8a44a58fe7d3865b5eb35bcfa0c4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor022 { + @State labelUnselectedColor: string = 'rgb(255,100,255)'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 'rgb(255,100,255)') { + this.labelUnselectedColor = 'rgb(255,0,0)'; + } + else + { + this.labelUnselectedColor = 'rgb(255,100,255)'; + } + }).id('ArkUITabsLabelStyleUnselectedColor022_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024.ets new file mode 100644 index 0000000000000000000000000000000000000000..964205e6c98681a3a2594ac710b6fa30250ee4ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleUnselectedcolor024 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State unselectedColor: ResourceColor = "#ff0000ff"; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('unselectedColor') + .id('ArkUITabsLabelstyleUnselectedcolor024_001') + .onClick(() => { + this.unselectedColor = Color.Red; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: this.unselectedColor }) + ) + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Blue) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Blue') + .labelStyle({ unselectedColor: this.unselectedColor }) + ) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025.ets new file mode 100644 index 0000000000000000000000000000000000000000..977511856933e148dc18fb69c5778fbb26d7f421 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor025 { + @State resourceColorPink: Resource = $r('app.color.Pink'); + @State resourceColorRed: Resource = $r('app.color.colorRed'); + @State labelUnselectedColor: Resource = $r('app.color.Pink'); + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == this.resourceColorPink) { + console.info("this.labelUnselectedColor is pink") + this.labelUnselectedColor = this.resourceColorRed; + } + else + { + console.info("this.labelUnselectedColor is red") + this.labelUnselectedColor = this.resourceColorPink; + } + }).id('ArkUITabsLabelStyleUnselectedColor025_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd5eaa7e4727e92927a53f9cfdece5eedc0d225c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor026 { + @State labelUnselectedColor: number = 0xFFFFFFFFFFFFFFFF; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 0xFFFFFFFFFFFFFFFF) { + this.labelUnselectedColor = 0xFF0000; + } + else + { + this.labelUnselectedColor = 0xFFFFFFFFFFFFFFFF; + } + }).id('ArkUITabsLabelStyleUnselectedColor026_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027.ets new file mode 100644 index 0000000000000000000000000000000000000000..11efb2e4f68967d90e67ab1ede8acce2e269c7a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor027 { + @State labelUnselectedColor: string = 'undefined'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 'undefined') { + this.labelUnselectedColor = '#FF0000'; + } + else + { + this.labelUnselectedColor = 'undefined'; + } + }).id('ArkUITabsLabelStyleUnselectedColor027_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028.ets new file mode 100644 index 0000000000000000000000000000000000000000..26deca367ec3abdce7ce9a5cbe43a1bfebcecbfb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStyleUnselectedColor028 { + @State labelUnselectedColor: string = 'null'; + build() { + Column({ space: 5 }) { + Button('unselectedColor设置').width('50%') + .onClick(() => { + if(this.labelUnselectedColor == 'null') { + this.labelUnselectedColor = '#FF0000'; + } + else + { + this.labelUnselectedColor = 'null'; + } + }).id('ArkUITabsLabelStyleUnselectedColor028_001'); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: this.labelUnselectedColor, selectedColor: Color.Blue })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200); + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001.ets new file mode 100644 index 0000000000000000000000000000000000000000..52c7ba630bdc7788330ef365f907a777d3317187 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont001 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontSize: Length = '20px'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont001_001') + .onClick(() => { + this.fontSize = '10px'; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { size: this.fontSize } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003.ets new file mode 100644 index 0000000000000000000000000000000000000000..099915a8757ae0ad7bb2a8e2a88fe504b46f200b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont003 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontSize: Length = '50%'; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont003_001') + .onClick(() => { + this.fontSize = '100%'; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { size: this.fontSize } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004.ets new file mode 100644 index 0000000000000000000000000000000000000000..a6905b53286393295cc558c7f871f7ef141748f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont004 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontSize: Length = 10; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont004_001') + .onClick(() => { + this.fontSize = 30; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { size: this.fontSize } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005.ets new file mode 100644 index 0000000000000000000000000000000000000000..83d3010d46e178f6e5d773fec623f08d29699c65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont005 { + @State message: string = 'Hello World'; + @State labelFontSize: number = 20; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('fontsize设置').width('50%') + .onClick(() => { + if (this.labelFontSize == 20) { + this.labelFontSize = 0; + } + else { + this.labelFontSize = 20; + } + }).id('ArkUITabsLabelStylefont005_001'); + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { size: this.labelFontSize } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006.ets new file mode 100644 index 0000000000000000000000000000000000000000..9db3b0af02d8ee2673837b8316a704fdca516641 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont006 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({font: {size: -1}}) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8b2010de3f33e506bd4439fb0a861db80d31e4a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont007 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Lighter; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008.ets new file mode 100644 index 0000000000000000000000000000000000000000..3ac31dc7ba8311ef44d75597fed98375969d8ee2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont008 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Normal; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a2ac75fc0cc44466320b5f55dff0227894dbf2c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont009 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Regular; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010.ets new file mode 100644 index 0000000000000000000000000000000000000000..aab1b4a317cd4c3de235819400cd6e961b0b9de3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont010 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Medium; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011.ets new file mode 100644 index 0000000000000000000000000000000000000000..60e17336dd1ba18319e33e3ad6fc52c89c160e3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont011 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = FontWeight.Bold; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012.ets new file mode 100644 index 0000000000000000000000000000000000000000..0cc227dbbf1199678bf51d9a117dc503c94a8329 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont012 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontWeight: FontWeight | number | string = FontWeight.Bolder; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont012_001') + .onClick(() => { + this.fontWeight = FontWeight.Lighter; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { weight: this.fontWeight } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013.ets new file mode 100644 index 0000000000000000000000000000000000000000..895e7769bf0d98544063cb88f3e10f137f8ec8e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont013 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontWeight: FontWeight | number | string = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont013_001') + .onClick(() => { + this.fontWeight = 800; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { weight: this.fontWeight } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015.ets new file mode 100644 index 0000000000000000000000000000000000000000..e06a6ea5e397765e70a29865c8b62ef813d6df8f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont015 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = 900; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('fontsize设置').width('50%') + .onClick(() => { + if (this.labelFontWeight == 900) { + this.labelFontWeight = 0; + } + else { + this.labelFontWeight = 900; + } + }).id('ArkUITabsLabelStylefont015_001'); + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a7345677ccc1340cb57986e605d81db5dc32c08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont016 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = 900; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('fontsize设置').width('50%') + .onClick(() => { + if (this.labelFontWeight == 900) { + this.labelFontWeight = -1; + } + else { + this.labelFontWeight = 900; + } + }).id('ArkUITabsLabelStylefont016_001'); + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017.ets new file mode 100644 index 0000000000000000000000000000000000000000..e6824cd17f99d3cba300c32618ab4a87d9a4c481 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont017 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontStyle: FontStyle = FontStyle.Normal; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont017_001') + .onClick(() => { + this.fontStyle = FontStyle.Italic; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { style: this.fontStyle } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b602d44bbd04002505f706ae81be20aa7295eb4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont018 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State fontStyle: FontStyle = FontStyle.Italic; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('fontSize') + .id('ArkUITabsLabelstyleFont018_001') + .onClick(() => { + this.fontStyle = FontStyle.Normal; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ font: { style: this.fontStyle } }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b8069b3591b266ef79b3c7cffdeb592663e2ef6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelstyleFont019 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({font: undefined}) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020.ets new file mode 100644 index 0000000000000000000000000000000000000000..1d8da7d24fc3d7d5beb73e60a212573602856d75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsLabelStylefont020 { + @State message: string = 'Hello World'; + @State labelFontWeight: number = 1000; + private controller: TabsController = new TabsController() + @State subTabOverflowOpaque: boolean = true; + + build() { + Column() { + Button('字体改变').width('50%') + .onClick(() => { + if (this.labelFontWeight == 1000) { + this.labelFontWeight = 900; + } + else { + this.labelFontWeight = 1000; + } + }).id('ArkUITabsLabelStylefont020_001'); + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('tabcontent1').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab1') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent2').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab2') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent3').fontSize(30).fontColor(0xFF000000) + }.width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('tab3') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + + TabContent() { + Column() { + Text('tabcontent4').fontSize(30).fontColor(0xFF000000) + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('tab4') + .labelStyle({ + overflow: TextOverflow.Ellipsis, + maxLines: 1, + minFontSize: 10, + heightAdaptivePolicy: TextHeightAdaptivePolicy.MAX_LINES_FIRST, + font: { weight: this.labelFontWeight } + })); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barHeight(200) + .barWidth(720) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('100%') + .width('100%'); + + } + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002.ets new file mode 100644 index 0000000000000000000000000000000000000000..355101f513b88d95722448faa4527fa908036a02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor002 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.White }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3a4758fb974b0b014c8be942e43e6ac83c2f39b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor005 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Green }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008.ets new file mode 100644 index 0000000000000000000000000000000000000000..79c717ec19c850fea4f1e934b6aa104e5bbb24bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor008 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: 0xffffff }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011.ets new file mode 100644 index 0000000000000000000000000000000000000000..45353e1e50a3db2e08b5d7571d6e13af6545c637 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsSingleSelectedcolor011 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: "rgb(255,100,255)" }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003.ets new file mode 100644 index 0000000000000000000000000000000000000000..a0dcbb665844f9be501fa1157dc7c5ce9ea50b17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003.ets @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsSingleUnselectedcolor003 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .iconStyle({ selectedColor: Color.Transparent }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsVertical/ArkUITabsVertical001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsVertical/ArkUITabsVertical001.ets new file mode 100644 index 0000000000000000000000000000000000000000..094e80c7c9993379ebd817364002af569976109b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUITabsVertical/ArkUITabsVertical001.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct ArkUITabsVertical001 { + @State vertical: boolean = false; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(this.vertical).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.vertical = !this.vertical; + }).id('ArkUITabsVertical001_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806.ets new file mode 100644 index 0000000000000000000000000000000000000000..72e2fb54e7d6c1a14a8134666054eeda7c622a01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806.ets @@ -0,0 +1,273 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} +@Builder function MyGlobalBuilderFunction() +{ + Column({ space: 2 }) { + Text("WaterFlow End...").fontSize(12).height('16') + } +} +@Entry +@Component +struct FunctionJichuWaterFlow001806 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + footer: CustomBuilder = MyGlobalBuilderFunction + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 20] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 20 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 20] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + WaterFlow({ footer: this.footer, scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .id('FunctionJichuWaterFlow001806_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d6b4ed40209d5bb3be0bd480f09376a3092a693 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350.ets @@ -0,0 +1,283 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +} +@Builder function MyGlobalBuilderFunction() +{ + +} +@Entry +@Component +struct FunctionJichuWaterFlow0350 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + footer: CustomBuilder = MyGlobalBuilderFunction + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + WaterFlow({ footer: this.footer, scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .onScrollIndex((first: number, last: number) => { + // 即将触底时提前增加数据 + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + // 更新数据源后同步更新sections,修改最后一个section的FlowItem数量 + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 100; + this.sections.update(-1, newSection); + } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458.ets new file mode 100644 index 0000000000000000000000000000000000000000..f45455ea2c8a3e22f1b0b5570eb4b44463fd865a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458.ets @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0080458 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.ColumnReverse) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0080458_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321.ets new file mode 100644 index 0000000000000000000000000000000000000000..703225beaec89ee618342032004bac9960877524 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321.ets @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0090321 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.Column) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0090321_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678.ets new file mode 100644 index 0000000000000000000000000000000000000000..5a0eb84c881cf451caa1de106e3d4013e8bcbebe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678.ets @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0100678 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.RowReverse) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0100678_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f21d3552baffe9e2e18a20f4092ef0478fa7891 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972.ets @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0110972 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutDirection(FlexDirection.Row) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0110972_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725.ets new file mode 100644 index 0000000000000000000000000000000000000000..e43a0859b668c69953669809b9c12d20dc537544 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 12; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0120725 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 12; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 12]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsTemplate("1fr 1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0120725_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072.ets new file mode 100644 index 0000000000000000000000000000000000000000..90f9858bdf8be045a2d710ef921965b14b76d0b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072.ets @@ -0,0 +1,240 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0130072 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap('') + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbc72c657192fcd875218d35f2cbf4aa55dbdf9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666.ets @@ -0,0 +1,239 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0140666 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827.ets new file mode 100644 index 0000000000000000000000000000000000000000..a45ca8edba761cface9c0190677459270ea27120 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0150827 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap($r('app.string.width_20')) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0150827_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890.ets new file mode 100644 index 0000000000000000000000000000000000000000..227b4f395acfb9ebd9d95aac58773c0b8e33ce5d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890.ets @@ -0,0 +1,239 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0160890 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('5vp') + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444.ets new file mode 100644 index 0000000000000000000000000000000000000000..09f64e0225caa049ebec998df73bf2cee0bf2a8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0170444 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0170444_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f3589e478e76b8f6c4ac740d91a3f549f332f99 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011.ets @@ -0,0 +1,240 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0270011 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .itemConstraintSize({minWidth:'0%',maxWidth:'50%',minHeight:'0%',maxHeight:'100%'}) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0270011_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f3ae95bcf262c1cb3464e1e0d6c767eb95dce7f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0280056 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap('') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0280056_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223.ets new file mode 100644 index 0000000000000000000000000000000000000000..57622af02ddd5dac7b1fac4ccb14e56b22c6c0ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0290223 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0290223_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414.ets new file mode 100644 index 0000000000000000000000000000000000000000..f46d210ac0ac0e8fb227e769dd18b0111e8902ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0300414 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap($r('app.string.height_20')) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0300414_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330.ets new file mode 100644 index 0000000000000000000000000000000000000000..d59903784248888bbaefbd43d1e4d88c84dbad4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0310330 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap('5vp') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0310330_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d8f77ccc1d74d3bbda12d587b4700339caf3d97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534.ets @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= +@Entry +@Component +struct UIComponentListAndGridWaterFlowAdd0320534 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemWidthArray.push(this.getSize()) + //this.itemHeightArray.push(this.getSize()) + this.itemWidthArray.push(60) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow() { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r("app.media.waterFlowTest")) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(this.itemHeightArray[item % 10]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap('abc') + .rowsGap('abc') + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + .id('UIComponentListAndGridWaterFlowAdd0320534_001'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f41441aa330ba51c442b73d3a0fe6f737389132 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370.ets @@ -0,0 +1,287 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0370 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newCrossCount: number = 3 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: this.newCrossCount, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0370_001'); + Button('改变crossCount') + .height('5%') + .onClick(() => { + this.newCrossCount = this.newCrossCount+1 + }).id('UIComponentListAndGridWaterSections0370_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..1ecfd41bf3812d4d5806de866eea688d333e92fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380.ets @@ -0,0 +1,286 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0380 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newColumnsGap: number = 15 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: this.newColumnsGap, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0380_001'); + Button('改变ColumnsGap') + .height('5%') + .onClick(() => { + this.newColumnsGap = this.newColumnsGap+10 + }).id('UIComponentListAndGridWaterSections0380_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..5288f7e0841fa758293967bae3e7503b39409aaf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390.ets @@ -0,0 +1,286 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0390 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newItemsCount: number = 6 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: this.newItemsCount, + crossCount: 3, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0390_001'); + Button('改变itemsCount') + .height('5%') + .onClick(() => { + this.newItemsCount = this.newItemsCount+1 + }).id('UIComponentListAndGridWaterSections0390_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a80a15fa33e1867d64d26ec45f863adeaa4df2e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400.ets @@ -0,0 +1,286 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0400 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newRowsGap: number = 10 + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: 15, + rowsGap: this.newRowsGap, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0400_001'); + Button('改变rowsGap') + .height('5%') + .onClick(() => { + this.newRowsGap = this.newRowsGap + 10 + }).id('UIComponentListAndGridWaterSections0400_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..439beee8020525a019844fa8e9f6873626879438 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410.ets @@ -0,0 +1,285 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0410 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0410_001'); + Button('改变Margin') + .height('5%') + .onClick(() => { + this.sectionMargin = { top: 20, left: 10, bottom: 20, right: 10 } + }).id('UIComponentListAndGridWaterSections0410_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420.ets new file mode 100644 index 0000000000000000000000000000000000000000..dccde5cb602befbd15b6e311757d74974bfab34e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420.ets @@ -0,0 +1,290 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0420 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 2, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('push') + .height('5%') + .onClick(() => { + let newSection: SectionOptions = { + itemsCount: 6, + crossCount: 3, + columnsGap: 15, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + this.dataSource.addItem(this.oneColumnSection.itemsCount) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 1) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 2) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 3) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 5) + this.dataSource.addItem(this.oneColumnSection.itemsCount + 6) + for (let i = 10; i < 16; i++) { + this.itemHeightArray.push(this.getSize()) + } + const result: boolean = this.sections.push(newSection) + }) + .id('UIComponentListAndGridWaterSections0420_001'); + Button('改变itemHeigh') + .height('5%') + .onClick(() => { + for (let i = 0; i < 16; i++) { + this.itemHeightArray.push(30) + } + }).id('UIComponentListAndGridWaterSections0420_002'); + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500.ets new file mode 100644 index 0000000000000000000000000000000000000000..673aaef1d6c54623ccc107ee4778f85a909692fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500.ets @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0500 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510.ets new file mode 100644 index 0000000000000000000000000000000000000000..149782f8f14af53d4fd0e41857106ffedb0ca68a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510.ets @@ -0,0 +1,255 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0510 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount:2, + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount:2, + rowsGap: 5, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(20) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520.ets new file mode 100644 index 0000000000000000000000000000000000000000..30f972ba9483f8a21087273cc0b4c8cf325e679f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520.ets @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0520 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount:2, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount:2, + onGetItemMainSizeByIndex: (index: number) => { + return 10 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .rowsGap(20) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530.ets new file mode 100644 index 0000000000000000000000000000000000000000..d18fcd31c65c262690f8db24675baaccc1681b56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530.ets @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0530 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 0, left: 0, bottom: 0, right: 0 } + oneColumnSection: SectionOptions = { + itemsCount: 5, + crossCount:2, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + twoColumnSection: SectionOptions = { + itemsCount: 5, + crossCount:2, + margin:this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .rowsGap(20) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d1ac7b374f0598883283bafdc0601ced6f28778 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540.ets @@ -0,0 +1,260 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} + +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + /* Image($r("app.media.waterFlowTest")) + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1)*/ + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0540 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + @State newPadding: number = 0; + sectionMargin: Margin = { top: 0, left: 0, bottom: 0, right: 0 } + oneColumnSection: SectionOptions = { + itemsCount: 5, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + twoColumnSection: SectionOptions = { + itemsCount: 5, + crossCount: 2, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return 50; + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Button('改变padding') + .height('5%') + .onClick(() => { + this.newPadding = 20 + }).id('UIComponentListAndGridWaterSections0540_001'); + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .rowsGap(20) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .padding(this.newPadding) + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560.ets new file mode 100644 index 0000000000000000000000000000000000000000..988ec7c9f482da38a801107464e3865f3fce231a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560.ets @@ -0,0 +1,269 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 10; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +//============================================================= + +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0 + + // 从复用缓存中加入到组件树之前调用,可在此处更新组件的状态变量以展示正确的内容 + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item) + } + + aboutToAppear() { + console.info('new item:' + this.item) + } + + build() { + } +} + +@Entry +@Component +struct UIComponentListAndGridWaterSections0560 { + minSize: number = 80 + maxSize: number = 180 + fontSize: number = 24 + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + dataCount: number = this.dataSource.totalCount() + private itemHeightArray: number[] = [] + @State sections: WaterFlowSections = new WaterFlowSections() + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 } + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + twoColumnSection: SectionOptions = { + itemsCount: 6, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + } + + // 计算FlowItem高度 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的高度数组 + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + //this.itemHeightArray.push(this.getSize()) + this.itemHeightArray.push(100) + } + } + + aboutToAppear() { + this.setItemSizeArray() + // 初始化瀑布流分组信息 + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .height('5%') + .onClick(() => { + // 将所有分组替换成一个新分组,注意保证LazyForEach中数据数量和新分组itemsCount保持一致 + let totalCount: number = this.dataSource.totalCount() + let newSection: SectionOptions = { + itemsCount: totalCount, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 10] + } + } + let oldLength: number = this.sections.length() + this.sections.splice(0, oldLength, [newSection]) + }) + .id('UIComponentListAndGridWaterSections0560_001') + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + // .height(this.itemHeightArray[item % 100]) + .backgroundColor(this.colors[item % 5]) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') // 瀑布流使用sections参数时该属性无效 + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..430529e918ebabe14c0a966dc108b7ed967c80c8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0370.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier0370 { + private controller: TabsController = new TabsController(); + @State gridGutter: number = 10; + + build() { + Column() { + Row() { + Button("gridGutter+10 " + this.gridGutter) + .width('47%') + .height(50) + .margin({ top: 5 }) + .onClick((event?: ClickEvent) => { + this.gridGutter += 10; + }).id('UIComponentNavModifier0370_001') + .margin({ right: '6%', bottom: '12vp' }); + Button("gridGutter-10 " + this.gridGutter) + .width('47%') + .height(50) + .margin({ top: 5 }) + .onClick((event?: ClickEvent) => { + this.gridGutter -= 10; + }).id('UIComponentNavModifier0370_002') + .margin({ bottom: '12vp' }); + } + + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "1")); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "2")); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(BottomTabBarStyle.of($r("sys.media.ohos_app_icon"), "3")); + } + .width('350vp') + .animationDuration(300) + .height('60%') + .barGridAlign({ sm: 2, margin: 10, gutter: this.gridGutter }) + .backgroundColor(0xf1f3f5); + } + .width('100%') + .height(500) + .margin({ top: 5 }) + .padding('10vp'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..78c6dcf16b22a7d1fdf7f4d844ed0446369ca9a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0380.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentNavModifier0380 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg:10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..9b203df82efb3c9439b3b1a645b60e12222ed49d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0400.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentNavModifier0400 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + sm:10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier041.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa5fb4106d504b2e93c5d0b295f45f28333bd164 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier041.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier041 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue'; + @State strokeWidth: Resource = ($r('app.float.strokewidth_10')); + @State isVisible: boolean = false; + @State startMargin: number = 0; + @State endMargin: number = 0; + @State nullFlag: boolean = false; + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red'); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.isVisible = !this.isVisible; + }).id('UIComponentNavModifier041_001') + if (this.isVisible) { + Text($r('app.float.strokewidth_10')).fontSize(30); + } + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier043.ets new file mode 100644 index 0000000000000000000000000000000000000000..55ac82a7786286c9883c653a0585b3ca3271101e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier043.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier043 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State strokeWidth: number = -10 + @State strokeWidthDefaultWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + aboutToAppear(): void { + console.log(`gzc+${this.strokeWidth}`) + if(this.strokeWidth < 0) + { + this.strokeWidth = this.strokeWidthDefaultWidth + } + } + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + Button('设置').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.strokeWidth < 0) + { + this.strokeWidth = this.strokeWidthDefaultWidth + } + }).id('UIComponentNavModifier043_001') + + Text(this.strokeWidth + '').fontSize(30) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier044.ets new file mode 100644 index 0000000000000000000000000000000000000000..fca54e6b2e4b1f07f1f2aa80fa5ba773a5a0b4f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier044.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier044 { + private controller1: TabsController = new TabsController(); + @State dividerColor: string = 'blue'; + @State strokeWidth: string = '50'; + @State startMargin: number = 0; + @State endMargin: number = 0; + @State nullFlag: boolean = false; + @State isVisible: boolean = false; + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green'); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red'); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }); + Button('设置').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.isVisible = !this.isVisible; + }).id('UIComponentNavModifier044_001'); + + if (this.isVisible) { + Text(this.strokeWidth).fontSize(30); + } + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier045.ets new file mode 100644 index 0000000000000000000000000000000000000000..e939be39f2ffd613918dd9cf0a65112116aa4b30 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier045.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier045 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier046.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc364cabf459fb94e19e9ad57700becf5cb65989 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier046.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier046 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = '#FF0000' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier048.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier048.ets new file mode 100644 index 0000000000000000000000000000000000000000..edfa0002f0625fd71ac98e0cffb758369f942bbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier048.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier048 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = '#FFC0CB' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier053.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier053.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d75c1617fb5f4238940333ec6209facdc6a6407 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier053.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier053 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('设置startMargin').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.startMargin = -10 + }).id('UIComponentNavModifier053_001') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier056.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier056.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e1bdbc9fd0e032a58f7e682755eff9df7d9ec9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier056.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier056 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State tabHeight: number = 200 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height(this.tabHeight) + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('设置endMargin').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin = this.tabHeight * 0.8 + }).id('UIComponentNavModifier056_001') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier058.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier058.ets new file mode 100644 index 0000000000000000000000000000000000000000..e881db5f3c0066fb11139da4ae27c8b6fc98ea75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier058.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier058 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('设置endMargin').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin = -10 + }).id('UIComponentNavModifier058_001') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier060.ets new file mode 100644 index 0000000000000000000000000000000000000000..a738a3ae6c2c23df3bd9d18b0a787faa9133b066 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier060.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier060 { + @State message: string = 'Hello World' + private controller: TabsController = new TabsController() + private controller1: TabsController = new TabsController() + @State selfFadingFade: boolean = false; + + build() { + Column() { + Button('子页签设置渐隐').width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + this.selfFadingFade = true; + }) + Button('子页签设置不渐隐').width('100%').margin({ bottom: '12vp' }) + .onClick((event?: ClickEvent) => { + this.selfFadingFade = false; + }) + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(80) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .fadingEdge(this.selfFadingFade) + .height('30%') + .width('100%') + + } + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier063.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier063.ets new file mode 100644 index 0000000000000000000000000000000000000000..18a669509f6f7166692c8573c6c8680c1d3c3297 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier063.ets @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier063 { + @State fontColor: string = '#182431' + @State bgColor: number = 0xff0000 + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .barBackgroundColor(this.bgColor) + .margin({ top: 38 }) + Button('设置背景色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.bgColor = 0xffffff + }).id('UIComponentNavModifier063_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier065.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier065.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d92d9403ed2f0a03810c9829679646e9956d7b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier065.ets @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier065 { + @State fontColor: string = '#182431' + @State bgColor: string = '#ff0000' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .backgroundColor(this.bgColor) + .margin({ top: 38 }) + Button('设置背景色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.bgColor = '#ffffff' + }).id('UIComponentNavModifier065_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier066.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier066.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac1406f41c47e908cf15c09b90c64ebb7e161504 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier066.ets @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier066 { + @State fontColor: string = '#182431' + @State bgColor: Resource = $r('app.color.yellow') + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .backgroundColor(this.bgColor) + .margin({ top: 38 }) + Button('设置背景色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.bgColor = $r('app.color.blue') + }).id('UIComponentNavModifier066_001') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0770.ets new file mode 100644 index 0000000000000000000000000000000000000000..159e306ef28a9e20e1605eac288ff64ee4dba77e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0770.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier0770 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(56) + .barWidth(-300) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0810.ets new file mode 100644 index 0000000000000000000000000000000000000000..77c4d706fadd7103f5c3e527cc1cd20673f7e103 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0810.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier0810 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(250) + .barWidth('100%') + .width(360) + .height(300) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier083.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier083.ets new file mode 100644 index 0000000000000000000000000000000000000000..368cfe7807adc9c396986c90feb2a315b1f3009e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier083.ets @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier083{ + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabBarHeight: number = 0 + @State tabBarHeight2: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("sys.media.ohos_app_icon") : $r("sys.media.ohos_app_icon")) + //.width(24) + //.height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { + this.tabBarHeight = newValue.height as number + }) + } + + build() { + Column({space:10}) { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + Button('设置').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.tabBarHeight2 = this.tabBarHeight + }).id('UIComponentNavModifier083_001') + + Text('barWidth为'+this.tabBarHeight2 + '').fontSize(30) + }.width('100%') + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0840.ets new file mode 100644 index 0000000000000000000000000000000000000000..f96cc0728fc4772c8018e22dbbe6ff7c0ac1a3b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0840.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier0840 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(-100) + .barWidth('100%') + .width(360) + .height(300) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0860.ets new file mode 100644 index 0000000000000000000000000000000000000000..37f47718e4a30dd0071b3c027461ee86ec21c162 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0860.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier0860 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + } + }.tabBar(this.tabBuilder(0)).backgroundColor(Color.Red) + + TabContent() { + Column() { + Text('Tab2') + } + }.tabBar(this.tabBuilder(1)).backgroundColor(Color.Green) + + TabContent() { + Column() { + Text('Tab3') + } + }.tabBar(this.tabBuilder(2)).backgroundColor(Color.Yellow) + + TabContent() { + Column() { + Text('Tab4') + } + }.tabBar(this.tabBuilder(3)).backgroundColor(Color.Green) + } + .vertical(false) + .barHeight(250) + .barWidth('100%') + .width(360) + .height(300) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0900.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0900.ets new file mode 100644 index 0000000000000000000000000000000000000000..9304ac5dff09e3135b391a85c3474da479ffb69a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0900.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier0900 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + private controller: TabsController = new TabsController(); + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.selectedIndex === index ? 1 : 0); + }.width('100%').id(name); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(56) + .animationDuration(-100) + .onChange((index: number) => { + this.currentIndex = index + this.selectedIndex = index + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5'); + }.width('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0920.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0920.ets new file mode 100644 index 0000000000000000000000000000000000000000..93ce0e74846d5976cb34cddc8341a2df19164795 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavModifier/UIComponentNavModifier0920.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavModifier0920 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + private controller: TabsController = new TabsController(); + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }); + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.selectedIndex === index ? 1 : 0); + }.width('100%').id(name); + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#00CB87') + }.tabBar(this.tabBuilder(0, 'green')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#007DFF') + }.tabBar(this.tabBuilder(1, 'blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#FFBF00') + }.tabBar(this.tabBuilder(2, 'yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#E67C92') + }.tabBar(this.tabBuilder(3, 'pink')); + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(56) + .animationDuration(30/100) + .onChange((index: number) => { + this.currentIndex = index + this.selectedIndex = index + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5'); + }.width('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011.ets new file mode 100644 index 0000000000000000000000000000000000000000..02c3b142a40fabacb4735b0d1461a6d66f867a10 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsAction0011 { + @State height1: number = 200; + @State width1: number = 200; + build() { + Column({ space: 5 }) { + + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').id('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').id('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').id('Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsAction0011_001') + .width(this.width1) + .height(this.height1) + .backgroundColor(0xF1F3F5); + + Button('增加宽高').width('50%').margin({ top: 20 }) + .onClick(() => { + if(this.height1 == 200) + { + this.height1 = 250 + } + else + { + this.height1 = 200 + } + if(this.width1 == 200) + { + this.width1 = 250 + } + else + { + this.width1 = 200 + } + }).id('UIComponentNavTabsAction0011_002'); + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012.ets new file mode 100644 index 0000000000000000000000000000000000000000..25dbe57b19c88c7be22ca87ab9aa4d000fbe6aa3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsAction0012 { + @State simpleList: Array = ['tab0','tab1','tab2','tab3','tab4','tab5','tab6','tab7','tab8','tab9', + 'tab10','tab11','tab12','tab13','tab14','tab15','tab16','tab17','tab18','tab19', + 'tab20','tab21','tab22','tab23','tab24','tab25','tab26','tab27','tab28','tab29', + 'tab30','tab31','tab32','tab33','tab34','tab35','tab36','tab37','tab38','tab39', + 'tab40','tab41','tab42','tab43','tab44','tab45','tab46','tab47','tab48','tab49', + 'tab50','tab51','tab52','tab53','tab54','tab55','tab56','tab57','tab58','tab59', + 'tab60','tab61','tab62','tab63','tab64','tab65','tab66','tab67','tab68','tab69', + 'tab70','tab71','tab72','tab73','tab74','tab75','tab76','tab77','tab78','tab79', + 'tab80','tab81','tab82','tab83','tab84','tab85','tab86','tab87','tab88','tab89', + 'tab90','tab91','tab92','tab93','tab94','tab95','tab96','tab97','tab98','tab99'] + @State currentIndex: number = 0 + @Builder tabBuilder(title: string) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`).fontSize(50) + } + }.tabBar(this.tabBuilder(item)) + }, (item: string) => item) + } + .vertical(false) + .id('UIComponentNavTabsAction0012_001') + //.barMode(BarMode.Scrollable) + .barWidth(400) + .barHeight(120) + .animationDuration(0) + .width(400) + .height(400) + .backgroundColor('#FF0000') + .scrollable(true) + + } + .width('100%') + .height('100%') + + } + .height('100%') + .backgroundColor(0xF1F3F5) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..fb4018de3cdc9be404d64bb413ca21c41f3418c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsAction0030 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(index == 0 ? 'Pink' : + (index == 1 ? 'Yellow' : + (index == 2 ? 'Green' : 'Blue'))) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').id(index == 0 ? 'Pink' : + (index == 1 ? 'Yellow' : + (index == 2 ? 'Green' : 'Blue'))) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .id('UIComponentNavTabsAction0030_001') + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..6dfef64945256f56baf7c336fc7bae73de8511d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0010 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0010_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0010_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0010_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0010_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0010_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0010_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0010_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0010_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0010_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0010_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0010_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0010_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0010_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011.ets new file mode 100644 index 0000000000000000000000000000000000000000..cfe17f97526c997f18a446b924bd65853892dfb1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0011 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0011_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0011_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0011_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0011_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0011_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0011_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0011_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0011_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0011_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0011_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0011_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0011_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0011_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ef5fd10155ef2be71cf089e1256ad676aa7c375 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0012 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0012_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0012_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0012_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0012_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0012_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0012_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0012_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0012_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0012_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0012_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0012_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0012_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0012_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013.ets new file mode 100644 index 0000000000000000000000000000000000000000..3b6c3e637e225ffcd7c10e3c3ded2b69b9525a97 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0013 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0013_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0013_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0013_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0013_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0013_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0013_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0013_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0013_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0013_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0013_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0013_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0013_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0013_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8e8b277a37dedd88646ca72f83dd7c90c5ea7df --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0014 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0014_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0014_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0014_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0014_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0014_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0014_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0014_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0014_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0014_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0014_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0014_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0014_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0014_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015.ets new file mode 100644 index 0000000000000000000000000000000000000000..674c4c6106ca1b751127a50a6616cd7be80e577e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015.ets @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0015 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(true) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0015_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0015_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0015_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0015_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0015_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0015_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0015_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0015_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0015_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0015_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0015_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0015_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0015_013') + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee751d148045155516b6d580afd4c3c587724a17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0016 { + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + + + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode) + ) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0016_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0016_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0016_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0016_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0016_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0016_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0016_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0016_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0016_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0016_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0016_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0016_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0016_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017.ets new file mode 100644 index 0000000000000000000000000000000000000000..d213b086c62bf81e23e307be9ee005d8c51ca9da --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017.ets @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0017 { + @State selectedMode: SelectedMode = SelectedMode.BOARD; + @State blurtype: BlurStyle = BlurStyle.COMPONENT_THIN; + @State seq: number = 0; + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + } + .vertical(false) + .scrollable(true) + .barBackgroundBlurStyle(this.blurtype) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('设置材质NONE').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0017_001') + + Button('设置材质Thin').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thin + }).id('UIComponentNavTabsBlurStyle0017_002') + + Button('设置材质Regular').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Regular + }).id('UIComponentNavTabsBlurStyle0017_003') + + Button('设置材质Thick').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.Thick + }).id('UIComponentNavTabsBlurStyle0017_004') + + Button('设置材质BACKGROUND_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THIN + }).id('UIComponentNavTabsBlurStyle0017_005') + + Button('设置材质BACKGROUND_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_REGULAR + }).id('UIComponentNavTabsBlurStyle0017_006') + + Button('设置材质BACKGROUND_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_THICK + }).id('UIComponentNavTabsBlurStyle0017_007') + + Button('设置材质BACKGROUND_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.BACKGROUND_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0017_008') + + Button('设置材质COMPONENT_ULTRA_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THIN + }).id('UIComponentNavTabsBlurStyle0017_009') + + Button('设置材质COMPONENT_REGULAR').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_REGULAR + }).id('UIComponentNavTabsBlurStyle0017_010') + + Button('设置材质COMPONENT_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THICK + }).id('UIComponentNavTabsBlurStyle0017_011') + + Button('设置材质COMPONENT_ULTRA_THICK').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0017_012') + + Button('设置材质COMPONENT_THIN').width('50%') + .onClick(()=>{ + this.blurtype = BlurStyle.COMPONENT_THIN + }).id('UIComponentNavTabsBlurStyle0017_013') + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fe44d5cc0502b3cedf9d1df97ce6ac71cb7bb50 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0018 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Button('关闭模糊效果') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }) + .id('UIComponentNavTabsBlurStyle0018_001') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe049ee2b226cb338440e79c52684cc522364955 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0019 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Button('关闭模糊效果') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }) + .id('UIComponentNavTabsBlurStyle0019_001') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(3, 'Red')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3, 'Blue')) + } + .divider({ + strokeWidth: 1, + color: Color.Red + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..7009d34e8a4e7284621a2dac5a8336ade2596b87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0020 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(3, 'Red')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3, 'Blue')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barPosition(BarPosition.Start) + .vertical(false) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a06849ae2ccbc8cece6043851a255e45e32ee84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0021 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(3, 'Red')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(3, 'Blue')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barHeight(50) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022.ets new file mode 100644 index 0000000000000000000000000000000000000000..dbd8d98e887b71a51f07308f5acb65bf69ea0b18 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0022 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barMode(BarMode.Scrollable) + .margin('12vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023.ets new file mode 100644 index 0000000000000000000000000000000000000000..555c6bd41f25a594ac0bbf8bd13902aa43a99f86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0023 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024.ets new file mode 100644 index 0000000000000000000000000000000000000000..27501c81cb4a57960e58e7a3d9b766b9c1a8797e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0024 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025.ets new file mode 100644 index 0000000000000000000000000000000000000000..6878c233291b169b067f02521c4e1d77d35eca9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0025 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barHeight(300) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026.ets new file mode 100644 index 0000000000000000000000000000000000000000..3097bcb9f7ae0b82a42e5aa93bfc7762a7135c67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0026 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .padding('10vp') + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027.ets new file mode 100644 index 0000000000000000000000000000000000000000..74e17628891a1ead97b44f3754c4f43c1c501e63 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027.ets @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0027 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State indicatorColor: ResourceColor = Color.Blue; + @State indicatorHeight: number = 30; + @State indicatorWidth: number = 70; + private controller: TabsController = new TabsController(); + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Button('下划线颜色变化') + .onClick(() => { + this.getUIContext()?.animateTo( + { + duration: 1000, + curve: Curve.Linear, + delay: 200, + iterations: 1, + playMode: PlayMode.Normal + }, () => { + if (this.indicatorColor === Color.Red) { + this.indicatorColor = Color.Yellow; + } else { + this.indicatorColor = Color.Red; + } + }) + }) + Button('下划线高度变化') + .onClick(()=>{ + this.getUIContext()?.animateTo( + { + duration: 1000, + curve: Curve.Linear, + delay: 200, + iterations: 1, + playMode: PlayMode.Normal + }, () => { + if (this.indicatorHeight === 20) { + this.indicatorHeight = 10; + } else { + this.indicatorHeight = 20; + } + }) + }) + Button('下划线宽度变化') + .onClick(()=>{ + this.getUIContext()?.animateTo( + { + duration: 1000, + curve: Curve.Linear, + delay: 200, + iterations: 1, + playMode: PlayMode.Normal + }, () => { + if (this.indicatorWidth === 30) { + this.indicatorWidth = 50; + } else { + this.indicatorWidth = 30; + } + }) + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('pink') + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(SubTabBarStyle.of('Yellow') + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue') + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green') + ) + } + .divider({ + strokeWidth: this.indicatorWidth, + color: this.indicatorColor, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.Start) + .vertical(false) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028.ets new file mode 100644 index 0000000000000000000000000000000000000000..817aa9e99a4fe9ea141b7024c13956e58397a2ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0028 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(false) + .width(360) + .height(296) + .margin({ top: 52 }) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029.ets new file mode 100644 index 0000000000000000000000000000000000000000..03638c4ca11ceff0911239e5de9d0eaeb33f8f03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0029 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.NONE + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(300) + .barHeight(300) + .vertical(false) + .padding('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + Button('打开模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0029_001') + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0029_002') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..f25db1a6153b44d204f68b38a80536ce350cd907 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0030 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barHeight(300) + .vertical(false) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0030_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031.ets new file mode 100644 index 0000000000000000000000000000000000000000..7437b83260d10b3c9fec02610738c58d33a35ecb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0031 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(50) + .barHeight(300) + .vertical(false) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) +/* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0031_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032.ets new file mode 100644 index 0000000000000000000000000000000000000000..72efc2ae8dd2ab9625d4e20aae5a7f9b88b2ce98 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0032 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + /* + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + */ + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth('auto') + .barHeight(300) + .vertical(false) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) +/* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0032_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033.ets new file mode 100644 index 0000000000000000000000000000000000000000..a76433e9979d1c0fb5026a02797f52f2f72e8f96 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0033 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .barHeight(100) + .vertical(false) + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0033_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034.ets new file mode 100644 index 0000000000000000000000000000000000000000..8dbe91fb99e388d21e0b474f6041eef68da01cea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0034 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .barHeight(100) + .vertical(false) + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0034_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035.ets new file mode 100644 index 0000000000000000000000000000000000000000..5fc82a7c9246606e43cbbedd14e5b8415f92247a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0035 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth('auto') + .barHeight(300) + .vertical(false) + .padding('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + /* + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0035_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036.ets new file mode 100644 index 0000000000000000000000000000000000000000..79b2ecdb55389c395b033f4ec147fac682f9a00c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0036 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + /* + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode))*/ + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth('auto') + .barHeight(100) + .vertical(false) + .padding('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0036_001') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038.ets new file mode 100644 index 0000000000000000000000000000000000000000..651fc16fab4f56a158e891dc96d4f43fc5f1a869 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0038 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039.ets new file mode 100644 index 0000000000000000000000000000000000000000..2cf9c48c29940e8b0625b3b979ae9685d133bce3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0039 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.NONE + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + Button('打开模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0039_001') + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0039_002') + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..c7a2d4a8ffb40c719201cc6c09daaf3eb94e2e31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0040 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + + /*Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0040_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041.ets new file mode 100644 index 0000000000000000000000000000000000000000..fd23edf3a68f5f501717aa62023f5c0c258a2db8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0041 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(50) + .barHeight(300) + .vertical(true) + .padding(('10vp')) + .width(360) + .height(396) + .fadingEdge(true) + + /*Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0041_001')*/ + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042.ets new file mode 100644 index 0000000000000000000000000000000000000000..98e26ea385a1148f0806dfb4abaa88271f247608 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0042 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043.ets new file mode 100644 index 0000000000000000000000000000000000000000..242b6fdaf95dba25210d7db1fad3e9ede7d8e26e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0043 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blur') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + //.padding('10vp') + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044.ets new file mode 100644 index 0000000000000000000000000000000000000000..53551f1cafd911429e3aed466868e698ee56bc8c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0044 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.COMPONENT_ULTRA_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .barHeight(300) + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045.ets new file mode 100644 index 0000000000000000000000000000000000000000..d61e9c1a5415ef1c0a9b9c33c388f43b51ce8eda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0045 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(80) + .padding('10vp') + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046.ets new file mode 100644 index 0000000000000000000000000000000000000000..96e991bf7f173f86c39c6da412a91b296bf9a7b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0046 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.BOARD; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .padding('10vp') + .vertical(true) + .width(360) + .height(396) + .fadingEdge(true) + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047.ets new file mode 100644 index 0000000000000000000000000000000000000000..d6da2636e1cb258e26017bad4bfb1b303239134e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0047 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1, 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3, 'Green')) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048.ets new file mode 100644 index 0000000000000000000000000000000000000000..f741e52440aa4e80d51e5a541b7aaa608f9f2716 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0048 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.NONE + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + .backgroundBlurStyle(this.blurStyle) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .divider({ + strokeWidth: 2, + color: Color.Red, + }) + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(196) + .fadingEdge(true) + Button('打开模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.COMPONENT_ULTRA_THICK + }).id('UIComponentNavTabsBlurStyle0048_001') + Button('关闭模糊').width('50%') + .onClick(()=>{ + this.blurStyle = BlurStyle.NONE + }).id('UIComponentNavTabsBlurStyle0048_002') + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049.ets new file mode 100644 index 0000000000000000000000000000000000000000..2f173a8ed52e5aa4471b5da70ba3737e898a7d95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0049 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(100) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..d873edf84dd67bc7f6a0e0a32712b39611bc5940 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0050 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Red') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Red }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barWidth(50) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051.ets new file mode 100644 index 0000000000000000000000000000000000000000..6937152cd39cdda5733ca18401c53dc547ea90ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0051 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Fixed) + .barWidth(50) + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce25afd9115e5bfa1e7c9602de07a2d014b1a749 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0052 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('Red') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .barHeight(300) + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053.ets new file mode 100644 index 0000000000000000000000000000000000000000..dedd3f028ac0fdfcaa746f125c4012f639dcc7fc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0053 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.currentIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.currentIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('Pink') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + } + .tabBar(SubTabBarStyle.of('Yellow') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + } + .tabBar(SubTabBarStyle.of('Blue') + .selectedMode(SelectedMode.BOARD) + ) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('Green') + .selectedMode(SelectedMode.BOARD) + ) + } + .barBackgroundBlurStyle(this.blurStyle) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(BarMode.Scrollable) + .padding('10vp') + .barPosition(BarPosition.End) + .vertical(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..a5c8a6910d19899fafb18bf044220a25a13d8ef2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0060 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%') + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width('100%').height('100%') + } + .tabBar(SubTabBarStyle.of('2')) + + } + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c187a58c379547f19df5871287b7514fdd31a7d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0080 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..fdf750c12980ef4ff215e841d5d5ae193945ea31 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0100 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('2')) + + } + .opacity(0.6) + .barOverlap(true) + .width(360) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3393cbbbbbd30ab17c541f77c068c579adbcfe0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0110 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barWidth('50%') + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..c82db6f7b8fbc156f4bfcfb6e5de9b2a5f520a04 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0160 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + .margin(10) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..cbad1cf46ecfab96ed3cb29df4f15856f9885323 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0170 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + .padding(10) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..254ad5afce511b7f419fe63d6c31605e7c594e5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */@Entry +@Component +struct UIComponentNavTabsBlurStyle0180 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .opacity(0) + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .opacity(0) + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..581d2831d705024ec667f55be57b681fcb70c880 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0190 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .opacity(0.6) + .tabBar(SubTabBarStyle.of('2')) + + } + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..1710160ec671acfa1a44d844c6c03f6ffd9bd783 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0200 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .opacity(0.6) + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..08693368cda518a72ec12a91b2f59f52bfcdcc79 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0210 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Red) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .opacity(0) + .barOverlap(true) + .height(296) + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d28c9a1c19af2b192fdcde6aefb73be1916f158 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0220 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(this.blurStyle) + .divider({ + strokeWidth: 10, + color: Color.Red }) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..76dc54c84fc148787a0fda03d1cbef4fc3ee7141 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0230 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('#ff0000') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..e34491b12a60215c191a4df58ca6b74c33257724 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0240 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('#ffffff') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..77f2db72b2da824752064724d9b5f641995cf0d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0250 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(0xff0000) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..8753255d9ed8d93196c67005961da5df873a3eac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0260 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(0xffff00) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..aad861ede37e675a7888aa0f93c95df8245b2337 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0270 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color.Blue) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280.ets new file mode 100644 index 0000000000000000000000000000000000000000..e79cbfe2600a841fa80eb064f840d5cf7fc11d5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0280 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color.Yellow) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290.ets new file mode 100644 index 0000000000000000000000000000000000000000..4a148ed267973de16604b0faab72e27c44e8b457 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0290 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor($r('app.color.start_window_background')) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1c10b0815834a6d7ac21ffe3c8c5451f8b1f85c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0300 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('rgb(255,255,0)') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca812e5062171d02f2baad0d7f4b9a4b0c5ea42c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0310 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('rgba(255,0,0,0.5)') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320.ets new file mode 100644 index 0000000000000000000000000000000000000000..f2b863e8785fc24ae95403576b52eb56a1aac46b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0320 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor('abc') + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340.ets new file mode 100644 index 0000000000000000000000000000000000000000..783cb4fefe9e764f73b6d499bf42f8a5e48c78a7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0340 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Green) + } + .tabBar(SubTabBarStyle.of('tab1')) + + TabContent() { + Column().width(500).height('100%') + } + .tabBar(SubTabBarStyle.of('tab2')).backgroundColor(Color.Red) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350.ets new file mode 100644 index 0000000000000000000000000000000000000000..6f305f9f2322bee3a4d6ce5b6fe03a59f3e4c397 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0350 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color. Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360.ets new file mode 100644 index 0000000000000000000000000000000000000000..19ce03d1ef56d2898f0a5e53436d434880af830f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0360 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundColor(Color. Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .opacity(0.6) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370.ets new file mode 100644 index 0000000000000000000000000000000000000000..4d03eec2be34fe0dbbe0105d8a5db90f73d03422 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0370 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barWidth('150%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d37b7e1d857987ca80e7667a2ce7ce9452031f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0380 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barHeight('100%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..e64126db2481805f715a5301d4cf92f355356f3b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0390 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barHeight('150%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f396c2104fb0da446ffdd2ad1dbe604d7269319 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsBlurStyle0400 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barHeight('20%') + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets new file mode 100644 index 0000000000000000000000000000000000000000..0a9b2b6dac4bc4348365dfeaa880fa66686b7c47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount014 { + @State currentIndex: number = 0 + private tabsController: TabsController = new TabsController() + + build() { + Column() { + Tabs({ index: this.currentIndex, barPosition: BarPosition.Start, controller: this.tabsController }) { + TabContent() { + MyComponent({ color: '#00CB87' }) + }.tabBar(SubTabBarStyle.of('green')) + + TabContent() { + MyComponent({ color: '#007DFF' }) + }.tabBar(SubTabBarStyle.of('blue')) + + TabContent() { + MyComponent({ color: '#FFBF00' }) + }.tabBar(SubTabBarStyle.of('yellow')) + + TabContent() { + MyComponent({ color: '#E67C92' }) + }.tabBar(SubTabBarStyle.of('pink')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .onChange((index: number) => { + this.currentIndex = index + }) + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }) + .id('UIComponentNavTabs014_001') + } + } +} + +@Component +struct MyComponent { + private color: string = "" + + aboutToAppear(): void { + console.info('aboutToAppear backgroundColor:' + this.color) + } + + aboutToDisappear(): void { + console.info('aboutToDisappear backgroundColor:' + this.color) + } + + build() { + Column() + .width('100%') + .height('100%') + .backgroundColor(this.color) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets new file mode 100644 index 0000000000000000000000000000000000000000..57f6ee4c8128606f7a91c98774151a39f7e319a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount015 { + @State currentIndex: number = 0 + private tabsController: TabsController = new TabsController() + + build() { + Column() { + Tabs({ index: this.currentIndex, barPosition: BarPosition.End, controller: this.tabsController }) { + TabContent() { + MyComponent({ color: '#00CB87' }) + }.tabBar(SubTabBarStyle.of('green')) + + TabContent() { + MyComponent({ color: '#007DFF' }) + }.tabBar(SubTabBarStyle.of('blue')) + + TabContent() { + MyComponent({ color: '#FFBF00' }) + }.tabBar(SubTabBarStyle.of('yellow')) + + TabContent() { + MyComponent({ color: '#E67C92' }) + }.tabBar(SubTabBarStyle.of('pink')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .onChange((index: number) => { + this.currentIndex = index + }) + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }) + .id('UIComponentNavTabs015_001') + } + } +} + +@Component +struct MyComponent { + private color: string = "" + + aboutToAppear(): void { + console.info('aboutToAppear backgroundColor:' + this.color) + } + + aboutToDisappear(): void { + console.info('aboutToDisappear backgroundColor:' + this.color) + } + + build() { + Column() + .width('100%') + .height('100%') + .backgroundColor(this.color) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016.ets new file mode 100644 index 0000000000000000000000000000000000000000..4989f8dabb7a0c66a3c9b87587fa61a16e322691 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { BusinessError } from '@kit.BasicServicesKit' + +@Entry +@Component +struct UIComponentNavTabsCachedCount016 { + @State currentIndex: number = 0 + @State barPosition: BarPosition = BarPosition.Start // 新增状态以动态改变 barPosition + private tabsController: TabsController = new TabsController() + + build() { + Column() { + // Tabs 组件,使用动态 barPosition + Tabs({ index: this.currentIndex, barPosition: this.barPosition, controller: this.tabsController }) { + TabContent() { + MyComponent({ color: '#00CB87' }) + }.tabBar(SubTabBarStyle.of('green')) + + TabContent() { + MyComponent({ color: '#007DFF' }) + }.tabBar(SubTabBarStyle.of('blue')) + + TabContent() { + MyComponent({ color: '#FFBF00' }) + }.tabBar(SubTabBarStyle.of('yellow')) + + TabContent() { + MyComponent({ color: '#E67C92' }) + }.tabBar(SubTabBarStyle.of('pink')) + } + .width(360) + .height(296) + .backgroundColor('#F1F3F5') + .onChange((index: number) => { + this.currentIndex = index + }) + + Button('preload items: [1, 3]') + .margin(5) + .onClick(() => { + // 预加载第1、3个子节点,提高滑动或点击切换至这些节点时的性能 + this.tabsController.preloadItems([1, 3]) + .then(() => { + console.info('preloadItems success.') + }) + .catch((error: BusinessError) => { + console.error('preloadItems failed, error code: ' + error.code + ', error message: ' + error.message) + }) + }) + .id('UIComponentNavTabs016_001') + + // 按钮用于切换 barPosition + Button('Toggle Bar Position') + .margin(5) + .onClick(() => { + // 切换 barPosition + this.barPosition = this.barPosition === BarPosition.Start ? BarPosition.End : BarPosition.Start; + console.info('Bar position changed to: ' + this.barPosition); + }) + .id('UIComponentNavTabs016_002') + } + } +} + +@Component +struct MyComponent { + private color: string = "" + + aboutToAppear(): void { + console.info('aboutToAppear backgroundColor:' + this.color) + } + + aboutToDisappear(): void { + console.info('aboutToDisappear backgroundColor:' + this.color) + } + + build() { + Column() + .width('100%') + .height('100%') + .backgroundColor(this.color) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001.ets new file mode 100644 index 0000000000000000000000000000000000000000..38dc88331734f88d757c9855df5f410cd8735c3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt001 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barWidth('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(400) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002.ets new file mode 100644 index 0000000000000000000000000000000000000000..978133ebb0ae3f3f9976786ccd459484175bc86f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt002 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003.ets new file mode 100644 index 0000000000000000000000000000000000000000..3a480b85cc3741a557ed52423bbe9d202c6c165b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt003 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bc1098ddda6fb6bfa9e606e3a3d57bb04924d64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt004 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barWidth('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(400) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..7e7ab58e5cf0e4e6cf88b65de127c8c33eb72486 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0500 { + private controller: TabsController = new TabsController() + @State subTabBorderRadius: number = 10; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink).borderRadius(this.subTabBorderRadius) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(60).backgroundColor(Color.Yellow).borderRadius(this.subTabBorderRadius) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(70).backgroundColor(Color.Blue).borderRadius(this.subTabBorderRadius) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Green).borderRadius(this.subTabBorderRadius) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(140) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .backgroundColor(0xF5F5F5) + .height('auto') + + }.width('100%').height(250).padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007.ets new file mode 100644 index 0000000000000000000000000000000000000000..88974097360926137ed7ee8f5e1b58c855f40cf6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007.ets @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt007 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabPadding: string = 'auto' + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + .padding(this.tabPadding) + + Button('tab.padding设置为10').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = '10' + }).id('UIComponentNavTabsContentAdapt007_001') + + Button('tab.padding设置为20').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = '20' + }).id('UIComponentNavTabsContentAdapt007_002') + + Button('tab.padding设置为30').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = '30' + }).id('UIComponentNavTabsContentAdapt007_003') + + Button('tab.padding设置为auto').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabPadding = 'auto' + }).id('UIComponentNavTabsContentAdapt007_004') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..a595bf5629810e2144fa68fdc18a05c2a4197052 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0080 { + private controller: TabsController = new TabsController() + @State subTabBorderRadius: number = 10; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink).borderRadius(this.subTabBorderRadius) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(60).backgroundColor(Color.Yellow).borderRadius(this.subTabBorderRadius) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(70).backgroundColor(Color.Blue).borderRadius(this.subTabBorderRadius) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Green).borderRadius(this.subTabBorderRadius) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(140) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .backgroundColor(0xF5F5F5) + .height('auto') + + Button('addBorderRadius').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.subTabBorderRadius = 20 + }).id('UIComponentNavTabsContentAdapt0080_001') + + Button('resetBorderRadius').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.subTabBorderRadius = 10 + }).id('UIComponentNavTabsContentAdapt0080_002') + + }.width('100%').height(250).padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010.ets new file mode 100644 index 0000000000000000000000000000000000000000..d226bfc2c8d907d9537d0675c9317de92b3d08f0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt010 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d4994b3976c0292a2f28079f9d852ba65324a4c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt011 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(400) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(200) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(300) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012.ets new file mode 100644 index 0000000000000000000000000000000000000000..5ea70d1d46db3afc654963ff58ef0acce6ec9834 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt012 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(400) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(200) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(300) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013.ets new file mode 100644 index 0000000000000000000000000000000000000000..495b06153678a4f67745fb6deaeb1f51b280f773 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt013 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014.ets new file mode 100644 index 0000000000000000000000000000000000000000..4422d4d9a7ff0046616207ea64fe2f5f571933e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014.ets @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt014 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50).width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100).width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150).width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200).width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .scrollable(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + .padding('auto') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..7274559e79bcab2e40b8482ebaa08c9db13f0ef1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0150 { + @State barWidth: number = 300; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(false) + .scrollable(true) + .barHeight('auto') + .barWidth(this.barWidth) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('400') + .height('auto') + .backgroundColor(0xF1F3F5); + Button('宽度改变').width('50%') + .onClick(() => { + if (this.barWidth == 300) { + this.barWidth = 400; + } + else { + this.barWidth = 300; + } + }).id('UIComponentNavTabsContentAdapt0150_001'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..57cfb440c28f8e9eb4cd84631705b16e64094fe5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0160 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0160_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..9ffae16a4e9a399ca596d3b68771a3d2f558cd4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0170 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0170_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..15c96d9b15834e7a280e52fd26cdeae492e931c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0180 { + @State barWidth: number = 200; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('auto') + .barWidth(this.barWidth) + .backgroundColor(0xF1F3F5); + + Button('宽度改变').width('50%') + .onClick(() => { + this.barWidth -= 50; + if (this.barWidth <= 100) { + this.barWidth = 200; + } + }).id('UIComponentNavTabsContentAdapt0180_001'); + + }.width('400').height('400'); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..ac565f2f779f2d27a252d44306323323d92e2480 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0190 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0190_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .width('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f4db990807104330cd3d210c269385f35643e74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0200 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barWidth: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barWidth') + .id('UIComponentNavTabsContentadapt0200_001') + .onClick(() => { + this.barWidth += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barWidth(this.barWidth) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210.ets new file mode 100644 index 0000000000000000000000000000000000000000..26fb7de5a70ad77dd6aa6e4d40623cb4f8b317cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0210 { + @State barHeight: number = 100; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(false) + .scrollable(true) + .barHeight(this.barHeight) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('100%') + .height('auto') + .backgroundColor(0xF1F3F5); + Button('高度改变').width('50%') + .onClick(() => { + this.barHeight += 50; + if (this.barHeight >= 200) { + this.barHeight = 100; + } + }).id('UIComponentNavTabsContentAdapt0210_001'); + + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220.ets new file mode 100644 index 0000000000000000000000000000000000000000..61c778abaa031aea5d7508cc4b277a4921b2e4f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0220 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 100; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barheight') + .id('UIComponentNavTabsContentadapt0220_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..bd0c8fc2afb56965f602f6981974cf11fd4689fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0230 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barHeight') + .id('UIComponentNavTabsContentadapt0230_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..9be0ffc85c8266ca2e182cb784ad107c0da2f9a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0240 { + @State barHeight: number = 400; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('auto') + .barHeight(this.barHeight) + .backgroundColor(0xF1F3F5); + + Button('高度改变').width('50%') + .onClick(() => { + this.barHeight -= 50; + if (this.barHeight <= 300) { + this.barHeight = 400; + } + }).id('UIComponentNavTabsContentAdapt0240_001'); + + }.width('100%').height(400); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..7bb6a5df18b52c6395ce1fbb2dc98b00b7ee2c2d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0250 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 100; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barheight') + .id('UIComponentNavTabsContentadapt0250_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .width('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..0f786fc593f799773b07f8dd03bd8e7e023331b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentadapt0260 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State barHeight: number = 200; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('change barHeight') + .id('UIComponentNavTabsContentadapt0260_001') + .onClick(() => { + this.barHeight += 50; + }) + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(SubTabBarStyle.of('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(SubTabBarStyle.of('Green')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(SubTabBarStyle.of('Blue')) + } + .vertical(true) + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .width('auto') + .barHeight(this.barHeight) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027.ets new file mode 100644 index 0000000000000000000000000000000000000000..9e1ab4d5e947f835f8342df33a356262606d1cc6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt027 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'red' + @State strokeWidth: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller1 }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(100).backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(120).backgroundColor(Color.Green) + }.tabBar('green') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth('auto') + .barHeight('auto') + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('auto') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + + Button('增加Divider').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.nullFlag = false; + this.strokeWidth += 2; + this.dividerColor = 'red'; + this.startMargin = 0; + this.endMargin = 0; + }).id('UIComponentNavTabsContentAdapt027_001') + Button('复位Divider').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.nullFlag = false + this.strokeWidth = 2; + }).id('UIComponentNavTabsContentAdapt027_002') + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd92e42c203db554e3ef40ce6ba805b5b280c34a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt028 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller1 }) { + TabContent() { + Column().width('100%').height(50).backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height(70).backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height(80).backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height(100).backgroundColor(Color.Green) + }.tabBar('green') + + } + .vertical(false) + .direction(Direction.Ltr) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth('auto') + .barHeight('auto') + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('auto') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: 2, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + Button('上边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.startMargin += 2 + }).id('UIComponentNavTabsContentAdapt028_001') + + Button('上边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.startMargin > 2) { + this.startMargin -= 2 + } + }).id('UIComponentNavTabsContentAdapt028_002') + + Button('下边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin += 2 + }).id('UIComponentNavTabsContentAdapt028_003') + + Button('下边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.endMargin > 2) { + this.endMargin -= 2 + } + }).id('UIComponentNavTabsContentAdapt028_004') + + Button('颜色变为红色').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.dividerColor = 'red' + }).id('UIComponentNavTabsContentAdapt028_005') + + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030.ets new file mode 100644 index 0000000000000000000000000000000000000000..fcb001cd536778fb1e758d54297ff479d4ed2728 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt030 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + + build() { + Column() { + + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(false) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310.ets new file mode 100644 index 0000000000000000000000000000000000000000..8fb27f96eda57ecc929133e7570ef8f7332ec922 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt0310 { + @State vertical: boolean = false; + build() { + Column({ space: 5 }) { + + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height(100).backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height(110).backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height(120).backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height(130).backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(this.vertical).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .height('auto') + .backgroundColor(0xF1F3F5); + + Button('设置').width('50%').margin({ top: 20 }) + .onClick(() => { + this.vertical = !this.vertical; + }).id('UIComponentNavTabsContentAdapt0310_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032.ets new file mode 100644 index 0000000000000000000000000000000000000000..79e66eecc76efc97d41a84272fcb36e898da7140 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt032 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabVertical: boolean = false + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Button('tab.vertical设置为true').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabVertical = !this.tabVertical + }).id('UIComponentNavTabsContentAdapt032_001') + + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50).width(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100).width(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150).width(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200).width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(this.tabVertical) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + .padding('auto') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033.ets new file mode 100644 index 0000000000000000000000000000000000000000..d41ad152cd890ae101acae668c26f50906c7a4aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct Index { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')); + + @State barPosition: BarPosition = BarPosition.Start // 新增状态以动态改变 barPosition + + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: this.barPosition}) { + TabContent() { + Column(){ + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 0, bottom: 6.5 }) + }.width('100%').height('auto').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column(){ + Text('Tab_222') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 10, bottom: 16.5 }) + }.width('100%').height('auto').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + .onWillShow(() => { + console.info("Orange will show") + }) + .onWillHide(() => { + console.info("Orange will hide") + }) + + TabContent() { + Column(){ + Text('Tab_333333') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 20, bottom: 26.5 }) + }.width('100%').height('auto').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column(){ + Text('Tab_444444444') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 36.5 }) + }.width('100%').height('auto').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + // 按钮用于切换 barPosition + Button('Toggle Bar Position') + .margin(5) + .onClick(() => { + // 切换 barPosition + this.barPosition = this.barPosition === BarPosition.Start ? BarPosition.End : BarPosition.Start; + console.info('Bar position changed to: ' + this.barPosition); + }) + .id('UIComponentNavTabs033_001') + + }.width('100%').height(200) + + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034.ets new file mode 100644 index 0000000000000000000000000000000000000000..80b50767a09985ab43a5ccea6172a025717e8773 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034.ets @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt034 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabWidth: string = 'auto' + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(250) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(this.tabWidth) + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + + Button('宽度设置为200').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = '200' + }).id('UIComponentNavTabsContentAdapt034_001') + + Button('宽度设置为-100').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = '-100' + }).id('UIComponentNavTabsContentAdapt034_002') + + Button('宽度设置为100%').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = '100%' + }).id('UIComponentNavTabsContentAdapt034_003') + + Button('宽度设置为auto').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabWidth = 'auto' + }).id('UIComponentNavTabsContentAdapt034_004') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035.ets new file mode 100644 index 0000000000000000000000000000000000000000..5dcf876c5d12a30d0faab26b66ff3ff7200996b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035.ets @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsContentAdapt035 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State tabHeight: string = 'auto' + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height(this.tabHeight) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + + Button('高度设置为200').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = '300' + }).id('UIComponentNavTabsContentAdapt035_001') + + Button('高度设置为-1').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = 'auto' + }).id('UIComponentNavTabsContentAdapt035_002') + + Button('高度设置为50%').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = '50%' + }).id('UIComponentNavTabsContentAdapt035_003') + + Button('高度设置为auto').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.tabHeight = '-1' + }).id('UIComponentNavTabsContentAdapt035_004') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..9334f81c220304e132da8284a679c7826f7b6e4e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0230 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c64ab4c43cc61f6e4b18410b5ef08ee5888b7d5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsEdgeeffect0270 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(SubTabBarStyle.of('1')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(SubTabBarStyle.of('2')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..9cd6c935ab810ba797161506bef3e7b8157ddfd2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0010 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d35f376c7404b39461d8abe5f076a6b22665bfe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0020 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..a8bf8d37e29fba14b96f8656e4fe2785e642532f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0030 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..bc633d6239139a10cd3f913175792dadc696511a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0040 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.TOP]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..0093d68cfb8a611154ac559228e665ffc6c08b06 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0050 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.BOTTOM]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..f710671495671a7aa49d52ce282e84f179fe5567 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0060 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.START, SafeAreaEdge.END]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a3a066430dd47cea5141cd225c71f403e75399e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0070 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.START]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..90c447407833eddca7bc4bc34818446d6e87857e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0080 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + .expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.END]) + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..e03fbf643d9fd86045daac9038cff0887676e586 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0090 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..d1edb2fd370e2b82def1295d01b14f90ae83bbf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0100 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1','2']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)) + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + + Button('addTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 2000; i++) { + console.log("addTabs=%d",i); + this.simpleList.push('a'); + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0140_001') + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.currentIndex = 3 + }).id('UIComponentNavTabsImproTrace0140_002') + } + .width('100%') + .height('100%') + + } + .height('100%') + .backgroundColor(0xF1F3F5) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..8b87aebe0f545221178caf7252c6a8534acf04c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0110 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Scroll(){ + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..c028a16c3f394969ebfedc24cad79132482d1a96 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UIComponentNavTabsExpandsafearea0120 { + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + private controller: TabsController = new TabsController(); + + build() { + Column() { + Text('文本') + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Pink') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Pink }) + ) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_ic_public_text'), 'Black') + .labelStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + .iconStyle({ unselectedColor: Color.Red, selectedColor: Color.Black }) + ) + + } + .backgroundColor(Color.Green) + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .height('50%') + Text('文本') + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa19b6d2bcb65dee0931a81670f606d2d697dec9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsHeight001 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + } + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller, }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(50) + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(100) + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(150) + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.height(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight('auto') + .onChange((index: number) => { + this.currentIndex = index + }) + .width(500) + .height('auto') + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..359b549b677bb6570272722ae8dbd928122db907 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0010 { + @State currentIndex: number = 0; + @State tabVertical: boolean = false; + @State direction1: Direction = Direction.Rtl; + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController(); + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + aboutToAppear(): void { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(100) + .width(100) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(true) + .barMode(BarMode.Fixed) + .barWidth(60) + .barHeight(360) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index; + }) + .width(200) + .height('auto') + .backgroundColor('#F1F3F5') + .scrollable(true) + .direction(this.direction1); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..fef0a00a2e8fa3a28b1a38fe4962ba55b8ae3649 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0020 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + @State simpleList: Array = [1]; + private controller: TabsController = new TabsController(); + + @Builder + tabBuilder(index: number) { + Column() { + Image(this.selectedIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 5; i++) { + this.simpleList.push(i); + } + }).id('UIComponentNavTabsImproTrace0020_001'); + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + ForEach(this.simpleList, (item: number) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(200) + .width(200) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder(item)); + + }, (item: string) => item); + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + this.selectedIndex = targetIndex + 1 + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }); + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..327c620bc6798c7623960f20c5579f08a6947eda --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0030 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0030_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(200) + .width(200) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(260) + .barMode(BarMode.Fixed) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('300') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0030_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce06fb0e8eee2ad1360326e71fa0aa724169a321 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0040 { + @State currentIndex: number = 0 + + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0040_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(400) + .width(400) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(360) + .barMode(BarMode.Scrollable) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('500') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0040_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..d94c02ea8164afa36792f6573cc94664e6f757b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0060 { + @State currentIndex: number = 0 + + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0060_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(400) + .width(400) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(360) + .barMode(BarMode.Scrollable) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('500') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0060_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..436587898f127487dc6f28ac84128a28bfc48461 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0070 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0070_001'); + + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(200) + .width(200) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barWidth(260) + .barMode(BarMode.Scrollable) + .barHeight(100) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height('300') + .backgroundColor('#F1F3F5') + .scrollable(true) + .id('UIComponentNavTabsImproTrace0070_002'); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..67062e5ba94b9863c8cd62ed5a9795bd3a721720 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0080 { + @State currentIndex: number = 0 + @State barWidth: string = '360' + @State barHeight: string = '60' + @State tabWidth: string = 'auto' + @State tabHeight: string = '200' + @State tabVertical: boolean = false + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0080_001'); + + Button('横纵向切换').width('50%').margin({ top: 20 }) + .onClick(() => { + this.barWidth = '60' + this.barHeight = '360' + this.tabWidth = '200' + this.tabHeight = 'auto' + this.tabVertical = !this.tabVertical + }).id('UIComponentNavTabsImproTrace0080_002'); + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(100) + .width(100) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(this.tabVertical) + .barMode(BarMode.Fixed) + .barWidth(this.barWidth) + .barHeight(this.barHeight) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(this.tabWidth) + .height(this.tabHeight) + .backgroundColor('#F1F3F5') + .scrollable(true) + + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..1c0bb5553cd7e487e8e7617a7eaca8f29200d77a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0120 { + @State currentIndex: number = 0 + @State tabContentWidth: number = 60 + @State tabContentHeight: number = 60 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(this.tabContentHeight) + .width(this.tabContentWidth) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0120_001'); + + Button('增加宽和高').width('50%').margin({ top: 20 }) + .onClick(() => { + this.tabContentHeight = this.tabContentHeight + 10; + this.tabContentWidth = this.tabContentWidth + 10; + }).id('UIComponentNavTabsImproTrace0120_002'); + + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..bfc06f4d5c93b1a76217531b4b3e1df93e3431c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0130 { + @State currentIndex: number = 0 + @State tabVertical: boolean = false + @State direction1: Direction = Direction.Rtl + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + + Button('addTabContents').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0130_001'); + + Button('镜像切换').width('50%').margin({ top: 20 }) + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsImproTrace0130_002'); + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + .height(100) + .width(100) + .backgroundColor('#FF0000') + .justifyContent(FlexAlign.Center); + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(true) + .barMode(BarMode.Fixed) + .barWidth(60) + .barHeight(360) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(200) + .height('auto') + .backgroundColor('#F1F3F5') + .scrollable(true) + .direction(this.direction1); + } + .width('100%') + .height('100%'); + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..1491994ee5f65bada5d2593385f96ea7ad159c52 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0140 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Button('addTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0140_001'); + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.controller.changeIndex(3) + }).id('UIComponentNavTabsImproTrace0140_002'); + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..daa7375ed74e7b2b71bab7bc696aaff19dcc1be2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150.ets @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsImproTrace0150 { + @State currentIndex: number = 0 + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Button('addTabs').width('50%').margin({ top: 20 }) + .onClick(() => { + for (let i = 2; i <= 10; i++) { + this.simpleList.push(i.toString()); + } + }).id('UIComponentNavTabsImproTrace0150_001'); + + Button('changeTabIndex').width('50%').margin({ top: 20 }) + .onClick(() => { + this.currentIndex = 3 + }).id('UIComponentNavTabsImproTrace0150_002'); + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..e02ef7cf11bb9e3ccd7b2c884f0d8956313cec33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160.ets @@ -0,0 +1,235 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 { SymbolGlyphModifier } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentNavTabsImproTrace0160 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State tarBarMode: BarMode = BarMode.Scrollable + @State currentIndex: number = 0 + @State tarVertical: boolean = false + @State direction1: Direction = Direction.Rtl + @State gridMargin: number = 10 + @State gridGutter: number = 10 + @State sm: number = -2 + @State selectedIndex: number = 0 + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + @State symmetricExtensible: boolean = false; + @State layoutMode: LayoutMode = LayoutMode.VERTICAL; + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')); + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? $r("app.media.magnifier") : $r("app.media.tick")) + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + @Builder + build() { + Column() { + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({normal: this.symbolModifier1,}, "3") + .layoutMode(this.layoutMode) + .symmetricExtensible(this.symmetricExtensible)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({normal: this.symbolModifier2,}, "4") + .layoutMode(this.layoutMode) + .symmetricExtensible(this.symmetricExtensible)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({normal: this.symbolModifier3,}, "4") + .layoutMode(this.layoutMode) + .symmetricExtensible(this.symmetricExtensible)); + + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)) + + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(this.tarBarMode) + .barWidth(200) + .barHeight(200) + .vertical(this.tarVertical) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + .barGridAlign({ sm: this.sm, margin: this.gridMargin, gutter: this.gridGutter }) + .direction(this.direction1); + + Button('index改变').width('50%') + .onClick(() => { + this.currentIndex++; + if (this.currentIndex >= 6) { + this.currentIndex = 0; + } + }).id('UIComponentNavTabsImproTrace0160_001'); + + Button('方向改变').width('50%') + .onClick(() => { + this.tarVertical = !this.tarVertical + }).id('UIComponentNavTabsImproTrace0160_002'); + + Button('barMode改变').width('50%') + .onClick(() => { + if (this.tarBarMode == BarMode.Scrollable) { + this.tarBarMode = BarMode.Fixed + } + else { + this.tarBarMode = BarMode.Scrollable + } + }).id('UIComponentNavTabsImproTrace0160_003'); + Button('镜像改变').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsImproTrace0160_004') + + Button('barGridAlign改变').width('50%') + .onClick(()=>{ + this.gridMargin += 10 + }).id('UIComponentNavTabsImproTrace0160_005') + + Button('gridGutter改变').width('50%') + .onClick(()=>{ + this.gridGutter += 10 + }).id('UIComponentNavTabsImproTrace0160_006') + + Button('sm改变').width('50%') + .onClick(()=>{ + this.sm += 2; + if(this.sm>=8) + { + this.sm = -2; + } + }).id('UIComponentNavTabsImproTrace0160_007') + + Button('symmetricExtensible改变').width('50%') + .onClick(()=>{ + this.symmetricExtensible = !this.symmetricExtensible + }).id('UIComponentNavTabsImproTrace0160_008') + + Button('layoutMode改变').width('50%') + .onClick(()=>{ + if(this.layoutMode == LayoutMode.VERTICAL) + { + this.layoutMode = LayoutMode.HORIZONTAL; + } + else if(this.layoutMode == LayoutMode.HORIZONTAL) + { + this.layoutMode = LayoutMode.VERTICAL; + } + }).id('UIComponentNavTabsImproTrace0160_009') + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e00858bd04c108002142b1ff5227d43098021cfe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0010 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .id('UIComponentNavTabsInterception0010_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (currentIndex == 2 && comingIndex == 3) + { + return false + } + else + { + return true + } + + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.currentIndex==0) { + this.currentIndex = 2 + } + else + { + this.currentIndex = 0 + } + }).id('UIComponentNavTabsInterception0010_002') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..f7c811d771f6a257435f978ab68bab2ce7255642 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0030 { + @State currentIndex: number = 3 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .id('UIComponentNavTabsInterception0030_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) + { + return true + } + else + { + return true + } + + }) + Button('changeIndex2').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 2 + }).id('UIComponentNavTabsInterception0030_002') + + Button('changeIndex4').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 4 + }).id('UIComponentNavTabsInterception0030_004') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..27cbd8dc307247f5c10b49f8120d74052e93dd07 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0040 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.controller.changeIndex(3) + }).id('UIComponentNavTabsInterception0040_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..bea663c90c10540c3bdf03963a59d666638df0e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0050 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return true + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.controller.changeIndex(3) + }).id('UIComponentNavTabsInterception0050_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..009cf1a3db59cb7afdec681edf85467ca2383462 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0060 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 3 + }).id('UIComponentNavTabsInterception0060_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..8c1fb94e4652f02871ad13d38ee118bebd52e5ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0070 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return true + } + return true + }) + Button('changeIndex').width('50%').margin({ top: 20 }) + .onClick(()=>{ + this.currentIndex = 3 + }).id('UIComponentNavTabsInterception0070_001') + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..792b4b18dbe054ebafaa9dfef262f89c68dc5bca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0080 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + console.error(`onChange() this.currentIndex = ${index}`); + this.currentIndex = index + }).id('UIComponentNavTabsInterception0080_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..2aada3d3a46f26a7c5fd63ad47da963d404abd3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0090 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + console.error(`onChange() this.currentIndex = ${index}`); + this.currentIndex = index + }).id('UIComponentNavTabsInterception0090_001') + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return true + } + return true + }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..2b28ef290e6a7abb891e85670c3b22f50c186781 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0130 { + @State currentIndex: number = 2 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title).fontColor(this.currentIndex === targetIndex ? '#1698CE' : '#6B6B6B') + }.width('100%') + .height(50) + + .justifyContent(FlexAlign.Center) + + } + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + TabContent() { + Column(){ + Text('首页的内容') + }.width('100%').height('100%').backgroundColor('#00CB87').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('首页',0)) + + TabContent() { + Column(){ + Text('发现的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('发现',1)) + + TabContent() { + Column(){ + Text('推荐的内容') + }.width('100%').height('100%').backgroundColor('#FFBF00').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('推荐',2)) + + TabContent() { + Column(){ + Text('我的内容') + }.width('100%').height('100%').backgroundColor('#E67C92').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('我的',3)) + + TabContent() { + Column(){ + Text('他的内容') + }.width('100%').height('100%').backgroundColor('#007DFF').justifyContent(FlexAlign.Center) + }.tabBar(this.tabBuilder('他的',4)) + } + + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(600) + .backgroundColor('#F1F3F5') + .scrollable(true) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false + } + return true + }).id('UIComponentNavTabsInterception0130_001') + + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..48d7cabb7219f9a084aac78b3c7ba2bfc762f74f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterception0150 { + @State simpleList: Array = ['one', 'two', 'three', 'four', 'five']; + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(item) + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onContentWillChange((currentIndex, comingIndex) => { + if (comingIndex == 3) { + return false; + } + return true; + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true) + + Button('delTabContent').width('50%').margin({ top: 20 }) + .onClick(() => { + this.simpleList.pop(); + }).id('UIComponentNavTabsInterception0150_001') + + Button('addTabContent').width('50%').margin({ top: 20 }) + .onClick(() => { + this.simpleList.push('five'); + }).id('UIComponentNavTabsInterception0150_002') + } + .width('100%') + .height('100%') + + } + .height('100%') + .backgroundColor(0xF1F3F5) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012.ets new file mode 100644 index 0000000000000000000000000000000000000000..5dd52beb9843462626275c30d9d34886da78a360 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterface012 { + @State message: string = 'Hello World' + private controller: TabsController = new TabsController() + private controller1: TabsController = new TabsController() + + build() { + Column() { + + Tabs({ barPosition: BarPosition.End, index: 0, controller: this.controller }) { + TabContent() { + Column().width(200).height('100%').backgroundColor(Color.Pink) + }.tabBar('pink111111111111111111111111111111111111111') + + TabContent() { + Column().width(250).height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow222222222222222222222222222222') + + TabContent() { + Column().width(300).height('100%').backgroundColor(Color.Blue) + }.tabBar('blue33333333333333333333333333333333') + + TabContent() { + Column().width(300).height('100%').backgroundColor(Color.Green) + }.tabBar('green444444444444444444444444444') + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Scrollable) + .barHeight(80) + .barWidth(400) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('30%') + .width(200) + + } + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190.ets new file mode 100644 index 0000000000000000000000000000000000000000..c8255774796c58dc178ea44e150d80391b7fe90c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterface1190 { + @State currentIndex: number = 0; + @State seq: number = 1; + @State simpleList: Array = ['1']; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(title: string, targetIndex: number) { + Column() { + Text(title) + }.width('100%') + .height(50) + .justifyContent(FlexAlign.Center); + } + + build() { + Row() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller, index: this.currentIndex }) { + ForEach(this.simpleList, (item: string) => { + TabContent() { + Column() { + Text(`Content:${item}`) + } + }.tabBar(this.tabBuilder(item, 1)); + }, (item: string) => item) + } + .vertical(false) + .barMode(BarMode.Fixed) + .barWidth(360) + .barHeight(60) + .animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + .width(360) + .height(200) + .backgroundColor('#F1F3F5') + .scrollable(true); + + Button('addTabar').width('50%').margin({ top: 20 }) + .onClick(() => { + this.seq += 1 + this.simpleList.push(this.seq.toString()); + this.currentIndex = this.simpleList.length - 1 + }).id('UIComponentNavTabsInterface1190_001'); + + } + .width('100%') + .height('100%'); + + } + .height('100%') + .backgroundColor(0xF1F3F5); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220.ets new file mode 100644 index 0000000000000000000000000000000000000000..46241a0517e676a44c00ffcc13f77b991d88c8c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220.ets @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsInterface1220 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index + 1}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.id('UIComponentNavTabsInterface1220_001').width('100%') + }.tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('Tab2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('Tab3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('Tab4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ top: 30, bottom: 56.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width('100%') + }.tabBar(this.tabBuilder(3)) + } + .vertical(false) + .barHeight(56) + .onChange((index: number) => { + // currentIndex控制TabContent显示页签 + this.currentIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width(360) + .height(190) + .backgroundColor('#F1F3F5') + .margin({ top: 38 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..e960dc29d5c137de73f5db286d54a5a47ca2b06c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0030 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0030_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(true) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..596ee6eabb0f1ba160da3a58212c2b80b659a6d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0070 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0070_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(true) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..8ad90cd1637f6687e2960a6c99c8b0e33afacc1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0090 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0090_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(false) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010.ets new file mode 100644 index 0000000000000000000000000000000000000000..3df89e54dd175a855ba73c7e556c22466001b52a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror010 { + private controller: TabsController = new TabsController() + @State barOverlap: boolean = true; + @State barBackgroundColor: string = '#88888888'; + @State direction1: Direction = Direction.Rtl + build() { + Column() { + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror010_001') + Tabs({ barPosition: BarPosition.Start, index: 2, controller: this.controller }) { + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(200) + .backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "1")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(300) + .backgroundColor(Color.Yellow) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "2")) + + TabContent() { + Column() { + Text(`barOverlap ${this.barOverlap}`).fontSize(16).margin({ top: this.barOverlap ? '56vp' : 0 }) + Text(`barBackgroundColor ${this.barBackgroundColor}`).fontSize(16) + }.width('100%').width('100%').height(400) + .backgroundColor(Color.Green) + } + .tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), "3")) + } + .vertical(true) + .barMode(BarMode.Fixed) + .height('60%') + .barOverlap(true) + .scrollable(true) + .direction(this.direction1) + .animationDuration(10) + .barBackgroundColor(this.barBackgroundColor) + } + .height(500) + .padding({ top: '24vp', left: '24vp', right: '24vp' }) + + + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..6730b9725b256994b65a0fd64f85be999cf27511 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentNavTabsMirror0110 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State tarBarMode: BarMode = BarMode.Scrollable + @State currentIndex: number = 0 + @State tarVertical: boolean = false + @State direction1: Direction = Direction.Rtl + @State selectedIndex: number = 0 + @State selectedMode: SelectedMode = SelectedMode.INDICATOR; + private controller: TabsController = new TabsController() + + @Builder + build() { + Column() { + Button('镜像改变').width('50%') + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0110_001') + + Tabs({ barPosition: BarPosition.End, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Pink }) + .selectedMode(this.selectedMode)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Yellow }) + .selectedMode(this.selectedMode)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Blue }) + .selectedMode(this.selectedMode)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green') + .labelStyle({ unselectedColor: Color.Black, selectedColor: Color.Green }) + .selectedMode(this.selectedMode)); + } + .divider({ + strokeWidth: 1, + color: Color.Red, + }) + .backgroundColor(0xF5F5F5) + .barOverlap(true) + .barMode(this.tarBarMode) + .barWidth(200) + .barHeight(200) + .vertical(true) + .margin('10vp') + .width('auto') + .height(396) + .fadingEdge(true) + .direction(this.direction1); + + }.width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..b6fb793b6e444c537de799824603da65f0874100 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0120 { + @State direction1: Direction = Direction.Rtl; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0120_001'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..02c75d2fd97d01eb5efb3ef308708cb1b603be95 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0130 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + @State direction1: Direction = Direction.Rtl; + private controller: TabsController = new TabsController() + + @Builder + tabBuilder(index: number) { + Column() { + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(20) + .fontWeight(500) + .lineHeight(200) + }.width('100%') + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, controller: this.controller }) { + TabContent() { + Column() { + Text('TabContent0') + }.width('100%') + } + .tabBar(this.tabBuilder(0)) + + TabContent() { + Column() { + Text('TabContent1') + }.width('100%') + } + .tabBar(this.tabBuilder(1)) + + TabContent() { + Column() { + Text('TabContent2') + }.width('100%') + } + .tabBar(this.tabBuilder(2)) + + TabContent() { + Column() { + Text('TabContent3') + }.width('100%') + } + .tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(200) + .barHeight(200) + .barMode(BarMode.Scrollable) + .scrollable(true) + .direction(this.direction1) + .width(400) + .height(200) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0130_001'); + + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..d7466e405898b713790c8a1d8f4697925084bb07 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0140 { + @State direction1: Direction = Direction.Rtl; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()); + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0140_001'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..82ff2997f66f12f9783850fba6efc68dc375137e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0150 { + @State direction1: Direction = Direction.Rtl; + @State tabPadding: number = 0; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column({ space: 5 }) { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink').padding(this.tabPadding)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow').padding(this.tabPadding)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue').padding(this.tabPadding)); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green').padding(this.tabPadding)); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .direction(this.direction1) + .backgroundColor(0xF1F3F5); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl; + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr; + } + }).id('UIComponentNavTabsMirror0150_001'); + + Button('padding改变').width('50%') + .onClick(() => { + this.tabPadding = this.tabPadding+5; + }).id('UIComponentNavTabsMirror0150_002'); + }.width('100%').height(400); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..5e46741b68f6fde3d9ce5a8f27a95f80e0c0f60a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0160 { + @State direction1: Direction = Direction.Rtl; + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Yellow')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle($r('sys.media.ohos_app_icon'), 'Green')) + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0160_001'); + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..371a56d47e3357783d9e204f027907c7038069e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { webview } from '@kit.ArkWeb'; +@Entry +@Component +struct UIComponentNavTabsMirror0250 { + controller: webview.WebviewController = new webview.WebviewController(); + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + @State direction1: Direction = Direction.Rtl; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.id(`Tab${index}`).width('100%') + } + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column() { + Text('www.sohu.com'); + Web({ src: 'www.sohu.com', controller: this.controller }) + .fileAccess(true); + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + TabContent() { + Column() { + Text('www.sina.com'); + Web({ src: 'www.sina.com', controller: this.controller }) + .fileAccess(true); + }.width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + TabContent() { + Column() { + Text('www.baidu.com'); + Web({ src: 'www.baidu.com', controller: this.controller }) + .fileAccess(true); + }.width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + TabContent() { + Column() { + Text('www.jd.com'); + Web({ src: 'www.jd.com', controller: this.controller }) + .fileAccess(true); + }.width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0250_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..575ea27731195f477618d307737074224233c258 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror0260 { + @State fontColor: string = '#182431'; + @State selectedFontColor: string = '#007DFF'; + @State currentIndex: number = 0; + @State selectedIndex: number = 0; + @State direction1: Direction = Direction.Rtl; + @State arr: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; + + @Builder tabBuilder(index: number) { + Column() { + Text(`Tab${index}`) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.id(`Tab${index}`).width('100%') + } + + build() { + Column({ space: 5 }) { + + Text("侧边页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(0)); + + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + }.width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder(1)); + + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + }.width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(2)); + + TabContent() { + Column() { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%') + .height(80) + .fontSize(16) + .margin(10) + .id('' + item) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + }.width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder(3)); + } + .vertical(true) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + // selectedIndex控制自定义TabBar内Image和Text颜色切换 + this.selectedIndex = targetIndex + }) + .width('100%') + .backgroundColor(0xF1F3F5) + .direction(this.direction1); + + Button('镜像改变').width('50%') + .onClick(() => { + if (this.direction1 == Direction.Ltr) { + this.direction1 = Direction.Rtl + } + else if (this.direction1 == Direction.Rtl) { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror0260_001') + + }.width('100%').height(400) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080.ets new file mode 100644 index 0000000000000000000000000000000000000000..4975aa80546b9184b23669b74447d9511537669f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080.ets @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsMirror080 { + private controller1: TabsController = new TabsController() + @State dividerColor: string = 'blue' + @State strokeWidth: number = -10 + @State strokeWidthDefaultValue: number = 2 + @State startMargin: number = 0 + @State endMargin: number = 0 + @State nullFlag: boolean = false + @State direction1: Direction = Direction.Ltr + aboutToAppear(): void { + this.strokeWidth = (this.strokeWidth < 0? this.strokeWidthDefaultValue : this.strokeWidth) + } + build() { + Column() { + Tabs({ controller: this.controller1 }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar('yellow') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar('blue') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar('green') + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar('red') + } + .vertical(true) + .direction(this.direction1) + .scrollable(true) + .barMode(BarMode.Fixed) + .barWidth(70) + .barHeight(200) + .animationDuration(400) + .onChange((index: number) => { + console.info(index.toString()) + }) + .height('200vp') + .margin({ bottom: '12vp' }) + .divider(this.nullFlag ? null : { + strokeWidth: this.strokeWidth, + color: this.dividerColor, + startMargin: this.startMargin, + endMargin: this.endMargin + }) + Button('上边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.startMargin += 2 + }).id('UIComponentNavTabsMirror080_001') + + Button('上边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.startMargin > 2) { + this.startMargin -= 2 + } + }).id('UIComponentNavTabsMirror080_002') + + Button('下边距增加').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + this.endMargin += 2 + }).id('UIComponentNavTabsMirror080_003') + Button('下边距减少').width('100%').margin({ bottom: '12vp' }) + .onClick(() => { + if (this.endMargin > 2) { + this.endMargin -= 2 + } + }).id('UIComponentNavTabsMirror080_004') + + Button('方向改变').width('50%').margin({ top: 20 }) + .onClick(()=>{ + if(this.direction1 == Direction.Ltr) + { + this.direction1 = Direction.Rtl + } + else if(this.direction1 == Direction.Rtl) + { + this.direction1 = Direction.Ltr + } + }).id('UIComponentNavTabsMirror080_005') + + + }.padding({ top: '24vp', left: '24vp', right: '24vp' }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..149dfdd8f96a321c7099312ff9def05cbc490a03 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsOnWillShow0190 { + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + @Builder tabBuilder(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + + @Builder tabBuilder1(title: string,targetIndex: number) { + Column(){ + Text(title) + }.width('100%') + .height(50) + .id(title) + .justifyContent(FlexAlign.Center) + } + + build() { + Column({ space: 5 }) { + + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder('tab1',0)) + .onWillShow(() => { + console.info("Pink will show"); + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder('tab2',1)) + .onWillShow(() => { + console.info("Yellow will show"); + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder('tab3',2)) + .onWillShow(() => { + console.info("Blue will show"); + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder('tab4',3)) + .onWillShow(() => { + console.info("Green will show"); + }); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + Text("侧边页签样式"); + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder1('tab_1',0)) + .onWillShow(() => { + console.info("Pink will show") + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(this.tabBuilder1('tab_2',1)) + .onWillShow(() => { + console.info("Yellow will show") + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder1('tab_3',2)) + .onWillShow(() => { + console.info("Blue will show") + }); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(this.tabBuilder1('tab_4',3)) + .onWillShow(() => { + console.info("Green will show") + }); + } + .vertical(true).scrollable(true).barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(400); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..e6ee291f625658c4946071d72b12480934805835 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsSubTabbarStyle0010 { + build() { + Column({ space: 5 }) { + Text("子页签样式") + Column() { + Tabs({ barPosition: BarPosition.Start }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new SubTabBarStyle('Pink').id('Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Yellow) + }.tabBar(new SubTabBarStyle('Yellow').id('Yellow')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new SubTabBarStyle('Blue').id('Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new SubTabBarStyle('Green').id('Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .id('UIComponentNavTabsSubTabbarStyle0010_001') + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f78971fd60cb4e8f817097ffa1ab28cf5b7206e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentNavTabsWidth001 { + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + private controller: TabsController = new TabsController() + + @Builder tabBuilder(index: number) { + Column() { + Image(this.currentIndex === index ? '/common/public_icon_on.svg' : '/common/public_icon_off.svg') + .width(24) + .height(24) + .margin({ bottom: 4 }) + .objectFit(ImageFit.Contain) + Text('Tab') + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(10) + .fontWeight(500) + .lineHeight(14) + }.width('100%').height('100%').justifyContent(FlexAlign.Center) + } + + build() { + Column() { + Tabs({ barPosition: BarPosition.End, controller: this.controller }) { + TabContent() { + Column() { + Text('Tab_1') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(50) + }.tabBar(this.tabBuilder(0)) + TabContent() { + Column() { + Text('Tab_2') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(100) + }.tabBar(this.tabBuilder(1)) + TabContent(){ + Column() { + Text('Tab_3') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(150) + }.tabBar(this.tabBuilder(2)) + TabContent(){ + Column() { + Text('Tab_4') + .fontSize(36) + .fontColor('#182431') + .fontWeight(500) + .opacity(0.4) + .margin({ left: 10, right: 26.5 }) + Divider() + .strokeWidth(0.5) + .color('#182431') + .opacity(0.05) + }.width(200) + }.tabBar(this.tabBuilder(3)) + } + .vertical(true) + .barWidth(96) + .barHeight(414) + .onChange((index: number) => { + this.currentIndex = index + }) + .width('auto') + .height(414) + .backgroundColor('#F1F3F5') + .margin({ top: 52 }) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..71ebe99e134e707e2761cbf5eeed2a5a8d8d7d54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0040 { + @State isRefreshing: boolean = false; + @State refreshOffset: number = 60; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Button('addRefreshOffset').width('50%').margin({ top: 20 }) + .onClick(() => { + this.refreshOffset =+ 100; + }).id('UIComponentOtherRefreshAbility0040_001'); + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(this.refreshOffset) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..16fe4f557debeff0cb84c531f031b21a6fc9b64e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0050 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(70) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..85d5d1ce8d3db497b8440620fe897765c06d7a2c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0070 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(0) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..6bd7bd78409e80f6aaa9847a3f6a0b7bb2daade1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0080 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-1) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..ddb5eaeedbb72ba22fe50cb44b168a2325a063be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0090 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(499).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(500) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..52dfb3efb9bdeede271ed401db45fb5366d4189b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshAbility0100 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(60.5) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa737a0a1018ff9cbdd6703e18967352cf7e2821 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0380 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + + @Builder refreshbBuilder(name: string) { + Column() { + Text(name) .fontSize(30).margin(10) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + }.width('100%').id('' + name) + } + + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + this.refreshbBuilder(item) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + .backgroundColor(0x89CFF0) + .refreshOffset(64) + .pullToRefresh(true) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390.ets new file mode 100644 index 0000000000000000000000000000000000000000..04944c2555ddc04aa8b4bf6729a619404eb91ca8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0390 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height(100) + } + .align(Alignment.Center) + .clip(true) + .height(200) + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400.ets new file mode 100644 index 0000000000000000000000000000000000000000..1fce4eb054fea38f4b8cb3da5b5a0c2ce3f14e1a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0400 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height(100) + } + .align(Alignment.Center) + .clip(true) + .height(200) + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410.ets new file mode 100644 index 0000000000000000000000000000000000000000..f6cd0aaa97f5a72c329304edcf90e9ceda4d756a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshInterAction0410 { + @State isRefreshing: boolean = false + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10'] + @Builder + customRefreshComponent() + { + Stack() + { + Row() + { + LoadingProgress().height(32) + Text("Refreshing...").fontSize(16).margin({left:20}) + } + .alignItems(VerticalAlign.Center) + .backgroundColor(Color.Blue) + .height('50%') + .width('50%') + } + .align(Alignment.Center) + .clip(true) + .height('50%') + .width('50%') + .backgroundColor(Color.Red) + .constraintSize({minHeight:32}) // 设置最小高度约束保证自定义组件高度随刷新区域高度变化时自定义组件高度不会低于minHeight + .width("100%") + } + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing,builder:this.customRefreshComponent()}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off) + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(64) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus) + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test') + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..b05f550841c136a04ca5073faeacb7fe834f1be3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0140 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(0) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..07269db1e9cc607229127091680bb03d6a3223cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0170 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(-100) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..49240b52287bb14d925011ab51f2c888b8192bf2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0180 { + @State isRefreshing: boolean = false; + @State promptText: string = "Refreshing..."; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Text("Refresh test") + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).id('' + item).margin({bottom:10}) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFF0000); + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(0) + .pullDownRatio(1) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false; + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..9de367744979f3369f8692121aadf9538c6d41ac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0040 { + @State isRefreshing: boolean = false; + @State promptText: string = ' '; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..d764547497cf7ced227abab3ad79ec49f4f6c015 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0050 { + @State isRefreshing: boolean = false; + @State promptText: string = "+-*<>!@#$"; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..96fc953b157f5416525c1ca51655468cede0b03c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0060 { + @State isRefreshing: boolean = false; + @State promptText: string = "中英文abc"; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100.ets new file mode 100644 index 0000000000000000000000000000000000000000..b782efe41ecb1556eb9d04bbd1bb139a6df50b64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0100 { + @State isRefreshing: boolean = false; + @State promptText: Resource = $r("app.string.specifalRefreshText"); + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe4c34ff54fd708ffee9afe3b27c9291e0f1ff5e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0110 { + @State isRefreshing: boolean = false; + @State promptText: Resource = $r("app.string.mixRefreshText"); + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..2d05b80d984fcbd7eb1128469f5a9d39a16b4550 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Entry +@Component +struct UIComponentOtherRefreshPromptText0120 { + @State isRefreshing: boolean = false; + @State promptText: string = 'openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234openHarmon1234'; + @State arr: String[] = ['0', '1', '2', '3', '4','5','6','7','8','9','10']; + + build() { + Column() { + Refresh({ refreshing: $$this.isRefreshing, promptText: this.promptText}) { + List() { + ForEach(this.arr, (item: string) => { + ListItem() { + Text('' + item) + .width('70%').height(80).fontSize(16).margin(10).id('' + item) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .onScrollIndex((first: number) => { + console.info(first.toString()) + }) + .width('100%') + .height('100%') + .alignListItem(ListItemAlign.Center) + .scrollBar(BarState.Off); + } + .backgroundColor(0x89CFF0) + .pullToRefresh(true) + .refreshOffset(96) + .onStateChange((refreshStatus: RefreshStatus) => { + console.info('Refresh onStatueChange state is ' + refreshStatus); + }) + .onOffsetChange((value: number) => { + console.info('Refresh onOffsetChange offset:' + value); + }) + .onRefreshing(() => { + setTimeout(() => { + this.isRefreshing = false + }, 2000) + console.log('onRefreshing test'); + }); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010.ets new file mode 100644 index 0000000000000000000000000000000000000000..89c89a752e3a34463117729acd757dd82d2c76db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0010 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020.ets new file mode 100644 index 0000000000000000000000000000000000000000..704f5cce1be4ba7c83f5a10823296b1b5388c718 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0020 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.media.ohos_app_icon')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030.ets new file mode 100644 index 0000000000000000000000000000000000000000..e780d6fe4c9132b5349b501d65efd69341823ba4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0030 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.magnifier')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c53f6d1326d477665c4d1ee42ba8a93b9e4fa16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0040 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')); + @State normalIcocn: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.media.ohos_app_icon')); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier1 + }, 'Pink').id('Pink')) + .onWillShow(() => { + console.info("Pink will show") + }) + .onWillHide(() => { + console.info("Pink will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier2 + }, 'Orange').id('Orange')) + .onWillShow(() => { + console.info("Orange will show") + }) + .onWillHide(() => { + console.info("Orange will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier3 + }, 'Blue').id('Blue')) + .onWillShow(() => { + console.info("Blue will show") + }) + .onWillHide(() => { + console.info("Blue will hide") + }) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.normalIcocn, + selected: this.symbolModifier4 + }, 'Green').id('Green')) + .onWillShow(() => { + console.info("Green will show") + }) + .onWillHide(() => { + console.info("Green will hide") + }) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060.ets new file mode 100644 index 0000000000000000000000000000000000000000..3c50776dd365be60e70195e4b2d0c2a66f4a886e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0060 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebba57020c7685af3170b4d1c1eb1a559db72b5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0070 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_COLOR); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080.ets new file mode 100644 index 0000000000000000000000000000000000000000..acb4ca1ef302840dca2480b86c483e7c324e9355 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0080 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier2, + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier3, + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier4, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce9e706b2fea0be07c34835610972d49d4788902 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0090 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontSize(160); + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: BarPosition.End}) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink').id('Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Orange').id('Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Blue').id('Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Green').id('Green')) + } + .vertical(false) + .scrollable(true) + .barHeight(150) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(500) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110.ets new file mode 100644 index 0000000000000000000000000000000000000000..470879273e9a42c88ff16ff609143f5a158d4715 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0110 { + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: BarPosition.End}) { + TabContent() { + Column().width(70).height(70).backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Pink')) + + TabContent() { + Column().width(80).height(80).backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Orange')) + + TabContent() { + Column().width(90).height(90).backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Blue')) + + TabContent() { + Column().width(100).height(100).backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: undefined, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(300) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120.ets new file mode 100644 index 0000000000000000000000000000000000000000..4c180d42357ac69048ff24c2b499137bfc95cb0d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0120 { + build() { + Column({space: 5}) { + Text("底部页签样式") + Column(){ + Tabs({barPosition: BarPosition.End}) { + TabContent() { + Column().width(70).height(70).backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Pink')) + + TabContent() { + Column().width(80).height(80).backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Orange')) + + TabContent() { + Column().width(90).height(90).backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Blue')) + + TabContent() { + Column().width(100).height(100).backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: null, + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index:number)=>{ + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + }.width('100%').height(300) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130.ets new file mode 100644 index 0000000000000000000000000000000000000000..dd586880c2059147ae6b210babfff43cfb482fe0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0130 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = true; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : this.symbolModifier2), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0130_001'); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140.ets new file mode 100644 index 0000000000000000000000000000000000000000..9f0655de6ec8aa7733916d4d87a1d45c677b4c1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140.ets @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT 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 { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0140 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier3: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.dot_video')).fontColor([Color.Yellow]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier4: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.exposure')).fontColor([Color.Green]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = true; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier1 : undefined), + }, 'Pink')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier2 : undefined), + }, 'Orange')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier3 : undefined), + }, 'Blue')) + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.flag ? this.symbolModifier4 : undefined), + }, 'Green')) + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5) + + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0140_001') + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150.ets new file mode 100644 index 0000000000000000000000000000000000000000..5057fc0c275745a2d8daf2c0d2477e01a70a6dea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0150 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = false; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor('#66000000') + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160.ets new file mode 100644 index 0000000000000000000000000000000000000000..da3faed1ac6cf034b741298e4a39cfe6900be86d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0160 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: null + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170.ets new file mode 100644 index 0000000000000000000000000000000000000000..877fe9c773a5c546a25a650279770d78581215e3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0170 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + selected: undefined + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3218bd606deefbe6d6363d9aadbc370ecc3cbb7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0180 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier1, + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4656f896edc2dc7f9ed8b129ba93a5a76972d82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0190 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State symbolModifier2: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ellipsis_bubble')).fontColor([Color.Pink]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = false; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + //normal: (this.flag ? this.symbolModifier1 : undefined), + normal: this.symbolModifier1, + selected: (this.flag ? this.symbolModifier2 : undefined), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0190_001'); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230.ets new file mode 100644 index 0000000000000000000000000000000000000000..f0b4156df4cb238856fcecd9e2cdeb190da62e7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0230 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle({ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa8235c7731a6373e4e4c46c8676500a39f1b581 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentTabTabBarSymbol0260 { + @State symbolModifier1: SymbolGlyphModifier = new SymbolGlyphModifier($r('sys.symbol.ohos_wifi')).fontColor([Color.Red]) + .renderingStrategy(SymbolRenderingStrategy.SINGLE); + @State flag: boolean = true; + + build() { + Column({ space: 5 }) { + Text("底部页签样式") + Column() { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Pink')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Orange) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Orange')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Blue')); + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Green) + }.tabBar(new BottomTabBarStyle(this.flag ? $r("app.media.magnifier"):{ + normal: (this.symbolModifier1), + }, 'Green')); + } + .vertical(false) + .scrollable(true) + .barMode(BarMode.Fixed) + .onChange((index: number) => { + console.info(index.toString()) + }) + .width('100%') + .backgroundColor(0xF1F3F5); + + Button('样式切换').width('50%') + .onClick(() => { + this.flag = !this.flag + }).id('UIComponentTabTabBarSymbol0260_001'); + }.width('100%').height(200) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050.ets new file mode 100644 index 0000000000000000000000000000000000000000..afd3436bca671cd84fa0040435b57e494ba1ee86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0050 { + @State isModifier: boolean = true; + @State currentIndex: number = 0; + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK; + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.openeye')); + @State symbolModifiers: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.icon')); + @State symbolModifierSelect: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.closeeye')); + private controller: TabsController = new TabsController(); + + build() { + Column() { + Button('isModifier') + .id('UIComponentTabTabbarTabbarsymbol0050_001') + .onClick(() => { + this.isModifier = !this.isModifier; + }) + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.isModifier ? this.symbolModifier : this.symbolModifiers, + selected: this.symbolModifierSelect + }, 'Black') + .iconStyle({ unselectedColor: this.isModifier ? Color.Red : Color.Pink, selectedColor: Color.Green })) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.isModifier ? this.symbolModifier : this.symbolModifiers, + selected: this.symbolModifierSelect + }, 'Pink')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg: 10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240.ets new file mode 100644 index 0000000000000000000000000000000000000000..7ead2fcc8f5f7ca3ac05ee77d358e2ed5927e38e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0240 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + private controller: TabsController = new TabsController() + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.icon')) + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier + }, 'Black')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier + }, 'Pink')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg:10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250.ets new file mode 100644 index 0000000000000000000000000000000000000000..8bb31d6822ed36badf3534ef196eceb7fea73000 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License') + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SymbolGlyphModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentTabTabbarTabbarsymbol0250 { + @State currentIndex: number = 0 + @State blurStyle: BlurStyle = BlurStyle.BACKGROUND_THICK + @State symbolModifier: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.openeye')) + @State symbolModifierSelect: SymbolGlyphModifier = new SymbolGlyphModifier($r('app.media.closeeye')) + private controller: TabsController = new TabsController() + + build() { + Column() { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Black) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Black')) + + TabContent() { + Column().width(500).height('100%').backgroundColor(Color.Pink) + } + .tabBar(new BottomTabBarStyle({ + normal: this.symbolModifier, + selected: this.symbolModifierSelect + }, 'Black')) + + } + .barBackgroundBlurStyle(BlurStyle.BACKGROUND_REGULAR) + .barOverlap(true) + .barGridAlign( + { + lg: 10 + } + ) + .height(296) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json index 989acc491a1f2c97ded461ca1dc60a58faa0b666..4038f619b6a75b6e28b75700455d382845eeaec6 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/float.json @@ -3,6 +3,14 @@ { "name": "boardSize_10", "value": "10" + }, + { + "name": "strokewidth_10", + "value": "10" + }, + { + "name": "bbb", + "value": "5" } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json index 0cf2364d45a04a8728c52846397b489032563833..6d4e4892ee5e79ab56cb0ad3e5f4f4ede5fef036 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/integer.json @@ -10,6 +10,33 @@ },{ "name": "50", "value": 50 + },{ + "name": "integer30", + "value": 30 + },{ + "name": "integer100", + "value": 100 + },{ + "name": "string30", + "value": 30 + },{ + "name": "30", + "value": 30 + },{ + "name": "15", + "value": 15 + }, + { + "name": "100", + "value": 100 + }, + { + "name": "negative30", + "value": -30 + }, + { + "name": "integer333", + "value": 333 } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json index 4e5dc1f07e9f34d3eef407ede05120f2161efba4..5f06f6102159e4a79af2c11681a21bf4f5c5495a 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/element/string.json @@ -55,6 +55,138 @@ { "name": "font_20", "value": "20" + }, + { + "name": "attributeUpdater", + "value": "resource font" + }, + { + "name": "dsfsfsf", + "value": "dsfsfsf" + }, + { + "name": "empty", + "value": "" + }, + { + "name": "string100", + "value": "100px" + }, + { + "name": "string_200px", + "value": "200px" + }, + { + "name": "string_24", + "value": "24%" + }, + { + "name": "apple", + "value": "苹果" + }, + { + "name": "fruit", + "value": "水果" + }, + { + "name": "appliance", + "value": "家电" + }, + { + "name": "banana", + "value": "香蕉" + }, + { + "name": "tv", + "value": "电视" + }, + { + "name": "computer", + "value": "电脑" + }, + { + "name": "string_300px", + "value": "300px" + }, + { + "name": "string_60", + "value": "60%" + }, + { + "name": "Hyperlink_address", + "value": "https://www.openharmony.cn/mainPlay" + }, + { + "name": "popup_width", + "value": "30px" + }, + { + "name": "popup_arrow_offset", + "value": "205%" + }, + { + "name": "popup_target_space", + "value": "30px" + }, + { + "name": "popup_offset_x", + "value": "30px" + }, + { + "name": "popup_radius", + "value": "100vp" + }, + { + "name": "popup_negative_radius", + "value": "-30px" + }, + { + "name": "popup_font_family", + "value": "'HarmonyOS Sans'" + }, + { + "name": "string1", + "value": "30vp" + }, + { + "name": "50_percent", + "value": "50%" + }, + { + "name": "24_percent", + "value": "24%" + }, + { + "name": "lineHeightSize", + "value": "60fp" + }, + { + "name": "popup_font_time_picker", + "value": "Arial,HarmonyOS Sans" + }, + { + "name": "time_picker_10vp", + "value": "10vp" + }, + { + "name": "time_picker_10fp", + "value": "10fp" + }, + { + "name": "mixRefreshText", + "value": "中英文abc" + }, + { + "name": "specifalRefreshText", + "value": "+-*<>!@#$" + }, + { + "name": "width_20", + "value": "20" + }, + { + "name": "height_20", + "value": "20" } ] } \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/magnifier.svg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/magnifier.svg new file mode 100644 index 0000000000000000000000000000000000000000..a8e61ed1727ca0731eba11de69342da854ce3452 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/magnifier.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_search_filled + + + + + + + + + + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/tick.svg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/tick.svg new file mode 100644 index 0000000000000000000000000000000000000000..74490ce3029b43130497e0efbba02cda2de6edf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/tick.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_select all + + + + + + + + + + \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/waterFlowTest.jpg b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/waterFlowTest.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e7134f381c8218491244fb6c34fcc608d4dd65e9 Binary files /dev/null and b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/media/waterFlowTest.jpg differ diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 6b8f2a77c748f64f8b38fb5f0bda6260ee1d8268..d80234b844cd1df01242a87ca37cb1a7547eb8ae 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -452,6 +452,378 @@ "testability/pages/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholder00103_040", "testability/pages/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholder00103_040_934", "testability/pages/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholder00104", - "testability/pages/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholder00105" + "testability/pages/ComponentTextRicheditorPlaceholderTest/ComponentTextRicheditorPlaceholder00105", + + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0310", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt001", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt002", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt003", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt004", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0050", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt007", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0080", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt010", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt011", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt012", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt013", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt014", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0150", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0180", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0210", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0240", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt027", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt028", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt030", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt032", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt033", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt034", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt035", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0160", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0190", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0220", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0250", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0170", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0200", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0230", + "testability/pages/UIComponentNavTabsContentAdapt/UIComponentNavTabsContentAdapt0260", + + "testability/pages/ArkUITabScrollable/ArkUITabScrollable001", + "testability/pages/ArkUITabScrollable/ArkUITabScrollable002", + + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont005", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont007", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont008", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont009", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont010", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont011", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont015", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont016", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont020", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont001", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont003", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont004", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont006", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont012", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont013", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont017", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont018", + "testability/pages/ArkUITabsLabelStylefont/ArkUITabsLabelStylefont019", + + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor001", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor003", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor005", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor007", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor009", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor011", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor013", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor017", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor019", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor027", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor029", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor012", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor015", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor021", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor023", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor024", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor025", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor026", + "testability/pages/ArkUITabsLabelStyleSelectedColor/ArkUITabsLabelStyleSelectedColor028", + + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor001", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor005", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor008", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor011", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor012", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor017", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor021", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor022", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor025", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor026", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor027", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor028", + "testability/pages/ArkUITabsLabelStyleUnselectedColor/ArkUITabsLabelStyleUnselectedColor024", + + "testability/pages/ArkUITabsVertical/ArkUITabsVertical001", + + "testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow001806", + "testability/pages/FunctionJichuWaterFlow/FunctionJichuWaterFlow0350", + + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0080458", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0090321", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0100678", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0110972", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0120725", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0130072", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0140666", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0150827", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0160890", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0170444", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0270011", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0280056", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0290223", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0300414", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0310330", + "testability/pages/UIComponentListAndGridWaterFlowAdd/UIComponentListAndGridWaterFlowAdd0320534", + + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0370", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0380", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0390", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0400", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0410", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0420", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0500", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0510", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0520", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0530", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0540", + "testability/pages/UIComponentListAndGridWaterSections/UIComponentListAndGridWaterSections0560", + + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0370", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0380", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0400", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier041", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier043", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier044", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier045", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier046", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier048", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier053", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier056", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier058", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier060", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier063", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier065", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier066", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0770", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0810", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier083", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0840", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0860", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0900", + "testability/pages/UIComponentNavModifier/UIComponentNavModifier0920", + + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0011", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0012", + "testability/pages/UIComponentNavTabsAction/UIComponentNavTabsAction0030", + + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0010", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0011", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0012", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0013", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0014", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0015", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0016", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0017", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0029", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0030", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0031", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0032", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0033", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0034", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0035", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0036", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0038", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0039", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0040", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0041", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0042", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0043", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0044", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0045", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0046", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0048", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0049", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0050", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0018", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0019", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0020", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0021", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0022", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0023", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0024", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0025", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0026", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0027", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0028", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0047", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0051", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0052", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0053", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0060", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0080", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0100", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0110", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0160", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0170", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0180", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0190", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0200", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0210", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0220", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0230", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0240", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0250", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0260", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0270", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0280", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0290", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0300", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0310", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0320", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0340", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0350", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0360", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0370", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0380", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0390", + "testability/pages/UIComponentNavTabsBlurStyle/UIComponentNavTabsBlurStyle0400", + + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount014", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount015", + "testability/pages/UIComponentNavTabsCachedCount/UIComponentNavTabsCachedCount016", + + "testability/pages/UIComponentNavTabsHeight/UIComponentNavTabsHeight001", + + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0010", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0020", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0030", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0040", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0060", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0070", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0080", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0120", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0130", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0140", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0150", + "testability/pages/UIComponentNavTabsImproTrace/UIComponentNavTabsImproTrace0160", + + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0010", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0030", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0040", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0050", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0060", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0070", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0080", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0090", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0130", + "testability/pages/UIComponentNavTabsInterception/UIComponentNavTabsInterception0150", + + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface012", + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1190", + "testability/pages/UIComponentNavTabsInterface/UIComponentNavTabsInterface1220", + + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0030", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0070", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0090", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror010", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0110", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0120", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0130", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0140", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0150", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0160", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0250", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror0260", + "testability/pages/UIComponentNavTabsMirror/UIComponentNavTabsMirror080", + + "testability/pages/UIComponentNavTabsOnWillShow/UIComponentNavTabsOnWillShow0190", + + "testability/pages/UIComponentNavTabsSubTabbarStyle/UIComponentNavTabsSubTabbarStyle0010", + + "testability/pages/UIComponentNavTabsWidth/UIComponentNavTabsWidth001", + + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0040", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0050", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0070", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0080", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0090", + "testability/pages/UIComponentOtherRefreshAbility/UIComponentOtherRefreshAbility0100", + + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0380", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0390", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0400", + "testability/pages/UIComponentOtherRefreshInterAction/UIComponentOtherRefreshInterAction0410", + + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0140", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0170", + "testability/pages/UIComponentOtherRefreshInterface/UIComponentOtherRefreshInterface0180", + + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0040", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0050", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0060", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0100", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0110", + "testability/pages/UIComponentOtherRefreshPromptText/UIComponentOtherRefreshPromptText0120", + + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0010", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0020", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0030", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0040", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0060", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0070", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0080", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0090", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0110", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0120", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0130", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0140", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0150", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0160", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0170", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0180", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0190", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0230", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabBarSymbol0260", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0050", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0240", + "testability/pages/UIComponentTabTabBarSymbol/UIComponentTabTabbarTabbarsymbol0250", + + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0230", + "testability/pages/UIComponentNavTabsEdgeeffect/UIComponentNavTabsEdgeeffect0270", + + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0090", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0010", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0120", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0050", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0080", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0070", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0060", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0040", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0030", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0020", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0100", + "testability/pages/UIComponentNavTabsExpandsafearea/UIComponentNavTabsExpandsafearea0110", + + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor001", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor004", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor008", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor013", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor014", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor022", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor024", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor025", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor026", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor027", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor028", + "testability/pages/ArkUITabsIconStyleSelectedColor/ArkUITabsIconStyleSelectedColor029", + + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor002", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor005", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor014", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor016", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor021", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor022", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor024", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor026", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor027", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor028", + "testability/pages/ArkUITabsIconStyleUnselectedColor/ArkUITabsIconStyleUnselectedColor029", + + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor002", + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor005", + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor008", + "testability/pages/ArkUITabsSingleSelectedcolor/ArkUITabsSingleSelectedcolor011", + + "testability/pages/ArkUITabsSingleUnselectedcolor/ArkUITabsSingleUnselectedcolor003" ] }