diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui.test.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..6a97b39fa23cf4823684645a5d2355b48ad4461e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/test/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui.test.ets @@ -0,0 +1,1064 @@ +/* + * 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, Level } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON,Component ,MouseButton } from '@ohos.UiTest' +/* + * SUB_ACE_UI_ATTRIBUTES_FONT_INTERFACE_0010:设置文本颜色 + * + * Settings.createWindow(config.url): + * 创建窗口,更改窗口基本配置,更改方式详见model/Settings createWindow方法 + * + * windowSnap.snapShot(globalThis.context): + * 窗口截屏&图片文件保存,存储在设备端 + * 存储文件固定,单挑用例执行后覆盖,用于自动化UI对比 + * 支持调试更改文件名为时间戳格式,更改model/snapShot createAndGetFile方法 注释L35,放开L32,L33 + * + * Logger日志使用方法: + * import Logger form './model/Logger' + * Logger.info(TAG,`config = ${config}, err = ${JSON.stringify(exception)}`) + * */ + +export default function UiComponentButtonTextPickerArkui() { + + describe('UiComponentButtonTextPickerArkui', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0760 + * @tc.name rating set stars to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0760', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0760 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui01") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0760 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0750 + * @tc.name rating set stars to 3 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0750', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0750 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui02") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0750 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0800 + * @tc.name set starStyle to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0800', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0800 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui03") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0800 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0790 + * @tc.name set starStyle to Custom images + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0790', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0790 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui04") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0790 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0770 + * @tc.name set stepSize to 0.5 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0770', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0770 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui05") + let driver:Driver=Driver.create(); + let button: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui05_02'),1000); + await button.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await button.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0770 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0310 + * @tc.name checkboxGroup set selected to true + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0310', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0310 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui06") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0310 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0320 + * @tc.name checkboxGroup set selected to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0320', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0320 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui07") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0320 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0330 + * @tc.name checkboxGroup set selectedColor to #007DAA + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0330', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0330 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui08") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0330 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0340 + * @tc.name checkboxGroup set selectedColor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0340', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0340 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui09") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0340 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0350 + * @tc.name checkboxGroup set unselectedColor to Color.Red + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0350', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0350 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui10") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0350 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0360 + * @tc.name checkboxGroup set unselectedColor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0360', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0360 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui11") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0360 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0400 + * @tc.name checkboxGroup set checkboxShape to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0400', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0400 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui12") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0400 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0390 + * @tc.name checkboxGroup set checkboxShape to ROUNDED_SQUARE + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0390', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0390 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui13") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0390 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0370 + * @tc.name checkboxGroup set mark + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0370', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0370 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui14") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0370 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0380 + * @tc.name checkboxGroup set mark to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0380', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0380 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui15") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0380 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0190 + * @tc.name checkbox set selected to true + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0190', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0190 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui16") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0200 + * @tc.name checkbox set selected to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0200', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0200 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui17") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0200 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0210 + * @tc.name checkbox set selectColor to 0xed6f21 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0210', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0210 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui18") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0210 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0220 + * @tc.name checkbox set selectColor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0220', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0220 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui19") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0220 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0260 + * @tc.name checkbox set unselectColor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0260', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0260 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui20") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0260 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0250 + * @tc.name checkbox set unselectColor to 0xed6f21 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0250', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0250 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui21") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0250 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0270 + * @tc.name checkbox set mask + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0270', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0270 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui22") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0270 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0280 + * @tc.name checkbox set mask to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0280', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0280 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui23") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0280 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0300 + * @tc.name checkbox set contentModifier to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0300', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0300 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui24") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0300 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0240 + * @tc.name checkbox set checkbox shape to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0240', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0240 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui25") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0240 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0230 + * @tc.name checkbox set checkbox shape to ROUNDED_SQUARE + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0230', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0230 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui26") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0230 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0840 + * @tc.name select set value 'TTTTT' + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0840', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0840 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui27") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0840 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0850 + * @tc.name select set value to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0850', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0850 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui28") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0850 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0830 + * @tc.name select set selected to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0830', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0830 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui29") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui29'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0830 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0880 + * @tc.name select set fontcolor to '#188888' + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0880', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0880 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui30") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0880 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0890 + * @tc.name select set fontcolor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0890', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0890 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui31") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0890 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0860 + * @tc.name select set font to { size: 20, weight: 500 } + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0860', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0860 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui32") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0860 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0870 + * @tc.name select set font to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0870', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0870 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui33") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0870 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0900 + * @tc.name select set selectedOptionBgColor to Color.Pink + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0900', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0900 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui34") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui34'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0900 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0910 + * @tc.name select set selectedOptionBgColor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0910', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0910 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui35") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui35'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0910 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0940 + * @tc.name select set selectedOptionFontColor to Orange + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0940', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0940 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui36") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui36'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0940 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0950 + * @tc.name select set selectedOptionFontColor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0950', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0950 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui37") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui37'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0950 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1000 + * @tc.name select set optionFontColor to black + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1000', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1000 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui38") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui38'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1000 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0920 + * @tc.name select set selectedOptionFont to { size: 26, weight: 400 } + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0920', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0920 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui39") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui39'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0920 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0930 + * @tc.name select set selectedOptionFont to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0930', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0930 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui40") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui40'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0930 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0960 + * @tc.name select set optionBgColor to #188800 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0960', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0960 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui41") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui41'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0960 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0970 + * @tc.name select set optionBgColor to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0970', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0970 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui42") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui42'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0970 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0980 + * @tc.name select set optionFont to { size: 26, weight: 400 } + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0980', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0980 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui43") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui43'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0980 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0990 + * @tc.name select set optionFont to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0990', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0990 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui44") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui44'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0990 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0820 + * @tc.name select set selected to 2 + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0820', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0820 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui45") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui45'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0820 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1170 + * @tc.name select set ControlSize to normal + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1170', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1170 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui46") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui46'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1170 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1180 + * @tc.name select set ControlSize to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1180', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1180 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui47") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui47'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1180 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1190 + * @tc.name select set menuItemContentModifier to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1190', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1190 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui48") + let driver:Driver=Driver.create(); + let select: Component = await driver.waitForComponent(ON.id('UiComponentButtonTextPickerArkui48'),1000); + await select.click(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_1190 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0720 + * @tc.name radio set check to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0720', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0720 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui49") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0720 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0710 + * @tc.name radio set check to true + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0710', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0710 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui50") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0710 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0730 + * @tc.name radio set contentModifier to undefined + * @tc.desc Function test + * @tc.size MediumTest + * @tc.type Function + * @tc.level 0 + */ + it('SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0730', Level.LEVEL0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0730 start.`); + Settings.createWindow("testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui51") + let driver:Driver=Driver.create(); + await driver.waitForIdle(500,2000) + windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_BUTTON_TEXTPICKER_ARKUI_0730 finish.`); + done() + }) + + }) +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui01.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui01.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c1ae1932dda277d574e4754f4105cd647c45bfa --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui01.ets @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class MyRatingStyle2 implements ContentModifier { + name: string = ""; + style: number = 0; + + constructor(value1: string, value2: number) { + this.name = value1; + this.style = value2; + } + + applyContent(): WrappedBuilder<[RatingConfiguration]> { + return wrapBuilder(buildRating2); + } +} + +@Builder +function buildRating2(config: RatingConfiguration) { + Column() { + Row() { + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(0.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(1); + return + } + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(1); + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(1.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(2); + return + } + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(2); + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(2.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(3); + return + } + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(3); + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(3.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(4); + return + } + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(4); + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(4.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(5); + return + } + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(5); + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden) + } + + Text("分值:" + config.rating) + } +} + +@Entry +@Component +struct UiComponentButtonTextPickerArkui01 { + @State text: string = 'set stars to undefined'; + @State rating: number = 0; + @State ratingIndicator: boolean = true; + @State ratingStars: number = 0; + @State ratingStepsize: number = 0.5; + @State ratingEnabled: boolean = true; + + build() { + Row() { + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ + rating: undefined, + indicator: this.ratingIndicator + }) + .id('UiComponentButtonTextPickerArkui01') + .stepSize(this.ratingStepsize) + .stars(this.ratingStars) + .backgroundColor(Color.Transparent) + .width('100%') + .height(50) + .onChange((value: number) => { + console.info('Rating change is' + value); + this.rating = value; + }) + .contentModifier(new MyRatingStyle2("hello", 3)) + Button(this.ratingIndicator ? "ratingIndicator : true" : "ratingIndicator : false") + .onClick((event) => { + if (this.ratingIndicator) { + this.ratingIndicator = false; + } else { + this.ratingIndicator = true; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStars < 5 ? "ratingStars + 1, ratingStars =" + this.ratingStars : "ratingStars最大值为5") + .onClick((event) => { + if (this.ratingStars < 5) { + this.ratingStars += 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStars > 0 ? "ratingStars - 1, ratingStars =" + this.ratingStars : + "ratingStars小于等于0时默认等于5") + .onClick((event) => { + if (this.ratingStars > 0) { + this.ratingStars -= 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStepsize == 0.5 ? "ratingStepsize : 0.5" : "ratingStepsize : 1") + .onClick((event) => { + if (this.ratingStepsize == 0.5) { + this.ratingStepsize = 1; + } else { + this.ratingStepsize = 0.5; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui02.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui02.ets new file mode 100644 index 0000000000000000000000000000000000000000..e41a85de5746c49509fe6d0b749e2a2588285c4f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui02.ets @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class MyRatingStyle implements ContentModifier { + name: string = ""; + style: number = 0; + + constructor(value1: string, value2: number) { + this.name = value1; + this.style = value2; + } + + applyContent(): WrappedBuilder<[RatingConfiguration]> { + return wrapBuilder(buildRating); + } +} + +@Builder +function buildRating(config: RatingConfiguration) { + Column() { + Row() { + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(0.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(1); + return + } + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(1); + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(1.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(2); + return + } + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(2); + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(2.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(3); + return + } + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(3); + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(3.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(4); + return + } + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(4); + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(4.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(5); + return + } + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(5); + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden) + } + + Text("分值:" + config.rating) + } +} + +@Entry +@Component +struct UiComponentButtonTextPickerArkui02 { + @State text: string = 'set stars to 3'; + @State rating: number = 0; + @State ratingIndicator: boolean = false; + @State ratingStars: number = 3; + @State ratingStepsize: number = 0.5; + @State ratingEnabled: boolean = true; + + build() { + Row() { + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ + rating: 5, + indicator: this.ratingIndicator + }) + .stepSize(this.ratingStepsize) + .stars(this.ratingStars) + .backgroundColor(Color.Transparent) + .width('100%') + .height(50) + .onChange((value: number) => { + console.info('Rating change is' + value); + this.rating = value; + }) + .id("UiComponentButtonTextPickerArkui02_01") + .contentModifier(new MyRatingStyle("hello", 3)) + Button(this.ratingIndicator ? "ratingIndicator : true" : "ratingIndicator : false") + .onClick((event) => { + if (this.ratingIndicator) { + this.ratingIndicator = false; + } else { + this.ratingIndicator = true; + } + }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .margin({ top: 5 }) + + Button(this.ratingStars < 5 ? "ratingStars + 1, ratingStars =" + this.ratingStars : "ratingStars最大值为5") + .onClick((event) => { + if (this.ratingStars < 5) { + this.ratingStars += 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStars > 0 ? "ratingStars - 1, ratingStars =" + this.ratingStars : + "ratingStars小于等于0时默认等于5") + .onClick((event) => { + if (this.ratingStars > 0) { + this.ratingStars -= 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStepsize == 0.5 ? "ratingStepsize : 0.5" : "ratingStepsize : 1") + .onClick((event) => { + if (this.ratingStepsize == 0.5) { + this.ratingStepsize = 1; + } else { + this.ratingStepsize = 0.5; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui03.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui03.ets new file mode 100644 index 0000000000000000000000000000000000000000..49dd0713860a2aa31b31608226641231bd47b70e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui03.ets @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class MyRatingStyle3 implements ContentModifier { + name: string = ""; + style: number = 0; + + constructor(value1: string, value2: number) { + this.name = value1; + this.style = value2; + } + + applyContent(): WrappedBuilder<[RatingConfiguration]> { + return wrapBuilder(buildRating3); + } +} + +@Builder +function buildRating3(config: RatingConfiguration) { + Column() { + Row() { + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(0.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(1); + return + } + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(1); + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(1.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(2); + return + } + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(2); + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(2.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(3); + return + } + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(3); + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(3.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(4); + return + } + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(4); + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(4.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(5); + return + } + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(5); + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden) + } + + Text("分值:" + config.rating) + } +} + +@Entry +@Component +struct UiComponentButtonTextPickerArkui03 { + @State text: string = 'set starStyle to undefined'; + @State rating: number = 0; + @State ratingIndicator: boolean = false; + @State ratingStars: number = 3; + @State ratingStepsize: number = 0.5; + @State ratingEnabled: boolean = true; + + build() { + Row() { + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ + rating: 5, + indicator: this.ratingIndicator, + }) + .starStyle({ + backgroundUri: undefined, + foregroundUri: undefined, + secondaryUri: undefined, + }) + .stepSize(this.ratingStepsize) + .stars(this.ratingStars) + .backgroundColor(Color.Transparent) + .width('100%') + .height(50) + .onChange((value: number) => { + console.info('Rating change is' + value); + this.rating = value; + }) + .id("UiComponentButtonTextPickerArkui02_01") + + Button(this.ratingIndicator ? "ratingIndicator : true" : "ratingIndicator : false") + .onClick((event) => { + if (this.ratingIndicator) { + this.ratingIndicator = false; + } else { + this.ratingIndicator = true; + } + }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .margin({ top: 5 }) + + Button(this.ratingStars < 5 ? "ratingStars + 1, ratingStars =" + this.ratingStars : "ratingStars最大值为5") + .onClick((event) => { + if (this.ratingStars < 5) { + this.ratingStars += 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStars > 0 ? "ratingStars - 1, ratingStars =" + this.ratingStars : + "ratingStars小于等于0时默认等于5") + .onClick((event) => { + if (this.ratingStars > 0) { + this.ratingStars -= 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStepsize == 0.5 ? "ratingStepsize : 0.5" : "ratingStepsize : 1") + .onClick((event) => { + if (this.ratingStepsize == 0.5) { + this.ratingStepsize = 1; + } else { + this.ratingStepsize = 0.5; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui04.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui04.ets new file mode 100644 index 0000000000000000000000000000000000000000..54c302fcea82730291ee11d12415da500f1b4712 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui04.ets @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class MyRatingStyle4 implements ContentModifier { + name: string = ""; + style: number = 0; + + constructor(value1: string, value2: number) { + this.name = value1; + this.style = value2; + } + + applyContent(): WrappedBuilder<[RatingConfiguration]> { + return wrapBuilder(buildRating4); + } +} + +@Builder +function buildRating4(config: RatingConfiguration) { + Column() { + Row() { + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(0.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(1); + return + } + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(1); + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(1.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(2); + return + } + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(2); + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(2.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(3); + return + } + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(3); + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(3.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(4); + return + } + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(4); + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(4.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(5); + return + } + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(5); + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden) + } + + Text("分值:" + config.rating) + } +} + +@Entry +@Component +struct UiComponentButtonTextPickerArkui04 { + @State text: string = 'set starStyle to Custom images'; + @State rating: number = 0; + @State ratingIndicator: boolean = false; + @State ratingStars: number = 3; + @State ratingStepsize: number = 0.5; + @State ratingEnabled: boolean = true; + + build() { + Row() { + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ + rating: 5, + indicator: this.ratingIndicator, + }) + .starStyle({ + backgroundUri: '/icon.png', + foregroundUri: '/icon.png', + secondaryUri: '/icon.png', + }) + .stepSize(this.ratingStepsize) + .stars(this.ratingStars) + .backgroundColor(Color.Transparent) + .width('100%') + .height(50) + .onChange((value: number) => { + console.info('Rating change is' + value); + this.rating = value; + }) + .id("UiComponentButtonTextPickerArkui02_01") + + Button(this.ratingIndicator ? "ratingIndicator : true" : "ratingIndicator : false") + .onClick((event) => { + if (this.ratingIndicator) { + this.ratingIndicator = false; + } else { + this.ratingIndicator = true; + } + }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .margin({ top: 5 }) + + Button(this.ratingStars < 5 ? "ratingStars + 1, ratingStars =" + this.ratingStars : "ratingStars最大值为5") + .onClick((event) => { + if (this.ratingStars < 5) { + this.ratingStars += 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStars > 0 ? "ratingStars - 1, ratingStars =" + this.ratingStars : + "ratingStars小于等于0时默认等于5") + .onClick((event) => { + if (this.ratingStars > 0) { + this.ratingStars -= 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStepsize == 0.5 ? "ratingStepsize : 0.5" : "ratingStepsize : 1") + .onClick((event) => { + if (this.ratingStepsize == 0.5) { + this.ratingStepsize = 1; + } else { + this.ratingStepsize = 0.5; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui05.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui05.ets new file mode 100644 index 0000000000000000000000000000000000000000..18de3ca1a1a22b8444aa35a15ed858f6ccb75d5e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui05.ets @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class MyRatingStyle5 implements ContentModifier { + name: string = ""; + style: number = 0; + + constructor(value1: string, value2: number) { + this.name = value1; + this.style = value2; + } + + applyContent(): WrappedBuilder<[RatingConfiguration]> { + return wrapBuilder(buildRating5); + } +} + +@Builder +function buildRating5(config: RatingConfiguration) { + Column() { + Row() { + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(0.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(1); + return + } + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 0.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(1); + } + }).visibility(config.stars >= 1 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(1.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(2); + return + } + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 1.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(2); + } + }).visibility(config.stars >= 2 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(2.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(3); + return + } + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 2.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(3); + } + }).visibility(config.stars >= 3 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(3.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(4); + return + } + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 3.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(4); + } + }).visibility(config.stars >= 4 ? Visibility.Visible : Visibility.Hidden) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.4 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + if (config.stepSize = 0.5) { + config.triggerChange(4.5); + return + } + if (config.stepSize = 1) { + config.triggerChange(5); + return + } + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden).margin({ left: 10 }) + Circle({ width: 25, height: 25 }) + .fill(config.rating >= 4.9 ? Color.Black : Color.Red) + .onClick((event: ClickEvent) => { + if (!config.indicator) { + config.triggerChange(5); + } + }).visibility(config.stars >= 5 ? Visibility.Visible : Visibility.Hidden) + } + + Text("分值:" + config.rating) + } +} + +@Entry +@Component +struct UiComponentButtonTextPickerArkui05 { + @State text: string = 'set stepSize to 0.5'; + @State rating: number = 0; + @State ratingIndicator: boolean = true; + @State ratingStars: number = 0; + @State ratingStepsize: number = 0.5; + @State ratingEnabled: boolean = true; + @State addstep: number = 0; + + build() { + Row() { + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ + rating: 0+this.addstep, + indicator: this.ratingIndicator + }) + .id('UiComponentButtonTextPickerArkui05') + .stepSize(this.ratingStepsize) + .stars(this.ratingStars) + .backgroundColor(Color.Transparent) + .width('100%') + .height(50) + .onChange((value: number) => { + console.info('Rating change is' + value); + this.rating = value; + }) + .contentModifier(new MyRatingStyle5("hello", 3)) + Button(this.ratingIndicator ? "ratingIndicator : true" : "ratingIndicator : false") + .onClick((event) => { + if (this.ratingIndicator) { + this.ratingIndicator = false; + } else { + this.ratingIndicator = true; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStars < 5 ? "ratingStars + 1, ratingStars =" + this.ratingStars : "ratingStars最大值为5") + .onClick((event) => { + if (this.ratingStars < 5) { + this.ratingStars += 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStars > 0 ? "ratingStars - 1, ratingStars =" + this.ratingStars : + "ratingStars小于等于0时默认等于5") + .onClick((event) => { + if (this.ratingStars > 0) { + this.ratingStars -= 1; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + + Button(this.ratingStepsize == 0.5 ? "ratingStepsize : 0.5" : "ratingStepsize : 1") + .onClick((event) => { + if (this.ratingStepsize == 0.5) { + this.ratingStepsize = 1; + } else { + this.ratingStepsize = 0.5; + } + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + Button('add scores') + .onClick((event) => { + this.addstep+=this.ratingStepsize + }) + .margin({ top: 5 }) + .type(ButtonType.Capsule) + .backgroundColor(0x317aff) + .labelStyle({ overflow: TextOverflow.Clip, + maxLines: 1, + minFontSize: 10, + maxFontSize: 20, + font: { + size: 14, + weight: FontWeight.Bolder, + family: 'cursive', + style: FontStyle.Italic + } + }) + .id('UiComponentButtonTextPickerArkui05_02') + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + } + .height('100%') + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui06.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui06.ets new file mode 100644 index 0000000000000000000000000000000000000000..b3c474019094d312a49008b76111311c31117dd0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui06.ets @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui06 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the select to true" + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(CheckBoxShape.CIRCLE) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(14) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui07.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui07.ets new file mode 100644 index 0000000000000000000000000000000000000000..210c2990279e94e0939e1131f71c0e7cebba484b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui07.ets @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui07 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = undefined; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the select to undefined" + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(CheckBoxShape.CIRCLE) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui08.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui08.ets new file mode 100644 index 0000000000000000000000000000000000000000..66160113bd67ecfe49933578981cbed42d61539b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui08.ets @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui08 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the selectColor to #007DAA" + @State color: string='#007DAA' + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor(this.color) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor(this.color) + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor(this.color) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(CheckBoxShape.CIRCLE) + .selectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui09.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui09.ets new file mode 100644 index 0000000000000000000000000000000000000000..64a6b6f906840fe9901ce7d6fa7ef94c927b7825 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui09.ets @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui09 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the selectColor to undefined" + @State color: string|undefined = undefined + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor(this.color) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor(this.color) + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor(this.color) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(CheckBoxShape.CIRCLE) + .selectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui10.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui10.ets new file mode 100644 index 0000000000000000000000000000000000000000..8249fd2bb7b12ca7308cd4fc933a7eeefc350794 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui10.ets @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui10 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the unselectColor to Color.Red" + @State color: Color = Color.Red + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(CheckBoxShape.CIRCLE) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui11.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui11.ets new file mode 100644 index 0000000000000000000000000000000000000000..037137b65865425551c381d6e175a55bd36a6080 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui11.ets @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui11 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the unselectColor to undefined" + @State color: Color|undefined = undefined + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(CheckBoxShape.CIRCLE) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui12.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui12.ets new file mode 100644 index 0000000000000000000000000000000000000000..779919f5bf94f496c140586759ba4dab98daf648 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui12.ets @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui12 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the checkboxShape to undefined" + @State color: Color|undefined = Color.Gray + @State shape : CheckBoxShape|undefined= undefined + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui13.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui13.ets new file mode 100644 index 0000000000000000000000000000000000000000..6676cfd06874872dab37e8cd7e9df879c112a079 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui13.ets @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui13 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set the checkboxShape to ROUNDED_SQUARE" + @State color: Color|undefined = Color.Gray + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui14.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui14.ets new file mode 100644 index 0000000000000000000000000000000000000000..ca11b5c15b0bf5339b06f8c2b43f28096e20090c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui14.ets @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui14 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set mark to red and 20vp" + @State color: Color|undefined = Color.Gray + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui15.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui15.ets new file mode 100644 index 0000000000000000000000000000000000000000..be6e4938f360f64444a4a00afd811ae9a861c559 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui15.ets @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui15 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="CheckboxGroup set mark to undefined" + @State color: Color|undefined = Color.Gray + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark(undefined) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark(undefined) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark(undefined) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark(undefined) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui16.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui16.ets new file mode 100644 index 0000000000000000000000000000000000000000..8564478fe4e28230c25d7224b7fa1bcfe1789ef6 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui16.ets @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui16 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set select to true" + @State color: Color|undefined = Color.Gray + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui17.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui17.ets new file mode 100644 index 0000000000000000000000000000000000000000..75e473ae44ff42d4f597a426ae260fa68b68786c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui17.ets @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui17 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = undefined; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set select to undefined" + @State color: Color|undefined = 0xed6f21 + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui18.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui18.ets new file mode 100644 index 0000000000000000000000000000000000000000..6cc7bb41c2c715fc4ed077e66b1d76b7eb336499 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui18.ets @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui18 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set selectColor to 0xed6f21" + @State color: Color|undefined = 0xed6f21 + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .unselectedColor(this.color) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor(this.color) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui19.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui19.ets new file mode 100644 index 0000000000000000000000000000000000000000..8a3f8cd62437a37c8f3cc697aadc2e30769d668f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui19.ets @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui19 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set selectColor to undefined" + @State color: Color|undefined = undefined + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor(this.color) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui20.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui20.ets new file mode 100644 index 0000000000000000000000000000000000000000..66ceb9c6d95312bce263e90d95d4e4ca48ea3996 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui20.ets @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui20 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set unselectColor to undefined" + @State color: Color|undefined = undefined + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui21.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui21.ets new file mode 100644 index 0000000000000000000000000000000000000000..ce89f805dc553a795cc95ac99bbc54ed959cc816 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui21.ets @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui21 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set unselectColor to 0xed6f21" + @State color: Color|undefined = 0xed6f21 + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui22.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui22.ets new file mode 100644 index 0000000000000000000000000000000000000000..054e0a27b95c24a6019cca8de5b362d9f6ae7e68 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui22.ets @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui22 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set mark" + @State color: Color|undefined = undefined + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .unselectedColor(this.color) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui23.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui23.ets new file mode 100644 index 0000000000000000000000000000000000000000..9935e307a67b36fa52771824cd4c80129e8ccc75 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui23.ets @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui23 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = true; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set mark to undefined" + @State color: Color|undefined = undefined + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .mark(undefined) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .mark(undefined) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .mark(undefined) + .unselectedColor(this.color) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui24.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui24.ets new file mode 100644 index 0000000000000000000000000000000000000000..6d4a34e4f7a9e0ecc13c68bf74b0fedb21a955bc --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui24.ets @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class MyCheckboxStyle implements ContentModifier { + selectedColor: Color = Color.White; + + constructor(selectedColor: Color) { + this.selectedColor = selectedColor; + } + + applyContent(): WrappedBuilder<[CheckBoxConfiguration]> { + return wrapBuilder(buildCheckbox); + } +} + +@Builder +function buildCheckbox(config: CheckBoxConfiguration) { + Column({ space: 10 }) { + Text(config.name + (config.selected ? "( 选中 )" : "( 非选中 )")).margin({ right: 70, top: 50 }) + Text(config.enabled ? "enabled true" : "enabled false").margin({ right: 110 }) + Shape() { + Path() + .width(100) + .height(100) + .commands('M100 0 L0 100 L50 200 L150 200 L200 100 Z') + .fillOpacity(0) + .strokeWidth(3) + .onClick(() => { + if (config.selected) { + config.triggerChange(false); + } else { + config.triggerChange(true); + } + }) + .opacity(config.enabled ? 1 : 0.1) + Path() + .width(10) + .height(10) + .commands('M50 0 L100 100 L0 100 Z') + .visibility(config.selected ? Visibility.Visible : Visibility.Hidden) + .fill(config.selected ? (config.contentModifier as MyCheckboxStyle).selectedColor : Color.Black) + .stroke((config.contentModifier as MyCheckboxStyle).selectedColor) + .margin({ left: 10, top: 10 }) + .opacity(config.enabled ? 1 : 0.1) + } + .width(300) + .height(200) + .viewPort({ + x: 0, + y: 0, + width: 310, + height: 310 + }) + .strokeLineJoin(LineJoinStyle.Miter) + .strokeMiterLimit(5) + .margin({ left: 50 }) + } +} + +@Entry +@Component +struct UiComponentButtonTextPickerArkui24 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set contentModifier to undefined" + @State color: Color|undefined = Color.Gray + @State shape : CheckBoxShape|undefined= CheckBoxShape.ROUNDED_SQUARE + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .contentModifier(undefined) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .contentModifier(undefined) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .contentModifier(undefined) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui25.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui25.ets new file mode 100644 index 0000000000000000000000000000000000000000..0b04d09d7e4ce47f58dc6fbc4b91987463d965f2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentButtonTextPickerArkui/UiComponentButtonTextPickerArkui25.ets @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiComponentButtonTextPickerArkui25 { + @State arrOne: Array = ['1', '2', '3']; + @State arrTwo: Array = ['1', '2', '3', '4']; + @State arrThree: Array = ['1', '2', '3', '4', '5', '6']; + @State selected: boolean|undefined = false; + @State infoOne: string = ''; + @State infoTwo: string = ''; + @State infoThree: string = ''; + @State Text: string="Checkbox set shape to ROUNDED_SQUARE" + @State color: Color|undefined = Color.Grey + @State shape : CheckBoxShape|undefined= undefined + + build() { + Column() { + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupOne' }) + .selectAll(this.selected) + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE) + .selectedColor('#007DFF') + .checkboxShape(this.shape) + .onChange((itemName: CheckboxGroupResult) => { + this.infoOne = "checkboxGroupOne" + JSON.stringify(itemName); + console.info("checkboxGroupOne" + JSON.stringify(itemName)); + }) + Text('checkboxGroupOne Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrOne, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupOne' }) + .selectedColor('#007DFF') + .shape(this.shape) + .unselectedColor(this.color) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + }.margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupTwo' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoTwo = "checkboxGroupTwo" + JSON.stringify(itemName); + console.info("checkboxGroupTwo" + JSON.stringify(itemName)); + }) + Text('checkboxGroupTwo Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrTwo, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupTwo' }) + .selectedColor('#007DFF') + .unselectedColor(this.color) + .shape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .select(this.selected) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + CheckboxGroup({ group: 'checkboxGroupThree' }) + .selectAll(this.selected) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .onChange((itemName: CheckboxGroupResult) => { + this.infoThree = "checkboxGroupThree" + JSON.stringify(itemName); + console.info("checkboxGroupThree" + JSON.stringify(itemName)); + }) + Text('checkboxGroupThree Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + } + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Column() { + ForEach(this.arrThree, (item: string) => { + Row() { + Checkbox({ name: 'checkbox' + item, group: 'checkboxGroupThree' }) + .selectedColor('#007DFF') + .shape(this.shape) + .mark({ + strokeColor : Color.Red, + strokeWidth: '20vp', + size: '20vp' + }) + .unselectedColor(this.color) + .shape(CheckBoxShape.ROUNDED_SQUARE) + .select(this.selected) + .onChange((value: boolean) => { + console.info('Checkbox' + item + 'change is' + value); + }) + .margin({ left: 20 }) + Text('Checkbox' + item) + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + }, (item: string) => item) + } + } + .margin({ bottom: 15 }) + + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { + Row() { + CheckboxGroup({ group: 'checkboxGroup' }) + .checkboxShape(this.shape) + .selectedColor('#007DFF') + .width(30) + .selectAll(this.selected) + .margin({ left: 10 }) + .onChange(() => { + this.selected = !this.selected + }) + Text('Select All') + .fontSize(14) + .lineHeight(20) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + } + .margin({ bottom: 15 }) + + Text(this.Text) + .fontSize(5) + .lineHeight(2) + .fontColor('#182431') + .fontWeight(500) + .margin({ left: 10 }) + } + .padding(10) + } +} \ No newline at end of file