From a5795d0df1e645c17db2b48aac7f7e57b11b6428 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 11:33:50 +0800 Subject: [PATCH 01/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../entry/src/ohosTest/ets/test/List.test.ets | 16 ++ .../resources/base/profile/test_pages.json | 267 +++++++++++++++++- 2 files changed, 282 insertions(+), 1 deletion(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets index 2646f9a82..bbac7ef9c 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -31,6 +31,14 @@ import UiComponentTextCommonTextstyle from './UiComponentTextCommonTextstyleTest import UiComponentTextTextareaInterface from './UiComponentTextTextareaInterfaceTest/UiComponentTextTextareaInterface.test' import UIAttributePositionSizeLayoutTest from './UIAttributePositionSizeLayoutTest/UIAttributePositionSizeLayoutTest.test' import UIAttributePositionInterfaceTest from './UIAttributePositionInterfaceTest/UIAttributePositionInterfaceTest.test' +import ComponentAttributeStringModifyingStyle001 from './ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test' +import ComponentAttributeStringModifyingStyleText001 from './ComponentAttributeStringModifyingStyleTextTest/ComponentAttributeStringModifyingStyleText001.test' +import ComponentAttributeStringModifyingText001 from './ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test' +import ComponentTextAttributeString001 from './ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test' +import ComponentTextAttributeStringConstructs001 from './ComponentTextAttributeStringConstructsTest/ComponentTextAttributeStringConstructsTest001.test' +import ComponentLayoutCommonPixelTest001 from './ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test' +import UiTextBrightenTest001 from './UiTextBrightenTest/UiTextBrightenTest001.test' +import UiTextShadowTest001 from './UiTextShadowTest/UiTextShadowTest001.test' export default function testsuite() { demoTest(); UIAttributeFontInterface001(); @@ -50,4 +58,12 @@ export default function testsuite() { UiComponentTextTextareaInterface(); UIAttributePositionSizeLayoutTest(); UIAttributePositionInterfaceTest(); + ComponentAttributeStringModifyingStyle001(); + ComponentAttributeStringModifyingStyleText001(); + ComponentAttributeStringModifyingText001(); + ComponentTextAttributeString001(); + ComponentTextAttributeStringConstructs001(); + ComponentLayoutCommonPixelTest001(); + UiTextBrightenTest001(); + UiTextShadowTest001(); } \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 42f75e417..938253cd6 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/function/ui_compare/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -251,6 +251,271 @@ "testability/pages/UIAttributePositionInterface/UIAttributePositionInterface003", "testability/pages/UIAttributePositionInterface/UIAttributePositionInterface004", "testability/pages/UIAttributePositionInterface/UIAttributePositionInterface005", - "testability/pages/UIAttributePositionInterface/UIAttributePositionInterface006" + "testability/pages/UIAttributePositionInterface/UIAttributePositionInterface006", + "testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle001", + "testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002", + "testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle003", + "testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle004", + "testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005", + "testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle006", + "testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText001", + "testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002", + "testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText003", + "testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004", + "testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText001", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText002", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText004", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText006", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText008", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009", + "testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString001", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString002", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString003", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString004", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString005", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString006", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString007", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString008", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString009", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString010", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString011", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString012", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString013", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString014", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString016", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString017", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString018", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString019", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString020", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString021", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString022", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString023", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString024", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString025", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString026", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString027", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString028", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString029", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString030", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString031", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString032", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString033", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString034", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString035", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString036", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString037", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString038", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString039", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString040", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString041", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString042", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString043", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString044", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString046", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString047", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString048", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString049", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString050", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString051", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString052", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString053", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString054", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString055", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString056", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString057", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString058", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString059", + "testability/pages/ComponentTextAttributeString/ComponentTextAttributeString060", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs001", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs002", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs003", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs004", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs005", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs006", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs007", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs008", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs009", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs010", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs011", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs012", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs013", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs014", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs015", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs016", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs017", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs018", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs019", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs020", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs021", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs022", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs023", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs024", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs025", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs026", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs027", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs028", + "testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs029", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel001", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel002", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel003", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel004", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel005", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel006", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel007", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel008", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel009", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel010", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel011", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel012", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel013", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel014", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel015", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel016", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel017", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel018", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel019", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel020", + "testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel021", + "testability/pages/UiTextBrighten/UiTextBrighten001", + "testability/pages/UiTextBrighten/UiTextBrighten002", + "testability/pages/UiTextBrighten/UiTextBrighten003", + "testability/pages/UiTextBrighten/UiTextBrighten004", + "testability/pages/UiTextBrighten/UiTextBrighten005", + "testability/pages/UiTextBrighten/UiTextBrighten006", + "testability/pages/UiTextBrighten/UiTextBrighten007", + "testability/pages/UiTextBrighten/UiTextBrighten008", + "testability/pages/UiTextBrighten/UiTextBrighten009", + "testability/pages/UiTextBrighten/UiTextBrighten010", + "testability/pages/UiTextBrighten/UiTextBrighten011", + "testability/pages/UiTextBrighten/UiTextBrighten012", + "testability/pages/UiTextBrighten/UiTextBrighten013", + "testability/pages/UiTextBrighten/UiTextBrighten014", + "testability/pages/UiTextBrighten/UiTextBrighten015", + "testability/pages/UiTextBrighten/UiTextBrighten016", + "testability/pages/UiTextBrighten/UiTextBrighten017", + "testability/pages/UiTextBrighten/UiTextBrighten018", + "testability/pages/UiTextBrighten/UiTextBrighten019", + "testability/pages/UiTextBrighten/UiTextBrighten020", + "testability/pages/UiTextBrighten/UiTextBrighten021", + "testability/pages/UiTextBrighten/UiTextBrighten022", + "testability/pages/UiTextBrighten/UiTextBrighten023", + "testability/pages/UiTextBrighten/UiTextBrighten024", + "testability/pages/UiTextBrighten/UiTextBrighten025", + "testability/pages/UiTextBrighten/UiTextBrighten026", + "testability/pages/UiTextBrighten/UiTextBrighten027", + "testability/pages/UiTextBrighten/UiTextBrighten028", + "testability/pages/UiTextBrighten/UiTextBrighten029", + "testability/pages/UiTextBrighten/UiTextBrighten030", + "testability/pages/UiTextBrighten/UiTextBrighten031", + "testability/pages/UiTextBrighten/UiTextBrighten032", + "testability/pages/UiTextBrighten/UiTextBrighten033", + "testability/pages/UiTextBrighten/UiTextBrighten034", + "testability/pages/UiTextBrighten/UiTextBrighten035", + "testability/pages/UiTextBrighten/UiTextBrighten036", + "testability/pages/UiTextBrighten/UiTextBrighten037", + "testability/pages/UiTextBrighten/UiTextBrighten038", + "testability/pages/UiTextBrighten/UiTextBrighten039", + "testability/pages/UiTextBrighten/UiTextBrighten040", + "testability/pages/UiTextBrighten/UiTextBrighten041", + "testability/pages/UiTextBrighten/UiTextBrighten042", + "testability/pages/UiTextBrighten/UiTextBrighten043", + "testability/pages/UiTextBrighten/UiTextBrighten044", + "testability/pages/UiTextBrighten/UiTextBrighten045", + "testability/pages/UiTextBrighten/UiTextBrighten046", + "testability/pages/UiTextBrighten/UiTextBrighten047", + "testability/pages/UiTextBrighten/UiTextBrighten048", + "testability/pages/UiTextBrighten/UiTextBrighten049", + "testability/pages/UiTextBrighten/UiTextBrighten050", + "testability/pages/UiTextBrighten/UiTextBrighten051", + "testability/pages/UiTextBrighten/UiTextBrighten052", + "testability/pages/UiTextBrighten/UiTextBrighten053", + "testability/pages/UiTextBrighten/UiTextBrighten054", + "testability/pages/UiTextBrighten/UiTextBrighten055", + "testability/pages/UiTextBrighten/UiTextBrighten056", + "testability/pages/UiTextBrighten/UiTextBrighten057", + "testability/pages/UiTextBrighten/UiTextBrighten058", + "testability/pages/UiTextBrighten/UiTextBrighten059", + "testability/pages/UiTextBrighten/UiTextBrighten060", + "testability/pages/UiTextBrighten/UiTextBrighten061", + "testability/pages/UiTextBrighten/UiTextBrighten062", + "testability/pages/UiTextBrighten/UiTextBrighten063", + "testability/pages/UiTextBrighten/UiTextBrighten064", + "testability/pages/UiTextBrighten/UiTextBrighten065", + "testability/pages/UiTextBrighten/UiTextBrighten066", + "testability/pages/UiTextBrighten/UiTextBrighten067", + "testability/pages/UiTextBrighten/UiTextBrighten068", + "testability/pages/UiTextBrighten/UiTextBrighten069", + "testability/pages/UiTextBrighten/UiTextBrighten070", + "testability/pages/UiTextBrighten/UiTextBrighten071", + "testability/pages/UiTextBrighten/UiTextBrighten072", + "testability/pages/UiTextBrighten/UiTextBrighten073", + "testability/pages/UiTextBrighten/UiTextBrighten074", + "testability/pages/UiTextBrighten/UiTextBrighten075", + "testability/pages/UiTextBrighten/UiTextBrighten076", + "testability/pages/UiTextBrighten/UiTextBrighten077", + "testability/pages/UiTextBrighten/UiTextBrighten078", + "testability/pages/UiTextBrighten/UiTextBrighten079", + "testability/pages/UiTextBrighten/UiTextBrighten080", + "testability/pages/UiTextBrighten/UiTextBrighten081", + "testability/pages/UiTextBrighten/UiTextBrighten082", + "testability/pages/UiTextBrighten/UiTextBrighten083", + "testability/pages/UiTextBrighten/UiTextBrighten084", + "testability/pages/UiTextBrighten/UiTextBrighten085", + "testability/pages/UiTextBrighten/UiTextBrighten086", + "testability/pages/UiTextBrighten/UiTextBrighten087", + "testability/pages/UiTextBrighten/UiTextBrighten088", + "testability/pages/UiTextBrighten/UiTextBrighten089", + "testability/pages/UiTextBrighten/UiTextBrighten090", + "testability/pages/UiTextBrighten/UiTextBrighten091", + "testability/pages/UiTextBrighten/UiTextBrighten092", + "testability/pages/UiTextBrighten/UiTextBrighten093", + "testability/pages/UiTextBrighten/UiTextBrighten094", + "testability/pages/UiTextBrighten/UiTextBrighten095", + "testability/pages/UiTextBrighten/UiTextBrighten096", + "testability/pages/UiTextBrighten/UiTextBrighten097", + "testability/pages/UiTextBrighten/UiTextBrighten098", + "testability/pages/UiTextBrighten/UiTextBrighten099", + "testability/pages/UiTextBrighten/UiTextBrighten100", + "testability/pages/UiTextBrighten/UiTextBrighten101", + "testability/pages/UiTextBrighten/UiTextBrighten102", + "testability/pages/UiTextBrighten/UiTextBrighten103", + "testability/pages/UiTextBrighten/UiTextBrighten104", + "testability/pages/UiTextBrighten/UiTextBrighten105", + "testability/pages/UiTextBrighten/UiTextBrighten106", + "testability/pages/UiTextBrighten/UiTextBrighten107", + "testability/pages/UiTextBrighten/UiTextBrighten108", + "testability/pages/UiTextBrighten/UiTextBrighten109", + "testability/pages/UiTextBrighten/UiTextBrighten110", + "testability/pages/UiTextBrighten/UiTextBrighten111", + "testability/pages/UiTextBrighten/UiTextBrighten112", + "testability/pages/UiTextShadow/UiTextShadow001", + "testability/pages/UiTextShadow/UiTextShadow002", + "testability/pages/UiTextShadow/UiTextShadow003", + "testability/pages/UiTextShadow/UiTextShadow004", + "testability/pages/UiTextShadow/UiTextShadow005", + "testability/pages/UiTextShadow/UiTextShadow006", + "testability/pages/UiTextShadow/UiTextShadow007", + "testability/pages/UiTextShadow/UiTextShadow008", + "testability/pages/UiTextShadow/UiTextShadow009", + "testability/pages/UiTextShadow/UiTextShadow010", + "testability/pages/UiTextShadow/UiTextShadow011", + "testability/pages/UiTextShadow/UiTextShadow012", + "testability/pages/UiTextShadow/UiTextShadow013", + "testability/pages/UiTextShadow/UiTextShadow014", + "testability/pages/UiTextShadow/UiTextShadow015", + "testability/pages/UiTextShadow/UiTextShadow016", + "testability/pages/UiTextShadow/UiTextShadow017", + "testability/pages/UiTextShadow/UiTextShadow018", + "testability/pages/UiTextShadow/UiTextShadow019", + "testability/pages/UiTextShadow/UiTextShadow020", + "testability/pages/UiTextShadow/UiTextShadow021", + "testability/pages/UiTextShadow/UiTextShadow022" ] } -- Gitee From bb6cafd84f4ed941880ca27ce3941721ecc686e3 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 11:40:54 +0800 Subject: [PATCH 02/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...tAttributeStringModifyingStyle001.test.ets | 139 +++++++ ...ributeStringModifyingStyleText001.test.ets | 121 ++++++ ...ntAttributeStringModifyingText001.test.ets | 203 ++++++++++ ...ComponentLayoutCommonPixelTest001.test.ets | 381 ++++++++++++++++++ 4 files changed, 844 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTextTest/ComponentAttributeStringModifyingStyleText001.test.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets new file mode 100644 index 000000000..a0dec8b91 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function ComponentAttributeStringModifyingStyle001() { + + describe('ComponentAttributeStringModifyingStyle001', () => { + 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_ATTRIBUTE_STRING_MODIFYING_STYLE_0010 + * @tc.name STRING_MODIFYING_STYLE + * @tc.desc Normal replacement of some string styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0010 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle001") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0020 + * @tc.name STRING_MODIFYING_STYLE + * @tc.desc Replace the specified range style to obtain the string style + * @tc.level Level 3 + * @tc.type + * @tc.size + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0020 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0080 + * @tc.name STRING_MODIFYING_STYLE + * @tc.desc Normal specification of partial string setting new style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0080 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle003") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0290 + * @tc.name STRING_MODIFYING_STYLE + * @tc.desc Clear all styles of the string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0290 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle004") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0290 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0300 + * @tc.name STRING_MODIFYING_STYLE + * @tc.desc Clear all styles of the string and obtain the string style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0300 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0300 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0310 + * @tc.name STRING_MODIFYING_STYLE + * @tc.desc Add multiple new styles and delete styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0310 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle006") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0310 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTextTest/ComponentAttributeStringModifyingStyleText001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTextTest/ComponentAttributeStringModifyingStyleText001.test.ets new file mode 100644 index 000000000..63b7a4506 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTextTest/ComponentAttributeStringModifyingStyleText001.test.ets @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function ComponentAttributeStringModifyingStyleText001() { + + describe('ComponentAttributeStringModifyingStyleText001', () => { + 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_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0010 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Replace the specified range with a new attribute string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0010 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText001") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0020 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Replace the specified range with a new attribute string, obtain the length, string information, and string style of the new string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0020 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0080 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Insert attribute string at specified location + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0080 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText003") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0120 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Add attribute string at the end + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0120 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0130 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Add attribute string at the end, obtain string length, obtain string information, and obtain string style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0130 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_TEXT_0130 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets new file mode 100644 index 000000000..499cc0adb --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function ComponentAttributeStringModifyingText001() { + + describe('ComponentAttributeStringModifyingText001', () => { + 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_ATTRIBUTE_STRING_MODIFYING_TEXT_0010 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Normal replacement of specified text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0010 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText001") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0020 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Replace text with a length less than length + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0020 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText002") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0070 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Replace specified text to obtain string length and content + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0070 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0080 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Insert string normally + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0080 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText004") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0090 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Test for inserting special symbols such as line breaks and spaces + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0090 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0100 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Insert at the color stitching of characters + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0100 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText006") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0130 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Insert a string to obtain its length and content + * @tc.level Level 3 + * @tc.type + * @tc.size + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0130 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0140 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Normal deletion of specified range attribute strings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0140 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText008") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0200 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Delete the specified range attribute string to obtain the new string length and content + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0200 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0200 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0210 + * @tc.name STRING_MODIFYING_STYLE_TEXT + * @tc.desc Get the color of the TextCtyle property + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0210 start.`); + Settings.createWindow("testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0210 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets new file mode 100644 index 000000000..5e1488870 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets @@ -0,0 +1,381 @@ + /* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function ComponentLayoutCommonPixelTest001() { + + describe('ComponentLayoutCommonPixelTest001', () => { + 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_LAYOUT_COMMON_PIXEL_0710 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Swiper component displays 7 components on one page + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0710 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel001") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0710 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0720 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Swiper component displays 8 components on one page + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0720 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel002") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0720 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0740 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc The Swiper component does not activate the navigation point indicator + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0740 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel003") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0740 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0750 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Do not set disabling Swipe for the Swiper component, check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0750 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel004") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0750 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0760 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Swiper component enables switch arrow + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0760 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel005") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0760 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0790 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Delete the SwiperItem sub component with index=0 and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0790 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel006") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0790 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0800 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Delete the SwiperItem sub component with index=2 and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0800 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel007") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0800 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0810 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Delete the SwiperItem sub component with index=6 and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0810 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel008") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0810 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0820 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Add a SwinerItem subcomponent with floating-point width and height values at index=0 position, and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0820 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel009") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0820 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0830 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Add a SwinerItem subcomponent with floating-point width and height values at index=2 position, and check if there are pixel gaps in the layout + * @tc.level Level 3 + * @tc.type + * @tc.size + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0830', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0830 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel010") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0830 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0840 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Add a SwinerItem subcomponent with floating-point width and height values at index=6 position, and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0840', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0840 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel011") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0840 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0870 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Set the disable Swipe property to 'ture' in the Swiper component to check if there are any pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0870', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0870 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel012") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0870 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0890 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Set the width and height of the Swiper component to floating-point numbers, and check if the layout width and height are rounded to the nearest whole + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0890 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel013") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0890 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1020 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Delete the FlowItem sub component with index=0 and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1020 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel014") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1030 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Delete the FlowItem sub component with index=2 and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1030 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel015") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1040 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Delete the FlowItem sub component with index=6 and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1040 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel016") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1050 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Add a FlowItem subcomponent with floating-point width and height values at index=0 position, and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1050 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel017") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1060 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Add a FlowItem subcomponent with floating-point width and height values at index=2 position, and check if there are pixel gaps in the layout + * @tc.level Level 3 + * @tc.type + * @tc.size + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1060 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel018") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1070 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Add a FlowItem subcomponent with floating-point width and height values at index=6 position, and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1070 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel019") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1140 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc Set the width and height of the WaterFlow component to floating-point numbers, and check if the layout width and height are rounded to the nearest whole + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1140 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel020") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1150 + * @tc.name LAYOUT_COMMON_PIXEL + * @tc.desc FlowItem: Set the width and height to floating point numbers and check if there are pixel gaps in the layout + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1150 start.`); + Settings.createWindow("testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel021") + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1150 finish.`); + done() + }) + }) +} -- Gitee From 43b86cc8ec435a4ca8fbfb8e2501cd2ad2efef29 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 11:44:16 +0800 Subject: [PATCH 03/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...tAttributeStringConstructsTest001.test.ets | 425 +++++++ ...mponentTextAttributeStringTest001.test.ets | 1003 +++++++++++++++++ 2 files changed, 1428 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringConstructsTest/ComponentTextAttributeStringConstructsTest001.test.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringConstructsTest/ComponentTextAttributeStringConstructsTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringConstructsTest/ComponentTextAttributeStringConstructsTest001.test.ets new file mode 100644 index 000000000..4c02ee672 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringConstructsTest/ComponentTextAttributeStringConstructsTest001.test.ets @@ -0,0 +1,425 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function ComponentTextAttributeStringConstructs001() { + + describe('ComponentTextAttributeStringConstructs001', () => { + 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_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0010 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create StyledString property string normally + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0010 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs001") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0020 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create MutableStyledString property string normally + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0020 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs002") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0030 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create attribute strings for multiple colors + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0030 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs003") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0040 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create a mixed character attribute string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0040 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs004") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0050 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create attribute strings for multiple colors, with crossed color settings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0050 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs005") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0060 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create a property string with a length less than the string length + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0060 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs006") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0070 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create a property string with a length greater than the string length + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0070 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs007") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0080 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create attribute string without setting attribute style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0080 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs008") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0090 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create a property string without setting start and length + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0090 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs009") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0100 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create a property string with a start value greater than the string length + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0100 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs010") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0110 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create a property string with start set to a negative number + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0110 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs011") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0120 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Create a property string with a negative length + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0120 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs012") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0370 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Set the fontColor property for the Text component + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0370 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs013") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0370 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0380 + * @tc.name STRING_CONSTRUCTS + * @tc.desc SpanStyle sets string properties normally + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0380 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs014") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0380 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0440 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Add Span sub component to Text component + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0440 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs020") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0440 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0450 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Set attribute strings with too much text and too many different styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0450 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs021") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0450 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0470 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Enable text recognition for attribute strings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0470 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs022") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0470 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0480 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Add text shadow to attribute string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0480 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs023") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0480 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0490 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Attribute string setting omission position + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0490 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs024") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0490 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0500 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Set truncation method for attribute string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0500 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs025") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0500 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0510 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Attribute string setting privacy mask + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0510 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs026") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0530 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Alignment method for attribute string settings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0530 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs027") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0530 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0540 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Attribute string setting font style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0540 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs028") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0540 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0550 + * @tc.name STRING_CONSTRUCTS + * @tc.desc Attribute string setting modifier line + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0550 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs029") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_CONSTRUCTS_0550 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets new file mode 100644 index 000000000..0866954ef --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets @@ -0,0 +1,1003 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function ComponentTextAttributeStringTest001() { + + describe('ComponentTextAttributeStringTest001', () => { + 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_TEXT_ATTRIBUTE_STRING_0010 + * @tc.name STRING + * @tc.desc Set font size for attribute string, fontSize: (10, LengthUnit. PX) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0010 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString001") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0020 + * @tc.name STRING + * @tc.desc Set the font size for the attribute string, fontSize: (80, LengthUnit.PERCENT ) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0020 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString002") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0030 + * @tc.name STRING + * @tc.desc Set font size for attribute string, fontSize: (30, LengthUnit. VP) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0030 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString003") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0040 + * @tc.name STRING + * @tc.desc Set font size for attribute string, fontSize: (30, LengthUnit. FP) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0040 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString004") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0050 + * @tc.name STRING + * @tc.desc Set font size for attribute string, fontSize: (50, LengthUnit. LPX) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0050 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString005") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0060 + * @tc.name STRING + * @tc.desc Property string setting font width, fontWeight (0) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0060 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString006") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0070 + * @tc.name STRING + * @tc.desc Set font width for attribute string, fontWeight (200) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0070 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString007") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0080 + * @tc.name STRING + * @tc.desc Attribute string setting font width, fontWeight (1000) + * @tc.level Level 3 + * @tc.type + * @tc.size + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0080 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString008") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0090 + * @tc.name STRING + * @tc.desc The attribute string sets the font width, fontWeight Bolder + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0090 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString009") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0100 + * @tc.name STRING + * @tc.desc Attribute string setting font width, fontWeight (abcdefg) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0100 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString010") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0110 + * @tc.name STRING + * @tc.desc Attribute string setting font width, fontWeight (bolder) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0110 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString011") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0120 + * @tc.name STRING + * @tc.desc Property string sets font width, fontWeight (undefined) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0120 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString012") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0130 + * @tc.name STRING + * @tc.desc Set the font size for the attribute string, fontStyle (fontStyle: Normal) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0130 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString013") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0140 + * @tc.name STRING + * @tc.desc Set the font size for the attribute string, fontStyle (fontStyle: Italic) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0140 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString014") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0150 + * @tc.name STRING + * @tc.desc Set the font size for the attribute string, fontFamily ('custom ') + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0150 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0160 + * @tc.name STRING + * @tc.desc Set font size for attribute string, fontFamily (HarmonyOS Sans) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0160 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString016") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0170 + * @tc.name STRING + * @tc.desc Set font for attribute string without passing parameters + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0170 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString017") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0170 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0180 + * @tc.name STRING + * @tc.desc Set font modifier lines and underline for attribute strings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0180 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString018") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0180 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0190 + * @tc.name STRING + * @tc.desc Set font modifier lines and penetration lines for attribute strings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0190 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString019") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0200 + * @tc.name STRING + * @tc.desc Set font modifier lines and underline for attribute strings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0200 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString020") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0200 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0210 + * @tc.name STRING + * @tc.desc Attribute string setting font modifier line, None + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0210 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString021") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0210 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0220 + * @tc.name STRING + * @tc.desc Attribute string setting font modifier line, undefined + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0220 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString022") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0220 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0230 + * @tc.name STRING + * @tc.desc Set font modifier lines for attribute strings, without setting colors + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0230 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString023") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0230 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0240 + * @tc.name STRING + * @tc.desc Set font modifier lines for attribute strings and set colors to outliers + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0240 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString024") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0240 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0250 + * @tc.name STRING + * @tc.desc Set font modifier lines for attribute strings and set colors to resource references + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0250 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString025") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0250 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0260 + * @tc.name STRING + * @tc.desc Set the text offset of the attribute string to a negative number + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0260 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString026") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0260 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0270 + * @tc.name STRING + * @tc.desc Set the text offset of the attribute string to 30px + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0270 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString027") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0270 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0280 + * @tc.name STRING + * @tc.desc Set the text offset of the attribute string to 20vp + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0280 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString028") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0280 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0290 + * @tc.name STRING + * @tc.desc Set the text offset of the attribute string to 10fp + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0290 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString029") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0290 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0300 + * @tc.name STRING + * @tc.desc Set the text offset of the attribute string to 50% + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0300 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString030") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0300 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0310 + * @tc.name STRING + * @tc.desc Set the text offset of the attribute string to 50lpx + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0310 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString031") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0310 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0320 + * @tc.name STRING + * @tc.desc Set the text offset for the attribute string, with the unit set to 'undefined' + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0320 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString032") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0320 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0330 + * @tc.name STRING + * @tc.desc Set the text offset of the attribute string to 'undefined' + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0330 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString033") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0330 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0340 + * @tc.name STRING + * @tc.desc Set the text offset for the attribute string and set the parameter to 'undefined' + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0340 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString034") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0340 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0350 + * @tc.name STRING + * @tc.desc Set the character spacing for the attribute string and set the parameter to a negative number + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0350 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString035") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0350 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0360 + * @tc.name STRING + * @tc.desc Set the character spacing of the attribute string to 10px + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0360 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString036") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0360 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0370 + * @tc.name STRING + * @tc.desc Set the character spacing of the attribute string to 20vp + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0370 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString037") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0370 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0380 + * @tc.name STRING + * @tc.desc Set the character spacing of the attribute string to 10fp + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0380 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString038") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0380 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0390 + * @tc.name STRING + * @tc.desc Set the character spacing of the attribute string to 50% + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0390 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString039") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0390 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0400 + * @tc.name STRING + * @tc.desc Set the character spacing of the attribute string to 5lpx + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0400 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString040") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0400 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0410 + * @tc.name STRING + * @tc.desc Set the character spacing for the attribute string, with the unit set to 'undefined' + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0410 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString041") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0410 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0420 + * @tc.name STRING + * @tc.desc Set the character spacing of the attribute string to 'undefined' + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0420 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString042") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0420 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0430 + * @tc.name STRING + * @tc.desc Set the character spacing for the attribute string and set the parameter to 'undefined' + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0430 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString043") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0430 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0440 + * @tc.name STRING + * @tc.desc Attribute string setting text with multiple shadows + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0440 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString044") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0440 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0450 + * @tc.name STRING + * @tc.desc Set multiple styles for attribute strings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0450 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0450 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0460 + * @tc.name STRING + * @tc.desc Replace attribute string content + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0460 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString046") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0460 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0470 + * @tc.name STRING + * @tc.desc Insert string content + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0470 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString047") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0470 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0480 + * @tc.name STRING + * @tc.desc Remove string content + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0480 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString048") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0480 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0490 + * @tc.name STRING + * @tc.desc Replace string style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0490 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString049") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0490 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0500 + * @tc.name STRING + * @tc.desc Set a new style for strings + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0500 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString050") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0500 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0510 + * @tc.name STRING + * @tc.desc Move out of the specified range and specify the style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0510 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString051") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0520 + * @tc.name STRING + * @tc.desc Remove all styles from the specified range + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0520 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString052") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0520 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0530 + * @tc.name STRING + * @tc.desc Clear all styles of the string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0530 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString053") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0530 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0540 + * @tc.name STRING + * @tc.desc Replace the new attribute string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0540 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString054") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0540 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0550 + * @tc.name STRING + * @tc.desc Insert a new attribute string + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0550 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString055") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0550 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0560 + * @tc.name STRING + * @tc.desc Add attribute string at the end + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0560 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString056") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0560 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0570 + * @tc.name STRING + * @tc.desc Set font style for text component + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0570 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString057") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0570 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0580 + * @tc.name STRING + * @tc.desc Select and drag the attribute string of the text component + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0580 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString058") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0580 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0590 + * @tc.name STRING + * @tc.desc Text component setting padding and margin + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0590 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString059") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0590 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0600 + * @tc.name STRING + * @tc.desc Set text truncation method for text component + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0600 start.`); + Settings.createWindow("testability/pages/ComponentTextAttributeString/ComponentTextAttributeString060") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0600 finish.`); + done() + }) + }) +} -- Gitee From 52e302f76ac6261ca6154c03585ce823d8b5651d Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 11:44:58 +0800 Subject: [PATCH 04/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextBrightenTest001.test.ets | 1833 +++++++++++++++++ 1 file changed, 1833 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextBrightenTest/UiTextBrightenTest001.test.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextBrightenTest/UiTextBrightenTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextBrightenTest/UiTextBrightenTest001.test.ets new file mode 100644 index 000000000..fe536da56 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextBrightenTest/UiTextBrightenTest001.test.ets @@ -0,0 +1,1833 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function UiTextBrightenTest001() { + + describe('UiTextBrightenTest001', () => { + 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_TEXTBRIGHTEN_0010 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, set single-layer shadow + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0010 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten001") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0020 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, set multi-layer shadows + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0020 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten002") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0030 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, textShadow set null value + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0030 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten003") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0040 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, fontSize 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0040 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten004") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0050 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, fontSize of 30 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0050 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten005") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0060 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shading, dynamically set font size + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0060 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten006") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0070 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadows, fontWeight as Lighter + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0070 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten007") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0080 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadows, fontWeight set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0080 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten008") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0090 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, fontWeight as Bloder + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0090 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten009") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0100 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, dynamically set font thickness + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0100 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten010") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0110 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, fontStyle set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0110 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten021") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0120 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, fontStyle is Italic + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0120 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten011") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0130 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shading, dynamically changing font style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0130 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten012") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0140 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadows, dynamically changing text offset + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0140 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten013") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0150 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, set padding to 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0150 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten014") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0160 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, set padding to 20 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0160 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten015") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0170 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadows, single line text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0170 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten016") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0170 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0180 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadows, multi line text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0180 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten017") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0180 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0190 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadows, dynamically changing styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0190 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten018") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0200 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, dynamically changing shadow styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0200 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten019") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0200 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0210 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, dynamically changing component position offset + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0210 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten020") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0210 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0220 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, multi-layer shadow, component setting path animation motionPath + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0220 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten022") + await Utils.sleep(4000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0220 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0230 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, set text highlighting blendMode to Normal type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0230 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten023") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0230 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0240 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, set the text highlighting blendMode to SOURCE-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0240 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten024") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0240 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0250 + * @tc.name TEXT-BRIGHTEN + * @tc.desc Text component, set the text highlighting blendMode to DESTINATION-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0250 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten025") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0250 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0260 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set single-layer shadow + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0260 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten026") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0260 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0270 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multi-layer shadows + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0270 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten027") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0270 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0280 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, textShadow set null value + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0280 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten028") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0280 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0290 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, with a fontSize of 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0290 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten029") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0290 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0300 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, with a fontSize of 30 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0300 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten030") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0300 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0310 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, dynamically set font size + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0310 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten031") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0310 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0320 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, fontWeight for Lighter + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0320 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten032") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0320 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0330 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, fontWeight set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0330 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten033") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0330 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0340 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, fontWeight as Bloder + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0340 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten034") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0340 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0350 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, dynamically set font thickness + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0350 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten035") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0350 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0360 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, fontStyle set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0360 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten036") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0360 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0370 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadow, fontStyle is Italic + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0370 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten037") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0370 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0380 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shading, dynamically changing font style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0380 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten038") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0380 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0390 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multi-layer shadows, start text clock + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0390 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten039") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0390 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0400 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multi-layer shadows, stop text clock + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0400 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten040") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0400 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0410 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multiple layers of shadows, dynamically change shadow styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0410 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten041") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0410 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0420 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multiple layers of shadows, text input format: yyyy year M month d day EEEE + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0420 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten042") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0420 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0430 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multi-layer shadows, text input format: MM/dd/yyyy + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0430 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten043") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0430 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0440 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multi-layer shadows, text input format: yyyy-M-d + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0440 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten044") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0440 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0450 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multiple layers of shadows, text input format: yyyy M.d + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0450 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten045") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0450 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0460 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multi-layer shadows, text input format: HH: mm: ss + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0460 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten046") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0460 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0470 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set multi-layer shadows, text input format: aa hh: mm: ss + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0470 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten047") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0470 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0480 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadow, start text clock + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0480 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten048") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0480 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0490 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, set padding to 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0490 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten049") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0490 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0500 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, set padding to 20 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0500 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten050") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0500 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0510 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, dynamically changing component position offset + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0510 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten051") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0520 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, multi-layer shadows, component setting path animation motionPath + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0520 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten052") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0520 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0530 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set text highlighting blendMode to Normal type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0530 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten053") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0530 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0540 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set text highlighting blendMode to SOURCE-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0540 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten054") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0540 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0550 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextClock component, set text highlighting blendMode to DESTINATION-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0550 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten055") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0550 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0560 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, set single-layer shadow + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0560 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten056") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0560 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0570 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, set multi-layer shadows + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0570 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten057") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0570 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0580 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, textShadow set null value + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0580 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten058") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0580 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0590 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, super multi-layer shadow: 50 layers, start timing + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0590 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten059") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0590 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0600 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, with a fontSize of 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0600 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten060") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0600 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0610 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, with a fontSize of 30 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0610 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten061") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0610 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0620 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, dynamically set font size + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0620 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten062") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0620 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0630 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, fontWeight as Lighter + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0630 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten063") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0630 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0640 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, fontWeight set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0640 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten064") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0640 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0650 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, fontWeight as Bloder + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0650 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten065") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0650 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0660 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, dynamically set font thickness + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0660 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten066") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0660 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0670 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, fontStyle set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0670 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten067") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0670 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0680 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadow, fontStyle is Italic + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0680 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten068") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0680 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0690 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, dynamically changing font style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0690 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten069") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0690 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0700 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, start timing + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0700 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten070") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0700 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0710 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, stop timing + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0710 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten071") + await Utils.sleep(6000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0710 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0720 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, reset timer + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0720', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0720 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten072") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0720 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0730 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, dynamically changing shadow styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0730', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0730 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten073") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0730 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0740 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, input format HH: mm: ss SS + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0740', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0740 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten074") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0740 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0750 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, set padding to 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0750', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0750 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten075") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0750 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0760 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, set padding to 20 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0760 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten076") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0760 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0770 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, dynamically changing component position offset + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0770', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0770 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten077") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0770 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0780 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, multi-layer shadows, component setting path animation motionPath + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0780', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0780 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten078") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0780 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0790 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, set text highlighting blendMode to Normal type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0790 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten079") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0790 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0800 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, set text highlighting blendMode to SOURCE-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0800', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0800 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten080") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0800 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0810 + * @tc.name TEXT-BRIGHTEN + * @tc.desc TextTimer component, set the text highlighting blendMode to DESTINATION-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0810 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten081") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0810 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0820 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, set single-layer shadows + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0820', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0820 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten082") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0820 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0830 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, set multi-layer shadows + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0830', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0830 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten083") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0830 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0840 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, textShadow set null value + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0840', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0840 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten084") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0840 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0850 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, super multi-layer shadows: 50 layers, dynamically changing styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0850', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0850 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten085") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0850 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0860 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, with a fontSize of 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0860', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0860 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten086") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0860 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0870 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, fontSize of 30 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0870', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0870 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten087") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0870 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0880 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, dynamically set font size + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0880', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0880 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten088") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0880 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0890 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, fontWeight for Lighter + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0890', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0890 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten089") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0890 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0900 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, fontWeight set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0900', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0900 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten090") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0900 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0910 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, fontWeight as Bloder + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0910', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0910 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten091") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0910 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0920 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, dynamically set font thickness + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0920', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0920 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten092") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0920 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0930 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, fontStyle set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_093', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0930 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten093") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0930 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0940 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, fontStyle is Italic + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0940 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten094") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0940 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0950 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shading, dynamically changing font style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0950 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten095") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0950 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0960 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, referencing custom fonts + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0960 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten096") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0960 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0970 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, dynamic language switching + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0970', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0970 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten097") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0970 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0980 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, adding spans + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0980 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten098") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0980 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_0990 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, left aligned text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_0990', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0990 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten099") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_0990 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1000 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, text centered alignment + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1000', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1000 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten100") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1000 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1010 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, right aligned text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1010 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten101") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1020 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, dynamically changing alignment method + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1020 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten102") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1030 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, text wrapping + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1030 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten103") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1040 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, dynamically changing shadow styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1040 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten104") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1050 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, scrolling text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1050 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten105") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1060 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, set padding to 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1060 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten106") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1070 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, set padding to 20 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1070 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten107") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1080 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, dynamically changing component position offset + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1080 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten108") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1090 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, multi-layer shadows, component setting path animation motionPath + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1090 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten109") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1100 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, set text highlighting blendMode to Normal type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1100 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten110") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1110 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, set text highlighting blendMode to SOURCE-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1110 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten111") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTBRIGHTEN_1120 + * @tc.name TEXT-BRIGHTEN + * @tc.desc RichEditor component, set text highlighting blendMode to DESTINATION-IN type + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTBRIGHTEN_1120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1120 start.`); + Settings.createWindow("testability/pages/UiTextBrighten/UiTextBrighten112") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTBRIGHTEN_1120 finish.`); + done() + }) + }) +} -- Gitee From 8538a5c417d38c2b3e3a9a2421689822295a804f Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 11:45:47 +0800 Subject: [PATCH 05/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextShadowTest001.test.ets | 395 ++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets new file mode 100644 index 000000000..0f4d7cd6e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets @@ -0,0 +1,395 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' + +export default function UiTextShadowTest001() { + + describe('UiTextShadowTest001', () => { + 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_TEXTSHADOW_0010 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, set single-layer shadow + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0010 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow001") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0020 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, set multi-layer shadows + * @tc.level Level 3 + * @tc.type + * @tc.size + */ + it('SUB_ACE_UI_TEXTSHADOW_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0020 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow002") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0030 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, textShadow set null value + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0030 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow003") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0040 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, fontSize 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0040 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow004") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0050 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, fontSize of 30 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0050 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow005") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0060 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shading, dynamically set font size + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0060 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow006") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0070 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadows, fontWeight as Lighter + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0070 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow007") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0080 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadows, fontWeight set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0080 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow008") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0090 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, fontWeight as Bloder + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0090 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow009") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0100 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, dynamically set font thickness + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0100 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow010") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0110 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, fontStyle set to Normal + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0110 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow011") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0120 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, fontStyle is Italic + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0120 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow012") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0130 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shading, dynamically changing font style + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0130 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow013") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0140 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadows, dynamically changing text offset + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0140 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow014") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0150 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, set padding to 10 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0150 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow015") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0160 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, set padding to 20 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0160 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow016") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0170 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadows, single line text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0170 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow017") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0170 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0180 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadows, multi line text + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0180 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow018") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0180 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0190 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadows, dynamically changing styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0190 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow019") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0200 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, dynamically changing shadow styles + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0200 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow020") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0200 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0210 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, dynamically changing component position offset + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0210 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow021") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0210 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_TEXTSHADOW_0220 + * @tc.name TEXT-SHADOW + * @tc.desc Text component, multi-layer shadow, component setting path animation motionPath + * @tc.level Level 3 + */ + it('SUB_ACE_UI_TEXTSHADOW_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0220 start.`); + Settings.createWindow("testability/pages/UiTextShadow/UiTextShadow022") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0220 finish.`); + done() + }) + }) +} -- Gitee From bc7ed9ea5ca1c84345d3bb0c826404fa6cf74bb3 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 13:43:51 +0800 Subject: [PATCH 06/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...ponentAttributeStringModifyingStyle001.ets | 50 ++++++++++++++ ...ponentAttributeStringModifyingStyle002.ets | 56 ++++++++++++++++ ...ponentAttributeStringModifyingStyle003.ets | 48 ++++++++++++++ ...ponentAttributeStringModifyingStyle004.ets | 45 +++++++++++++ ...ponentAttributeStringModifyingStyle005.ets | 55 ++++++++++++++++ ...ponentAttributeStringModifyingStyle006.ets | 66 +++++++++++++++++++ ...ntAttributeStringModifyingStyleText001.ets | 49 ++++++++++++++ ...ntAttributeStringModifyingStyleText002.ets | 57 ++++++++++++++++ ...ntAttributeStringModifyingStyleText003.ets | 50 ++++++++++++++ ...ntAttributeStringModifyingStyleText004.ets | 49 ++++++++++++++ ...ntAttributeStringModifyingStyleText005.ets | 51 ++++++++++++++ 11 files changed, 576 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle006.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle001.ets new file mode 100644 index 000000000..c814ec797 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle001.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyle001 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString1') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + + this.mutableStyledString1.replaceStyle({ + start:2, + length:4, + styledKey:StyledStringKey.FONT, + styledValue: new TextStyle({fontColor:Color.Green}) + }) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets new file mode 100644 index 000000000..e9931f12e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets @@ -0,0 +1,56 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyle002 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString002') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + + this.mutableStyledString1.replaceStyle({ + start:2, + length:4, + styledKey:StyledStringKey.FONT, + styledValue: new TextStyle({fontColor:Color.Green}) + }) + + let styles = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT) + + for (let i = 0; i < styles.length; i++) { + console.info('test {' + styles[i].start + ',' + styles[i].length + ',' + 'styledKey:StyledStringKey.FONT' + styles[i].styledKey + '}') + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle003.ets new file mode 100644 index 000000000..d5637a567 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle003.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyle003 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + + this.mutableStyledString1.setStyle({ + start:2, + length:4, + styledKey:StyledStringKey.FONT, + styledValue: new TextStyle({fontColor:Color.Green})}) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle004.ets new file mode 100644 index 000000000..1b1074f55 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle004.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyle004 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString004') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + + this.mutableStyledString1.clearStyles() + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets new file mode 100644 index 000000000..e65f1765a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyle005 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString005') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + + this.mutableStyledString1.clearStyles() + + let styles = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT) + + for (let i = 0; i < styles.length; i++) { + if(styles[i].start == null){ + console.info("return null") + }else{ + console.info('test {' + styles[i].start + ',' + styles[i].length + ',' + 'styledKey:StyledStringKey.FONT' + styles[i].styledKey + '}') + } + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle006.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle006.ets new file mode 100644 index 000000000..057036ef4 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle006.ets @@ -0,0 +1,66 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyle006 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString006') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + + this.mutableStyledString1.setStyle({ + start:2, + length:4, + styledKey:StyledStringKey.FONT, + styledValue: new TextStyle({fontColor:Color.Green})}) + + this.mutableStyledString1.removeStyles(0,7) + + this.mutableStyledString1.setStyle({ + start:2, + length:4, + styledKey:StyledStringKey.FONT, + styledValue: new TextStyle({fontColor:Color.Green})}) + + this.mutableStyledString1.removeStyles(0,7) + + this.mutableStyledString1.setStyle({ + start:2, + length:4, + styledKey:StyledStringKey.FONT, + styledValue: new TextStyle({fontColor:Color.Green})}) + + this.mutableStyledString1.removeStyles(0,7) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText001.ets new file mode 100644 index 000000000..722564d51 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText001.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyleText001 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.replaceStyledString(2, 2, + new StyledString('输入框', [{start:0,length:3,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets new file mode 100644 index 000000000..149d21444 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets @@ -0,0 +1,57 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyleText002 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.replaceStyledString(2, 2, + new StyledString('输入框', [{start:0,length:3,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) + console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) + console.info("mutableStyledString1 length", this.mutableStyledString1.length) + let fontArray = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT) + for (let i = 0; i < fontArray.length; i++) { + console.info('mutableStyledString1 style object start:' + fontArray[i].start) + console.info('mutableStyledString1 style object length:' + fontArray[i].length) + console.info('mutableStyledString1 style object key:' + fontArray[i].styledKey) + } + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText003.ets new file mode 100644 index 000000000..6f125cfe2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText003.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyleText003 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.insertStyledString(4,new StyledString('输入框', + [{styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) + console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets new file mode 100644 index 000000000..88cc90bfa --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyleText004 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.appendStyledString(new StyledString('文本输入', + [{styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) + console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets new file mode 100644 index 000000000..ad7431f27 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets @@ -0,0 +1,51 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingStyleText005 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.appendStyledString(new StyledString('文本输入', + [{styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) + console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) + console.info("mutableStyledString1 length", this.mutableStyledString1.length) + console.info("mutableStyledString1 StyledStringKey", this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From e867d575a297cde57be36393afc4f6880cdfb1bd Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 13:45:20 +0800 Subject: [PATCH 07/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...mponentAttributeStringModifyingText001.ets | 43 +++++++++++++++++ ...mponentAttributeStringModifyingText002.ets | 46 ++++++++++++++++++ ...mponentAttributeStringModifyingText003.ets | 48 +++++++++++++++++++ ...mponentAttributeStringModifyingText004.ets | 46 ++++++++++++++++++ ...mponentAttributeStringModifyingText005.ets | 48 +++++++++++++++++++ ...mponentAttributeStringModifyingText006.ets | 47 ++++++++++++++++++ ...mponentAttributeStringModifyingText007.ets | 48 +++++++++++++++++++ ...mponentAttributeStringModifyingText008.ets | 46 ++++++++++++++++++ ...mponentAttributeStringModifyingText009.ets | 48 +++++++++++++++++++ ...mponentAttributeStringModifyingText010.ets | 48 +++++++++++++++++++ 10 files changed, 468 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText006.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText008.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText001.ets new file mode 100644 index 000000000..d0bf72a83 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText001.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText001 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + + this.mutableStyledString1.replaceString(0, 4, '已经替换') + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText002.ets new file mode 100644 index 000000000..3bafa23bf --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText002.ets @@ -0,0 +1,46 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText002 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.replaceString(0, 2, '已经替换') + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets new file mode 100644 index 000000000..3813febaa --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText003 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.replaceString(0, 2, '已经替换') + console.info("mutableStyledString1 content:", this.mutableStyledString1.getString()); + console.info("mutableStyledString1 length:", this.mutableStyledString1.length); + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText004.ets new file mode 100644 index 000000000..ceab541dd --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText004.ets @@ -0,0 +1,46 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText004 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.insertString(0,'输入框') + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets new file mode 100644 index 000000000..e8f5840ac --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText005 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.insertString(1,' ') + this.mutableStyledString1.insertString(4,'\n') + console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText006.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText006.ets new file mode 100644 index 000000000..2c021ec18 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText006.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText006 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.insertString(4,'输入框') + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets new file mode 100644 index 000000000..6b879c048 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText007 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.insertString(0,'输入框') + console.info("mutableStyledString1 content:", this.mutableStyledString1.getString()); + console.info("mutableStyledString1 length:", this.mutableStyledString1.length); + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText008.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText008.ets new file mode 100644 index 000000000..893aa6802 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText008.ets @@ -0,0 +1,46 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText008 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.removeString(0,2) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets new file mode 100644 index 000000000..021e9672c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText009 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.mutableStyledString1.removeString(0,2) + console.info("mutableStyledString1 content:", this.mutableStyledString1.getString()); + console.info("mutableStyledString1 length:", this.mutableStyledString1.length); + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets new file mode 100644 index 000000000..babd37574 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + + +@Entry +@Component +struct ComponentAttributeStringModifyingText010 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + let styles = this.mutableStyledString1.getStyles(0, this.mutableStyledString1.length) + let fontAttr = styles[0].styledValue as TextStyle; + console.info('mutableStyledString1 fontColor:' + fontAttr.fontColor) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From b141b7b0928df03e2964b55e64721b2e7dd158eb Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 13:48:20 +0800 Subject: [PATCH 08/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentLayoutCommonPixel001.ets | 38 ++++++++++++++ .../ComponentLayoutCommonPixel002.ets | 38 ++++++++++++++ .../ComponentLayoutCommonPixel003.ets | 39 ++++++++++++++ .../ComponentLayoutCommonPixel004.ets | 39 ++++++++++++++ .../ComponentLayoutCommonPixel005.ets | 40 ++++++++++++++ .../ComponentLayoutCommonPixel006.ets | 39 ++++++++++++++ .../ComponentLayoutCommonPixel007.ets | 39 ++++++++++++++ .../ComponentLayoutCommonPixel008.ets | 39 ++++++++++++++ .../ComponentLayoutCommonPixel009.ets | 41 +++++++++++++++ .../ComponentLayoutCommonPixel010.ets | 41 +++++++++++++++ .../ComponentLayoutCommonPixel011.ets | 41 +++++++++++++++ .../ComponentLayoutCommonPixel012.ets | 41 +++++++++++++++ .../ComponentLayoutCommonPixel013.ets | 43 +++++++++++++++ .../ComponentLayoutCommonPixel014.ets | 46 ++++++++++++++++ .../ComponentLayoutCommonPixel015.ets | 46 ++++++++++++++++ .../ComponentLayoutCommonPixel016.ets | 46 ++++++++++++++++ .../ComponentLayoutCommonPixel017.ets | 52 +++++++++++++++++++ .../ComponentLayoutCommonPixel018.ets | 52 +++++++++++++++++++ .../ComponentLayoutCommonPixel019.ets | 52 +++++++++++++++++++ .../ComponentLayoutCommonPixel020.ets | 51 ++++++++++++++++++ .../ComponentLayoutCommonPixel021.ets | 33 ++++++++++++ 21 files changed, 896 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel005.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel006.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel007.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel008.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel009.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel010.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel011.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel012.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel013.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel014.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel015.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel016.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel017.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel018.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel019.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel020.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel021.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel001.ets new file mode 100644 index 000000000..3f6af4c85 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel001.ets @@ -0,0 +1,38 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel001 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .displayCount(7, true) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel002.ets new file mode 100644 index 000000000..1a2ce466d --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel002.ets @@ -0,0 +1,38 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel002 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .displayCount(8, true) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel003.ets new file mode 100644 index 000000000..f84740902 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel003.ets @@ -0,0 +1,39 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel003 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel004.ets new file mode 100644 index 000000000..0638eaeaa --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel004.ets @@ -0,0 +1,39 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel004 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel005.ets new file mode 100644 index 000000000..cc305f000 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel005.ets @@ -0,0 +1,40 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel005 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel006.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel006.ets new file mode 100644 index 000000000..43bd05e05 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel006.ets @@ -0,0 +1,39 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel006 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel007.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel007.ets new file mode 100644 index 000000000..280558fb4 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel007.ets @@ -0,0 +1,39 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel007 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel008.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel008.ets new file mode 100644 index 000000000..fe6a0654d --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel008.ets @@ -0,0 +1,39 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel008 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel009.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel009.ets new file mode 100644 index 000000000..284337b5a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel009.ets @@ -0,0 +1,41 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel009 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("0").width(30.3).height(80.5).borderWidth(1) + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel010.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel010.ets new file mode 100644 index 000000000..e099c8c84 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel010.ets @@ -0,0 +1,41 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel010 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("0").width(30.3).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel011.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel011.ets new file mode 100644 index 000000000..5ee8d2290 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel011.ets @@ -0,0 +1,41 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel011 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + Text("0").width(30.3).height(80.5) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel012.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel012.ets new file mode 100644 index 000000000..55d0bc4f1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel012.ets @@ -0,0 +1,41 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel012 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + .disableSwipe(true) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel013.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel013.ets new file mode 100644 index 000000000..152561234 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel013.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel013 { + + private swiperController: SwiperController = new SwiperController() + + build() { + Column({ space: 5 }) { + Swiper(this.swiperController){ + Text("1").width(100.3).height(80.4).borderWidth(1) + Text("2").width(30.2).height(80.5).borderWidth(1) + Text("3").width(30.4).height(80.4).borderWidth(1) + Text("4").width(30.8).height(80.5).borderWidth(1) + Text("5").width(30.8).height(80.4).borderWidth(1) + Text("6").width(30.2).height(80.5).borderWidth(1) + Text("7").width(30.2).height(80.4).borderWidth(1) + } + .width(100.5) + .height(100.4) + .indicator(false) + .displayCount(7, true) + .displayArrow(false) + .disableSwipe(true) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel014.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel014.ets new file mode 100644 index 000000000..36f092809 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel014.ets @@ -0,0 +1,46 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel014 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("2").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("3").width(30.4).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("4").width(30.8).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("5").width(30.8).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("6").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("7").width(30.2).height(80.4).borderWidth(1) + } + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel015.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel015.ets new file mode 100644 index 000000000..d627ac41a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel015.ets @@ -0,0 +1,46 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel015 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("1").width(100.3).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("2").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("4").width(30.8).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("5").width(30.8).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("6").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("7").width(30.2).height(80.4).borderWidth(1) + } + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel016.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel016.ets new file mode 100644 index 000000000..6ec6ff28b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel016.ets @@ -0,0 +1,46 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel016 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("1").width(100.3).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("2").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("3").width(30.4).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("4").width(30.8).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("5").width(30.8).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("6").width(30.2).height(80.5).borderWidth(1) + } + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel017.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel017.ets new file mode 100644 index 000000000..69b295b06 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel017.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel017 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("0").width(30.3).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("1").width(100.3).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("2").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("3").width(30.4).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("4").width(30.8).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("5").width(30.8).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("6").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("7").width(30.2).height(80.4).borderWidth(1) + } + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel018.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel018.ets new file mode 100644 index 000000000..6ad18e33a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel018.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel018 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("1").width(100.3).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("2").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("0").width(30.3).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("3").width(30.4).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("4").width(30.8).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("5").width(30.8).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("6").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("7").width(30.2).height(80.4).borderWidth(1) + } + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel019.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel019.ets new file mode 100644 index 000000000..982077db0 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel019.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel019 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("1").width(100.3).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("2").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("3").width(30.4).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("4").width(30.8).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("5").width(30.8).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("6").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("7").width(30.2).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("0").width(30.3).height(80.5).borderWidth(1) + } + } + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel020.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel020.ets new file mode 100644 index 000000000..0a78a5a2e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel020.ets @@ -0,0 +1,51 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel020 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("1").width(100.3).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("2").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("3").width(30.4).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("4").width(30.8).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("5").width(30.8).height(80.4).borderWidth(1) + } + FlowItem(){ + Text("6").width(30.2).height(80.5).borderWidth(1) + } + FlowItem(){ + Text("7").width(30.2).height(80.4).borderWidth(1) + } + } + .width(100.5) + .height(100.4) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel021.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel021.ets new file mode 100644 index 000000000..656c73104 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentLayoutCommonPixel/ComponentLayoutCommonPixel021.ets @@ -0,0 +1,33 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + + +@Entry +@Component +struct ComponentLayoutCommonPixel021 { + + build() { + Column({ space: 5 }) { + WaterFlow(){ + FlowItem(){ + Text("1").width(80.4).height(80.5).borderWidth(1) + } + } + .width(100.5) + .height(100.4) + }.width('100%') + } +} \ No newline at end of file -- Gitee From 8bb447bad6616f55f7528a47d7c5a6b4f147b020 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 13:58:17 +0800 Subject: [PATCH 09/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentTextAttributeString001.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString002.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString003.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString004.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString005.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString006.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString007.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString008.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString009.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString010.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString011.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString012.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString013.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString014.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString015.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString016.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString017.ets | 40 +++++++++++++++++ .../ComponentTextAttributeString018.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString019.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString020.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString021.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString022.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString023.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString024.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString025.ets | 41 +++++++++++++++++ .../ComponentTextAttributeString026.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString027.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString028.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString029.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString030.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString031.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString032.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString033.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString034.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString035.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString036.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString037.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString038.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString039.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString040.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString041.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString042.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString043.ets | 42 ++++++++++++++++++ .../ComponentTextAttributeString044.ets | 44 +++++++++++++++++++ 44 files changed, 1830 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString005.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString006.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString007.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString008.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString009.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString010.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString011.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString012.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString013.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString014.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString016.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString017.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString018.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString019.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString020.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString021.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString022.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString023.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString024.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString025.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString026.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString027.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString028.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString029.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString030.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString031.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString032.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString033.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString034.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString035.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString036.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString037.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString038.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString039.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString040.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString041.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString042.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString043.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString044.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString001.ets new file mode 100644 index 000000000..ee74c2f10 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString001.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString001 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(10, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString1') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString002.ets new file mode 100644 index 000000000..0c8cca38f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString002.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString002 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(80,LengthUnit.PERCENT)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString1') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString003.ets new file mode 100644 index 000000000..e6cddd642 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString003.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString003 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(30,LengthUnit.VP)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString1') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString004.ets new file mode 100644 index 000000000..c64e110dd --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString004.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString004 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(30,LengthUnit.FP)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString4') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString005.ets new file mode 100644 index 000000000..4a484fca7 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString005.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString005 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(50,LengthUnit.LPX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString5') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString006.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString006.ets new file mode 100644 index 000000000..ed3aedf69 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString006.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString006 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontWeight: 0})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString6') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString007.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString007.ets new file mode 100644 index 000000000..a22463754 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString007.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString007 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontWeight: 200})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString6') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString008.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString008.ets new file mode 100644 index 000000000..b991315a0 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString008.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString008 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontWeight: 1000})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString009.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString009.ets new file mode 100644 index 000000000..b93c13b1d --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString009.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString009 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontWeight: FontWeight.Bolder})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString010.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString010.ets new file mode 100644 index 000000000..d644dc04b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString010.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString010 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontWeight: 'abcdefg'})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString011.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString011.ets new file mode 100644 index 000000000..84f3f16c7 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString011.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString011 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontWeight: 'bolder'})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString012.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString012.ets new file mode 100644 index 000000000..059ed3878 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString012.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString012 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontWeight: undefined})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString013.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString013.ets new file mode 100644 index 000000000..129c4c9de --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString013.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString013 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontStyle: FontStyle.Normal})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString014.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString014.ets new file mode 100644 index 000000000..e37e78ab8 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString014.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString014 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontStyle: FontStyle.Italic})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets new file mode 100644 index 000000000..3ff310e55 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString015 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontFamily: 'custom'})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + console.info("mutableStyledString1 length",this.mutableStyledString1.getStyles(0, this.mutableStyledString1.length)) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString016.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString016.ets new file mode 100644 index 000000000..c5323ca00 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString016.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString016 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontFamily: 'HarmonyOS Sans'})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString017.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString017.ets new file mode 100644 index 000000000..6ca097755 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString017.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString017 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString018.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString018.ets new file mode 100644 index 000000000..e791eb675 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString018.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString018 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.Overline, color: Color.Red })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString019.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString019.ets new file mode 100644 index 000000000..63ecdab83 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString019.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString019 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Blue })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString020.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString020.ets new file mode 100644 index 000000000..32c5764fc --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString020.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString020 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: Color.Pink })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString021.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString021.ets new file mode 100644 index 000000000..9a61e676f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString021.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString021 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.None, color: Color.Green })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString022.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString022.ets new file mode 100644 index 000000000..381f49df8 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString022.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString022 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.None, color: Color.Yellow })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString023.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString023.ets new file mode 100644 index 000000000..6ff3bbdf4 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString023.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString023 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.Underline })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString024.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString024.ets new file mode 100644 index 000000000..46d848751 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString024.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString024 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: '0x100abcd'})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString025.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString025.ets new file mode 100644 index 000000000..c50b03095 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString025.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString025 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.DECORATION, styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: $r('app.color.yellow')})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString026.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString026.ets new file mode 100644 index 000000000..a2397b418 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString026.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString026 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(LengthMetrics.vp(-30))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString027.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString027.ets new file mode 100644 index 000000000..345c70e1d --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString027.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString027 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(30,0))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString028.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString028.ets new file mode 100644 index 000000000..b3a2c94db --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString028.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString028 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(20,1))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString029.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString029.ets new file mode 100644 index 000000000..12df720aa --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString029.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString029 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(10,2))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString030.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString030.ets new file mode 100644 index 000000000..ef7381e64 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString030.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString030 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(50,3))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString031.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString031.ets new file mode 100644 index 000000000..cfd95b9b2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString031.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString031 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(50,4))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString032.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString032.ets new file mode 100644 index 000000000..24e5981a1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString032.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString032 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(20,undefined))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString033.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString033.ets new file mode 100644 index 000000000..0f269b2b8 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString033.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString033 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(0,0))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString034.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString034.ets new file mode 100644 index 000000000..6fdbb59e0 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString034.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString034 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.BASELINE_OFFSET, styledValue: new BaselineOffsetStyle(new LengthMetrics(0,0))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString035.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString035.ets new file mode 100644 index 000000000..7a72f4094 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString035.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString035 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(-10))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString036.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString036.ets new file mode 100644 index 000000000..0ee230404 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString036.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString036 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:5, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(10,0))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString037.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString037.ets new file mode 100644 index 000000000..f9475266d --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString037.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString037 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:5, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(20,0))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString038.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString038.ets new file mode 100644 index 000000000..440bd331a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString038.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString038 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:5, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(10,2))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString039.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString039.ets new file mode 100644 index 000000000..961e4fa17 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString039.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString039 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:5, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(50,3))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString040.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString040.ets new file mode 100644 index 000000000..e3fdc1b75 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString040.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString040 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:5, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(5,4))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString041.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString041.ets new file mode 100644 index 000000000..0f0e038fa --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString041.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString041 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:5, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(20,undefined))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString042.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString042.ets new file mode 100644 index 000000000..56a70044f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString042.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString042 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:5, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(0,0))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString043.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString043.ets new file mode 100644 index 000000000..98624da49 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString043.ets @@ -0,0 +1,42 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString043 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:0, length:2, styledKey: StyledStringKey.LETTER_SPACING, styledValue: new LetterSpacingStyle(new LengthMetrics(0,0))}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString044.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString044.ets new file mode 100644 index 000000000..2a659b13a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString044.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeString044 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7, styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle( + [{ radius: 50, color: "#FF16A1D7", offsetX: 30, offsetY: 30, fill: true }, + { radius: 5, color: "#ff9d16d7", offsetX: 10, offsetY: 10, fill: true }, + { radius: 15, color: "#fffaa904", offsetX: 0, offsetY: 0, fill: true }])}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From ad51569da7e4ee540ce9dea97dad3fcb5b96dc07 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:00:54 +0800 Subject: [PATCH 10/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentTextAttributeString045.ets | 49 ++++++++++ .../ComponentTextAttributeString046.ets | 53 ++++++++++ .../ComponentTextAttributeString047.ets | 53 ++++++++++ .../ComponentTextAttributeString048.ets | 53 ++++++++++ .../ComponentTextAttributeString049.ets | 98 +++++++++++++++++++ .../ComponentTextAttributeString050.ets | 98 +++++++++++++++++++ .../ComponentTextAttributeString051.ets | 52 ++++++++++ .../ComponentTextAttributeString052.ets | 52 ++++++++++ .../ComponentTextAttributeString053.ets | 52 ++++++++++ .../ComponentTextAttributeString054.ets | 58 +++++++++++ .../ComponentTextAttributeString055.ets | 57 +++++++++++ .../ComponentTextAttributeString056.ets | 58 +++++++++++ .../ComponentTextAttributeString057.ets | 56 +++++++++++ .../ComponentTextAttributeString058.ets | 50 ++++++++++ .../ComponentTextAttributeString059.ets | 51 ++++++++++ .../ComponentTextAttributeString060.ets | 51 ++++++++++ 16 files changed, 941 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString046.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString047.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString048.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString049.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString050.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString051.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString052.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString053.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString054.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString055.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString056.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString057.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString058.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString059.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString060.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets new file mode 100644 index 000000000..4a712bfca --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets @@ -0,0 +1,49 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString045 { + @State message: string = '这是一段测试文字' + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + console.info("mutableStyledString1 length" + this.mutableStyledString1.getStyles(0, this.mutableStyledString1.length)) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString046.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString046.ets new file mode 100644 index 000000000..77671c785 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString046.ets @@ -0,0 +1,53 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString046 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.replaceString(2 , 2 , ("特殊")) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString047.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString047.ets new file mode 100644 index 000000000..5b3ac77cd --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString047.ets @@ -0,0 +1,53 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString047 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.insertString(2 , ("特殊")) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString048.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString048.ets new file mode 100644 index 000000000..21928b630 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString048.ets @@ -0,0 +1,53 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString048 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.removeString(2, 2) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString049.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString049.ets new file mode 100644 index 000000000..0fd4bdbaf --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString049.ets @@ -0,0 +1,98 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString049 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString2: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString3: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString4: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString5: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + controller3: TextController = new TextController(); + controller4: TextController = new TextController(); + controller5: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.mutableStyledString1.replaceStyle({ start: 2, length: 7,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontSize: new LengthMetrics(10), fontStyle: FontStyle.Normal, fontWeight: FontWeight.Lighter, fontColor: Color.Blue, })},) + this.controller1.setStyledString(this.mutableStyledString1) + }) + Text(undefined, { controller: this.controller2 }) + .onAreaChange(() => { + this.mutableStyledString2.replaceStyle({ start: 2, length: 7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(-10))}) + this.controller2.setStyledString(this.mutableStyledString2) + }) + Text(undefined, { controller: this.controller3 }) + .onAreaChange(() => { + this.mutableStyledString3.replaceStyle({ start: 2, length: 7, styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: Color.Green })}) + this.controller3.setStyledString(this.mutableStyledString3) + }) + Text(undefined, { controller: this.controller4 }) + .onAreaChange(() => { + this.mutableStyledString4.replaceStyle({start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}) + this.controller4.setStyledString(this.mutableStyledString4) + }) + Text(undefined, { controller: this.controller5 }) + .onAreaChange(() => { + this.mutableStyledString5.replaceStyle({start: 2, length: 7, styledKey: StyledStringKey.TEXT_SHADOW,styledValue: new TextShadowStyle([{radius: 0, color: Color.Pink, offsetX: -10, offsetY: -10, fill: true }])}) + this.controller5.setStyledString(this.mutableStyledString5) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString050.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString050.ets new file mode 100644 index 000000000..969a8b638 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString050.ets @@ -0,0 +1,98 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString050 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString2: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString3: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString4: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + mutableStyledString5: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + controller3: TextController = new TextController(); + controller4: TextController = new TextController(); + controller5: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.mutableStyledString1.setStyle({ start: 2, length: 7,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontSize: new LengthMetrics(10), fontStyle: FontStyle.Normal, fontWeight: FontWeight.Lighter, fontColor: Color.Blue, })},) + this.controller1.setStyledString(this.mutableStyledString1) + }) + Text(undefined, { controller: this.controller2 }) + .onAreaChange(() => { + this.mutableStyledString2.setStyle({ start: 2, length: 7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(-10))}) + this.controller2.setStyledString(this.mutableStyledString2) + }) + Text(undefined, { controller: this.controller3 }) + .onAreaChange(() => { + this.mutableStyledString3.setStyle({ start: 2, length: 7, styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: Color.Green })}) + this.controller3.setStyledString(this.mutableStyledString3) + }) + Text(undefined, { controller: this.controller4 }) + .onAreaChange(() => { + this.mutableStyledString4.setStyle({start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}) + this.controller4.setStyledString(this.mutableStyledString4) + }) + Text(undefined, { controller: this.controller5 }) + .onAreaChange(() => { + this.mutableStyledString5.setStyle({start: 2, length: 7, styledKey: StyledStringKey.TEXT_SHADOW,styledValue: new TextShadowStyle([{radius: 0, color: Color.Pink, offsetX: -10, offsetY: -10, fill: true }])}) + this.controller5.setStyledString(this.mutableStyledString5) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString051.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString051.ets new file mode 100644 index 000000000..c7705be59 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString051.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString051 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.removeStyle(2, 7, StyledStringKey.FONT) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString052.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString052.ets new file mode 100644 index 000000000..3d139dd44 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString052.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString052 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.removeStyles(2, 2) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString053.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString053.ets new file mode 100644 index 000000000..3f63ffa4a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString053.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString053 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.clearStyles() + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString054.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString054.ets new file mode 100644 index 000000000..37674d886 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString054.ets @@ -0,0 +1,58 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString054 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.replaceStyledString(0,2,new StyledString('全部', + [{ start: 0, length: 2,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontSize: new LengthMetrics(10), fontStyle: FontStyle.Normal, fontWeight: FontWeight.Lighter, fontColor: Color.Blue, })}, + { start: 0, length: 2,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(-10))}, + { start: 0, length: 2, styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: Color.Green })}, + { start: 0, length: 2, styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(5))}, + {start: 0, length: 2, styledKey: StyledStringKey.TEXT_SHADOW,styledValue: new TextShadowStyle([{radius: 0, color: Color.Green, offsetX: -10, offsetY: -10, fill: true }]) + }])) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString055.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString055.ets new file mode 100644 index 000000000..1a0c2c13c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString055.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString055 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.insertStyledString(0,new StyledString('全部', + [{ start: 0, length: 2,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontSize: new LengthMetrics(10), fontStyle: FontStyle.Normal, fontWeight: FontWeight.Lighter, fontColor: Color.Blue, })}, + { start: 0, length: 2,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(-10))}, + { start: 0, length: 2, styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: Color.Green })}, + { start: 0, length: 2, styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(5))}, + ])) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString056.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString056.ets new file mode 100644 index 000000000..20d8027e8 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString056.ets @@ -0,0 +1,58 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString056 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.mutableStyledString1.appendStyledString(new StyledString('全部', + [{ start: 0, length: 2,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontSize: new LengthMetrics(10), fontStyle: FontStyle.Normal, fontWeight: FontWeight.Lighter, fontColor: Color.Blue, })}, + { start: 0, length: 2,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(-10))}, + { start: 0, length: 2, styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.Underline, color: Color.Green })}, + { start: 0, length: 2, styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(5))}, + {start: 0, length: 2, styledKey: StyledStringKey.TEXT_SHADOW,styledValue: new TextShadowStyle([{radius: 0, color: Color.Green, offsetX: -10, offsetY: -10, fill: true }]) + }])) + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString057.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString057.ets new file mode 100644 index 000000000..c20af6d79 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString057.ets @@ -0,0 +1,56 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString057 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .fontSize(10) + .fontColor(Color.Green) + .fontWeight(FontWeight.Lighter) + .baselineOffset(-10) + .fontStyle(FontStyle.Italic) + .decoration({type:TextDecorationType.Underline,color: Color.Pink }) + .textShadow({ radius: 5, color: Color.Black, offsetX: -10, offsetY: -10 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString058.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString058.ets new file mode 100644 index 000000000..395c6a7a5 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString058.ets @@ -0,0 +1,50 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString058 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .copyOption(CopyOptions.InApp) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString059.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString059.ets new file mode 100644 index 000000000..c4e606a95 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString059.ets @@ -0,0 +1,51 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString059 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .padding(10) + .margin(10) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString060.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString060.ets new file mode 100644 index 000000000..6fb801f36 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString060.ets @@ -0,0 +1,51 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeString060 { + @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450 + fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); + mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", + [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, + {start:2, length:7,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:2, length:7,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:2, length:7,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]) + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .key('mutableStyledString8') + .onAreaChange(() => { + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } + }) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis}) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From a3fce27ce6eaf142ff188903dce0d7a19a6f7db4 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:04:27 +0800 Subject: [PATCH 11/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...ponentTextAttributeStringConstructs001.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs002.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs003.ets | 41 ++++++++++ ...ponentTextAttributeStringConstructs004.ets | 41 ++++++++++ ...ponentTextAttributeStringConstructs005.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs006.ets | 39 ++++++++++ ...ponentTextAttributeStringConstructs007.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs008.ets | 38 ++++++++++ ...ponentTextAttributeStringConstructs009.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs010.ets | 39 ++++++++++ ...ponentTextAttributeStringConstructs011.ets | 39 ++++++++++ ...ponentTextAttributeStringConstructs012.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs013.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs014.ets | 42 +++++++++++ ...ponentTextAttributeStringConstructs015.ets | 49 ++++++++++++ ...ponentTextAttributeStringConstructs016.ets | 42 +++++++++++ ...ponentTextAttributeStringConstructs017.ets | 42 +++++++++++ ...ponentTextAttributeStringConstructs018.ets | 42 +++++++++++ ...ponentTextAttributeStringConstructs019.ets | 42 +++++++++++ ...ponentTextAttributeStringConstructs020.ets | 41 ++++++++++ ...ponentTextAttributeStringConstructs021.ets | 46 ++++++++++++ ...ponentTextAttributeStringConstructs022.ets | 49 ++++++++++++ ...ponentTextAttributeStringConstructs023.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs024.ets | 49 ++++++++++++ ...ponentTextAttributeStringConstructs025.ets | 48 ++++++++++++ ...ponentTextAttributeStringConstructs026.ets | 40 ++++++++++ ...ponentTextAttributeStringConstructs027.ets | 49 ++++++++++++ ...ponentTextAttributeStringConstructs028.ets | 75 +++++++++++++++++++ ...ponentTextAttributeStringConstructs029.ets | 52 +++++++++++++ 29 files changed, 1265 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs005.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs006.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs007.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs008.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs009.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs010.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs011.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs012.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs013.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs014.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs015.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs016.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs017.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs018.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs019.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs020.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs021.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs022.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs023.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs024.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs025.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs026.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs027.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs028.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs029.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs001.ets new file mode 100644 index 000000000..bf09316f7 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs001.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs001 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs002.ets new file mode 100644 index 000000000..a059759e8 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs002.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs002 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs003.ets new file mode 100644 index 000000000..f0a5cce14 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs003.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs003 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs004.ets new file mode 100644 index 000000000..1b25320b7 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs004.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs004 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是测试字符:Abc123!@#¥%…&*()', + [{start:0, length:7, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:7, length:30, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs005.ets new file mode 100644 index 000000000..9a2ee1789 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs005.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs005 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:2, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs006.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs006.ets new file mode 100644 index 000000000..dd0a72359 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs006.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs006 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:3, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs007.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs007.ets new file mode 100644 index 000000000..def57f596 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs007.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs007 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:10, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs008.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs008.ets new file mode 100644 index 000000000..fa2122799 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs008.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs008 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字'); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs009.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs009.ets new file mode 100644 index 000000000..35f8c88b3 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs009.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs009 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs010.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs010.ets new file mode 100644 index 000000000..d27a64d46 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs010.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs010 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:15, length:5, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs011.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs011.ets new file mode 100644 index 000000000..3b8c31c42 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs011.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs011 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:-5, length:5, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs012.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs012.ets new file mode 100644 index 000000000..20827c85e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs012.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs012 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:-8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Blue) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs013.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs013.ets new file mode 100644 index 000000000..3db6350c1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs013.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs013 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs014.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs014.ets new file mode 100644 index 000000000..b45b9c869 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs014.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs014 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + spanStyle1:SpanStyle = {start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Pink})} + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.mutableStyledString1.replaceStyle(this.spanStyle1) + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs015.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs015.ets new file mode 100644 index 000000000..fc6af3730 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs015.ets @@ -0,0 +1,49 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; +import { expect } from '@ohos/hypium'; + +@Entry +@Component +struct ComponentTextAttributeStringConstructs015 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + spanStyle1:SpanStyle = {start:-1, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Pink})} + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + try { + this.mutableStyledString1.replaceStyle(this.spanStyle1) + this.controller1.setStyledString(this.mutableStyledString1) + } + catch (err){ + expect(err.code).assertEqual(401); + } + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs016.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs016.ets new file mode 100644 index 000000000..0ba9a9868 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs016.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs016 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + spanStyle1:SpanStyle = {start:20, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Pink})} + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.mutableStyledString1.replaceStyle(this.spanStyle1) + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs017.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs017.ets new file mode 100644 index 000000000..6930955c4 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs017.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs017 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + spanStyle1:SpanStyle = {start:0, length: -1, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Pink})} + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.mutableStyledString1.replaceStyle(this.spanStyle1) + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs018.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs018.ets new file mode 100644 index 000000000..1d214faa9 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs018.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs018 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + spanStyle1:SpanStyle = {start:0, length:20, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Pink})} + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.mutableStyledString1.replaceStyle(this.spanStyle1) + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs019.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs019.ets new file mode 100644 index 000000000..425a54211 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs019.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs019 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + spanStyle1:SpanStyle = {start:6, length:3, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Pink})} + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.mutableStyledString1.replaceStyle(this.spanStyle1) + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs020.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs020.ets new file mode 100644 index 000000000..7eaaea89a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs020.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs020 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }){ + Span('Span测试') + } + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs021.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs021.ets new file mode 100644 index 000000000..d88f78173 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs021.ets @@ -0,0 +1,46 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct ComponentTextAttributeStringConstructs021 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字这是一段测试文字这是一段测试文字这是一段测试文字这是一段测试文字这是一段测试文字这是一段测试文字这是一段测试文字这是一段测试文字', + [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, + {start:9, length:8,styledKey: StyledStringKey.BASELINE_OFFSET,styledValue: new BaselineOffsetStyle(new LengthMetrics(10))}, + {start:18, length:8,styledKey: StyledStringKey.DECORATION,styledValue: new DecorationStyle({ type: TextDecorationType.LineThrough, color: Color.Red })}, + {start:26, length:8,styledKey: StyledStringKey.LETTER_SPACING,styledValue: new LetterSpacingStyle(new LengthMetrics(10))}, + {start:34, length:8,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) + }]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs022.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs022.ets new file mode 100644 index 000000000..2a69f9675 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs022.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs022 { + @State phoneNumber: string = '(86) (755) ********'; + @State url: string = 'www.********.com'; + @State email: string = '1111@163.com'; + @State address: string = 'XX省XX市XX区XXXX'; + @State datetime: string = 'XX年XX月XX日XXXX'; + @State enableDataDetector: boolean = true; + @State types: TextDataDetectorType[] = []; + + build() { + Row() { + Column() { + Text( + '电话号码:' + this.phoneNumber + '\n' + + '链接:' + this.url + '\n' + + '邮箱:' + this.email + '\n' + + '地址:' + this.address + '\n' + + '时间:' + this.datetime + ) + .fontSize(16) + .enableDataDetector(this.enableDataDetector) + .dataDetectorConfig({types : this.types}) + .textAlign(TextAlign.Center) + .borderWidth(1) + .padding(10) + .width('100%') + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs023.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs023.ets new file mode 100644 index 000000000..13d3f6426 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs023.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs023 { + @State message: string = '这是一段测试文字' + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:8,styledKey: StyledStringKey.TEXT_SHADOW, styledValue: new TextShadowStyle([{radius: 0, color: Color.Blue, offsetX: 10, offsetY: 10, fill: true }, { radius: 15, color:Color.Green, offsetX: 0, offsetY: 0, fill: true }]) }]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .fontSize(20) + .fontColor(Color.Red) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs024.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs024.ets new file mode 100644 index 000000000..f1c61898c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs024.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs024 { + @State text: string = + 'The text component is used to display a piece of textual information.Support universal attributes and universal text attributes.' + @State ellipsisModeIndex: number = 0; + @State ellipsisMode: EllipsisMode[] = [EllipsisMode.START, EllipsisMode.CENTER, EllipsisMode.END] + @State ellipsisModeStr: string[] = ['START', 'CENTER', 'END'] + + controller1: TextController = new TextController(); + + build() { + Column({ space: 10 }) { + Text(this.text) + .fontSize(16) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .ellipsisMode(this.ellipsisMode[this.ellipsisModeIndex]) + .width(300) + .margin({ left: 20, top: 20 }) + + Row() { + Button('更改省略号位置:' + this.ellipsisModeStr[this.ellipsisModeIndex]).onClick(() => { + this.ellipsisModeIndex++ + if (this.ellipsisModeIndex > (this.ellipsisModeStr.length - 1)) { + this.ellipsisModeIndex = 0 + } + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs025.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs025.ets new file mode 100644 index 000000000..11995114a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs025.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs025 { + @State text: string = + 'The text component is used to display a piece of textual information.Support universal attributes and universal text attributes.' + @State textOverflowIndex: number = 0; + @State textOverflowMode: TextOverflow[] = [TextOverflow.Clip, TextOverflow.Ellipsis, TextOverflow.MARQUEE] + @State textOverflowModeStr: string[] = ['Clip', 'Ellipsis', 'MARQUEE'] + + controller1: TextController = new TextController(); + + build() { + Column({ space: 10 }) { + Text(this.text) + .fontSize(16) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .textOverflow({ overflow: this.textOverflowMode[this.textOverflowIndex] }) + .width(300) + .margin({ left: 20, top: 20 }) + + Row() { + Button('更改省略号位置:' + this.textOverflowModeStr[this.textOverflowIndex]).onClick(() => { + this.textOverflowIndex++ + if (this.textOverflowIndex > (this.textOverflowModeStr.length - 1)) { + this.textOverflowIndex = 0 + } + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs026.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs026.ets new file mode 100644 index 000000000..5fe51526a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs026.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs026 { + @State text: string = + 'The text component is used to display a piece of textual information.Support universal attributes and universal text attributes.' + @State textOverflowIndex: number = 0; + @State textOverflowMode: TextOverflow[] = [TextOverflow.Clip, TextOverflow.Ellipsis, TextOverflow.MARQUEE] + @State textOverflowModeStr: string[] = ['Clip', 'Ellipsis', 'MARQUEE'] + + controller1: TextController = new TextController(); + + build() { + Column({ space: 10 }) { + Text(this.text) + .fontSize(16) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .textOverflow({ overflow: this.textOverflowMode[this.textOverflowIndex] }) + .width(300) + .margin({ left: 20, top: 20 }) + .privacySensitive(true) + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs027.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs027.ets new file mode 100644 index 000000000..a9b3edaa0 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs027.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs027 { + @State text: string = + 'The text component is used to display a piece of textual information.Support universal attributes and universal text attributes.' + @State textAlignIndex: number = 0; + @State textAlignMode: TextAlign[] = [TextAlign.Center, TextAlign.Start, TextAlign.End] + @State textAlignModeStr: string[] = ['Center', 'Start', 'End'] + + controller1: TextController = new TextController(); + + build() { + Column({ space: 10 }) { + Text(this.text) + .width(300) + .margin({ left: 20, top: 20 }) + .fontSize(16) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .textAlign((this.textAlignMode[this.textAlignIndex])) + + + Row() { + Button('更改省略号位置:' + this.textAlignModeStr[this.textAlignIndex]).onClick(() => { + this.textAlignIndex++ + if (this.textAlignIndex > (this.textAlignModeStr.length - 1)) { + this.textAlignIndex = 0 + } + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs028.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs028.ets new file mode 100644 index 000000000..bc6194f6b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs028.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs028 { + @State text: string = + 'The text component is used to display a piece of textual information.Support universal attributes and universal text attributes.' + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Italic, FontStyle.Normal] + @State fontStyleModeStr: string[] = ['Italic', 'Normal'] + + @State fontWeightIndex: number = 0; + @State fontWeightMode: FontWeight[] = [FontWeight.Lighter, FontWeight.Normal, FontWeight.Bolder] + @State fontWeightModeStr: string[] = ['Lighter', 'Normal', 'Bolder'] + + @State fontSizeIndex: number = 0; + @State fontSizeMode: number[] = [10, 20, 30] + @State fontSizeModeStr: string[] = ['10', '20', '30'] + + controller1: TextController = new TextController(); + + build() { + Column({ space: 10 }) { + Text(this.text) + .width(300) + .margin({ left: 20, top: 20 }) + .fontSize(this.fontSizeMode[this.fontSizeIndex]) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + .fontWeight(this.fontWeightMode[this.fontWeightIndex]) + .fontStyle(this.fontStyleMode[this.fontStyleIndex]) + + Row() { + Button('更改fontSize:' + this.fontSizeMode[this.fontSizeIndex]).onClick(() => { + this.fontSizeIndex++ + if (this.fontSizeIndex > (this.fontSizeModeStr.length - 1)) { + this.fontSizeIndex = 0 + } + }) + } + + Row() { + Button('更改fontWeight:' + this.fontWeightModeStr[this.fontWeightIndex]).onClick(() => { + this.fontWeightIndex++ + if (this.fontWeightIndex > (this.fontWeightModeStr.length - 1)) { + this.fontWeightIndex = 0 + } + }) + } + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs029.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs029.ets new file mode 100644 index 000000000..c1fc37066 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeStringConstructs/ComponentTextAttributeStringConstructs029.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct ComponentTextAttributeStringConstructs029 { + @State decorationIndex: number = 0; + @State decorationMode: TextDecorationType[] = [TextDecorationType.Underline, TextDecorationType.Overline, TextDecorationType.LineThrough, TextDecorationType.None] + @State decorationModeStr: string[] = ['Underline', 'Overline', 'LineThrough', 'None'] + + StyledString1: StyledString = new StyledString('这是一段测试文字', + [{start:0, length:8,styledKey: StyledStringKey.TEXT_SHADOW, + styledValue: new DecorationStyle({type: this.decorationMode[this.decorationIndex]})}]); + + controller1: TextController = new TextController(); + + build() { + Column({ space: 10 }) { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.StyledString1) + }) + .width(300) + .margin({ left: 20, top: 20 }) + .fontSize(16) + .border({ width: 1 }) + .lineHeight(20) + .maxLines(2) + + Row() { + Button('更改decoration:' + this.decorationModeStr[this.decorationIndex]).onClick(() => { + this.decorationIndex++ + if (this.decorationIndex > (this.decorationModeStr.length - 1)) { + this.decorationIndex = 0 + } + }) + } + } + } +} \ No newline at end of file -- Gitee From c08d123e8827de2aa045b29c30908674f7dd9a2b Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:09:29 +0800 Subject: [PATCH 12/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextBrighten/UiTextBrighten001.ets | 40 +++++++ .../UiTextBrighten/UiTextBrighten002.ets | 43 +++++++ .../UiTextBrighten/UiTextBrighten003.ets | 40 +++++++ .../UiTextBrighten/UiTextBrighten004.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten005.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten006.ets | 57 +++++++++ .../UiTextBrighten/UiTextBrighten007.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten008.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten009.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten010.ets | 57 +++++++++ .../UiTextBrighten/UiTextBrighten011.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten012.ets | 57 +++++++++ .../UiTextBrighten/UiTextBrighten013.ets | 57 +++++++++ .../UiTextBrighten/UiTextBrighten014.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten015.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten016.ets | 43 +++++++ .../UiTextBrighten/UiTextBrighten017.ets | 43 +++++++ .../UiTextBrighten/UiTextBrighten018.ets | 111 ++++++++++++++++++ .../UiTextBrighten/UiTextBrighten019.ets | 92 +++++++++++++++ .../UiTextBrighten/UiTextBrighten020.ets | 57 +++++++++ .../UiTextBrighten/UiTextBrighten021.ets | 43 +++++++ .../UiTextBrighten/UiTextBrighten022.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten023.ets | 41 +++++++ .../UiTextBrighten/UiTextBrighten024.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten025.ets | 46 ++++++++ .../UiTextBrighten/UiTextBrighten026.ets | 39 ++++++ .../UiTextBrighten/UiTextBrighten027.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten028.ets | 39 ++++++ .../UiTextBrighten/UiTextBrighten029.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten030.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten031.ets | 55 +++++++++ .../UiTextBrighten/UiTextBrighten032.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten033.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten034.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten035.ets | 55 +++++++++ 35 files changed, 1705 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten005.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten006.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten007.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten008.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten009.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten010.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten011.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten012.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten013.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten014.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten015.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten016.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten017.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten018.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten019.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten020.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten021.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten022.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten023.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten024.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten025.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten026.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten027.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten028.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten029.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten030.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten031.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten032.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten033.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten034.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten035.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten001.ets new file mode 100644 index 000000000..1db48e177 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten001.ets @@ -0,0 +1,40 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten001 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow({radius: 10, color: Color.Red, offsetX: -10, offsetY: -10 }) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten002.ets new file mode 100644 index 000000000..359529275 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten002.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten002 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten003.ets new file mode 100644 index 000000000..3f07f222b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten003.ets @@ -0,0 +1,40 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten003 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten004.ets new file mode 100644 index 000000000..eaafddd97 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten004.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten004 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(10, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontSize(10) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten005.ets new file mode 100644 index 000000000..219aaf4a3 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten005.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten005 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(30, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontSize(30) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten006.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten006.ets new file mode 100644 index 000000000..c1506c8b3 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten006.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten006 { + @State fontSizeIndex: number = 0; + @State fontSizeMode: number[] = [10, 20, 30] + @State fontSizeModeStr: string[] = ['10', '20', '30'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontSize(this.fontSizeMode[this.fontSizeIndex]) + .margin({ top: 20 }) + + Row() { + Button('更改fontSize:' + this.fontSizeModeStr[this.fontSizeIndex]).onClick(() => { + this.fontSizeIndex++ + if (this.fontSizeIndex > (this.fontSizeModeStr.length - 1)) { + this.fontSizeIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten007.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten007.ets new file mode 100644 index 000000000..4c5f96e1a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten007.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten007 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + .fontWeight(FontWeight.Lighter) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten008.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten008.ets new file mode 100644 index 000000000..e558806ff --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten008.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten008 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + .fontWeight(FontWeight.Normal) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten009.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten009.ets new file mode 100644 index 000000000..c9c9bdac2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten009.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten009 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + .fontWeight(FontWeight.Bolder) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten010.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten010.ets new file mode 100644 index 000000000..60468b598 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten010.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten010 { + @State fontWeightIndex: number = 0; + @State fontWeightMode: FontWeight[] = [FontWeight.Lighter, FontWeight.Normal, FontWeight.Regular, FontWeight.Medium] + @State fontWeightModeStr: string[] = ['Lighter', 'Normal', 'Regular', 'Medium'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontWeight(this.fontWeightMode[this.fontWeightIndex]) + .margin({ top: 20 }) + + Row() { + Button('更改fontWeight:' + this.fontWeightModeStr[this.fontWeightIndex]).onClick(() => { + this.fontWeightIndex++ + if (this.fontWeightIndex > (this.fontWeightModeStr.length - 1)) { + this.fontWeightIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten011.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten011.ets new file mode 100644 index 000000000..b898cbc6f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten011.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten011 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontStyle(FontStyle.Italic) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten012.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten012.ets new file mode 100644 index 000000000..adf6fd7c0 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten012.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten012 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontStyle(this.fontStyleMode[this.fontStyleIndex]) + .margin({ top: 20 }) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten013.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten013.ets new file mode 100644 index 000000000..af53fd49a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten013.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten013 { + @State baselineOffsetIndex: number = 0; + @State baselineOffsetMode: number[] = [0, -10, -20] + @State baselineOffsetModeStr: string[] = ['0', '-10', '-20'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .baselineOffset(this.baselineOffsetMode[this.baselineOffsetIndex]) + .margin({ top: 20 }) + + Row() { + Button('更改baselineOffset:' + this.baselineOffsetModeStr[this.baselineOffsetIndex]).onClick(() => { + this.baselineOffsetIndex++ + if (this.baselineOffsetIndex > (this.baselineOffsetModeStr.length - 1)) { + this.baselineOffsetIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten014.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten014.ets new file mode 100644 index 000000000..8a0125704 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten014.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten014 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + .padding(10) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten015.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten015.ets new file mode 100644 index 000000000..d567896b9 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten015.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten015 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + .padding(20) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten016.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten016.ets new file mode 100644 index 000000000..8675055cd --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten016.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten016 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten017.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten017.ets new file mode 100644 index 000000000..0604b2d36 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten017.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten017 { + @State message: string = '这是一段测试文字\n这是一段测试文字\n这是一段测试文字\n这是一段测试文字\n这是一段测试文字\n' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten018.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten018.ets new file mode 100644 index 000000000..0c55a81d3 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten018.ets @@ -0,0 +1,111 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten018 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + @State message: string = '这是一段测试文字\n这是一段测试文字\n这是一段测试文字\n这是一段测试文字\n这是一段测试文字\n' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }]) + .margin({ top: 20 }) + .fontStyle(this.fontStyleMode[this.fontStyleIndex]) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten019.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten019.ets new file mode 100644 index 000000000..695e4bb86 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten019.ets @@ -0,0 +1,92 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten019 { + @State radiusIndex: number = 0; + @State radiusMode: number[] = [0, 10, 20] + @State radiusModeStr: string[] = ['0', '10', '20'] + + @State colorIndex: number = 0; + @State colorMode: Color[] = [Color.White, Color.Black, Color.Blue, Color.Brown] + @State colorModeStr: string[] = ['White', 'Black', 'Blue', 'Brown'] + + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [-20, -15, -10, -5] + @State offsetXModeStr: string[] = ['-20', '-15', '-10', '-5'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [-20, -15, -10, -5] + @State offsetYModeStr: string[] = ['-20', '-15', '-10', '-5'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow({ radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }) + .margin({ top: 20 }) + + Row() { + Button('更改color:' + this.colorModeStr[this.colorIndex]).onClick(() => { + this.colorIndex++ + if (this.colorIndex > (this.colorModeStr.length - 1)) { + this.colorIndex = 0 + } + }) + } + + Row() { + Button('更改radius:' + this.radiusModeStr[this.radiusIndex]).onClick(() => { + this.radiusIndex++ + if (this.radiusIndex > (this.radiusModeStr.length - 1)) { + this.radiusIndex = 0 + } + }) + } + + Row() { + Button('更改offsetX:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsetY:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten020.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten020.ets new file mode 100644 index 000000000..816e34f6b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten020.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten020 { + @State offsetIndex: number = 0; + @State offsetMode: number[] = [20, 15, 10, 5] + @State offsetModeStr: string[] = ['20', '15', '10', '5'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + .baselineOffset(this.offsetMode[this.offsetIndex]) + + Row() { + Button('更改baselineOffset:' + this.offsetModeStr[this.offsetIndex]).onClick(() => { + this.offsetIndex++ + if (this.offsetIndex > (this.offsetModeStr.length - 1)) { + this.offsetIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten021.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten021.ets new file mode 100644 index 000000000..53fe5a27a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten021.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten021 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontStyle(FontStyle.Normal) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten022.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten022.ets new file mode 100644 index 000000000..7a5e643ae --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten022.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten022 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontStyle(FontStyle.Normal) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten023.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten023.ets new file mode 100644 index 000000000..892374cde --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten023.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten023 { + @State message: string = '这是一段测试文字' + + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + + build() { + Row() { + Column() { + Text("test string", { controller: this.controller1 }) + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.NONE) + + Text("test string", { controller: this.controller2 }) + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.NONE) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten024.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten024.ets new file mode 100644 index 000000000..f75dcde95 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten024.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten024 { + @State message: string = '这是一段测试文字' + + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + + build() { + Row() { + Column() { + Text("test string", { controller: this.controller1 }) + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.SRC_IN) + + Text("test string", { controller: this.controller2 }) + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.SRC_IN) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten025.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten025.ets new file mode 100644 index 000000000..1aed3d95c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten025.ets @@ -0,0 +1,46 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextBrighten025 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + mutableStyledString2: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + controller2: TextController = new TextController(); + + build() { + Row() { + Column() { + Text("test string") + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.DST_IN) + + Text("test string") + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.DST_IN) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten026.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten026.ets new file mode 100644 index 000000000..462ea93af --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten026.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten026 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .fontSize(30) + .textShadow([{radius: 10, color: Color.Red, offsetX: -10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten027.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten027.ets new file mode 100644 index 000000000..ecb5bda47 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten027.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten027 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .fontSize(30) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten028.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten028.ets new file mode 100644 index 000000000..0064c20ef --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten028.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten027 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .fontSize(30) + .textShadow([]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten029.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten029.ets new file mode 100644 index 000000000..2c4272d2b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten029.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten029 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .fontSize(10) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten030.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten030.ets new file mode 100644 index 000000000..20d70459b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten030.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten030 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .fontSize(30) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten031.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten031.ets new file mode 100644 index 000000000..ccc049769 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten031.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten031 { + @State fontSizeIndex: number = 0; + @State fontSizeMode: number[] = [10, 20, 30] + @State fontSizeModeStr: string[] = ['10', '20', '30'] + + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .fontSize(this.fontSizeMode[this.fontSizeIndex]) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + + Row() { + Button('更改fontSize:' + this.fontSizeModeStr[this.fontSizeIndex]).onClick(() => { + this.fontSizeIndex++ + if (this.fontSizeIndex > (this.fontSizeModeStr.length - 1)) { + this.fontSizeIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten032.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten032.ets new file mode 100644 index 000000000..3e8649856 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten032.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten032 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontWeight(FontWeight.Lighter) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten033.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten033.ets new file mode 100644 index 000000000..4b1eecdc4 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten033.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten033 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontWeight(FontWeight.Normal) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten034.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten034.ets new file mode 100644 index 000000000..a822f1dae --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten034.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten034 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontWeight(FontWeight.Bolder) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten035.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten035.ets new file mode 100644 index 000000000..ecaff4880 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten035.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten035 { + @State fontWeightIndex: number = 0; + @State fontWeightMode: FontWeight[] = [FontWeight.Lighter, FontWeight.Normal, FontWeight.Regular, FontWeight.Medium] + @State fontWeightModeStr: string[] = ['Lighter', 'Normal', 'Regular', 'Medium'] + + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontWeight(this.fontWeightMode[this.fontWeightIndex]) + + Row() { + Button('更改fontWeight:' + this.fontWeightModeStr[this.fontWeightIndex]).onClick(() => { + this.fontWeightIndex++ + if (this.fontWeightIndex > (this.fontWeightModeStr.length - 1)) { + this.fontWeightIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From 4f6c429066b3f995c1a595a6ee0b25365fe0ed4c Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:11:39 +0800 Subject: [PATCH 13/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextBrighten/UiTextBrighten036.ets | 46 +++++++++ .../UiTextBrighten/UiTextBrighten037.ets | 42 +++++++++ .../UiTextBrighten/UiTextBrighten038.ets | 55 +++++++++++ .../UiTextBrighten/UiTextBrighten039.ets | 44 +++++++++ .../UiTextBrighten/UiTextBrighten040.ets | 48 ++++++++++ .../UiTextBrighten/UiTextBrighten041.ets | 89 ++++++++++++++++++ .../UiTextBrighten/UiTextBrighten042.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten043.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten044.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten045.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten046.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten047.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten048.ets | 93 +++++++++++++++++++ .../UiTextBrighten/UiTextBrighten049.ets | 88 ++++++++++++++++++ .../UiTextBrighten/UiTextBrighten050.ets | 88 ++++++++++++++++++ .../UiTextBrighten/UiTextBrighten051.ets | 62 +++++++++++++ .../UiTextBrighten/UiTextBrighten052.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten053.ets | 41 ++++++++ .../UiTextBrighten/UiTextBrighten054.ets | 41 ++++++++ .../UiTextBrighten/UiTextBrighten055.ets | 41 ++++++++ .../UiTextBrighten/UiTextBrighten056.ets | 35 +++++++ 21 files changed, 1086 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten036.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten037.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten038.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten039.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten040.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten041.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten042.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten043.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten044.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten045.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten046.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten047.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten048.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten049.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten050.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten051.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten052.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten053.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten054.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten055.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten056.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten036.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten036.ets new file mode 100644 index 000000000..91b91c65f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten036.ets @@ -0,0 +1,46 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten036 { + @State fontWeightIndex: number = 0; + @State fontWeightMode: FontWeight[] = [FontWeight.Lighter, FontWeight.Normal, FontWeight.Regular, FontWeight.Medium] + @State fontWeightModeStr: string[] = ['Lighter', 'Normal', 'Regular', 'Medium'] + + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontStyle(FontStyle.Normal) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten037.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten037.ets new file mode 100644 index 000000000..8ddc622c3 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten037.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten037 { + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontStyle(FontStyle.Italic) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten038.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten038.ets new file mode 100644 index 000000000..741cf7487 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten038.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten038 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + @State accumulateTime: number = 0 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange((value: number) => { + this.accumulateTime = value + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .fontStyle(this.fontStyleMode[this.fontStyleIndex]) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten039.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten039.ets new file mode 100644 index 000000000..aae2e89cb --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten039.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten039 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange(() => { + if(this.SwitchNumber == 450){ + this.controller.start() + this.SwitchNumber = 500 + } + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten040.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten040.ets new file mode 100644 index 000000000..ca9bcbcc9 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten040.ets @@ -0,0 +1,48 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten040 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ timeZoneOffset: -8, controller: this.controller }) + .format('aa hh:mm:ss') + .onDateChange(() => { + if(this.SwitchNumber == 450){ + this.controller.start() + this.SwitchNumber = 500 + } + if(this.SwitchNumber == 500){ + this.controller.stop() + this.SwitchNumber = 600 + } + }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten041.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten041.ets new file mode 100644 index 000000000..2c9317078 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten041.ets @@ -0,0 +1,89 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten041 { + @State radiusIndex: number = 0; + @State radiusMode: number[] = [10, 20, 30] + @State radiusModeStr: string[] = ['10', '20', '30'] + + @State colorIndex: number = 0; + @State colorMode: Color[] = [Color.White, Color.Black, Color.Blue] + @State colorModeStr: string[] = ['White', 'Black', 'Blue'] + + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [10, 20, 30] + @State offsetXModeStr: string[] = ['10', '20', '30'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [10, 20, 30] + @State offsetYModeStr: string[] = ['10', '20', '30'] + + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .margin(20) + .textShadow([{ radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex]}]) + + Row() { + Button('更改radius:' + this.radiusModeStr[this.radiusIndex]).onClick(() => { + this.radiusIndex++ + if (this.radiusIndex > (this.radiusModeStr.length - 1)) { + this.radiusIndex = 0 + } + }) + } + + Row() { + Button('更改offsetX:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsetY:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + + Row() { + Button('更改color:' + this.colorModeStr[this.colorIndex]).onClick(() => { + this.colorIndex++ + if (this.colorIndex > (this.colorModeStr.length - 1)) { + this.colorIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten042.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten042.ets new file mode 100644 index 000000000..f10416ccc --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten042.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten042 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("yyyy年M月d日 EEEE") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten043.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten043.ets new file mode 100644 index 000000000..f7ffd5561 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten043.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten043 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("MM/dd/yyyy") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten044.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten044.ets new file mode 100644 index 000000000..684b01ab1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten044.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten044 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("yyyy-M-d") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten045.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten045.ets new file mode 100644 index 000000000..1e4029164 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten045.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten045 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("yyyy.M.d") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten046.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten046.ets new file mode 100644 index 000000000..6af3c040e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten046.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten046 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("HH:mm:ss") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten047.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten047.ets new file mode 100644 index 000000000..92f72906f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten047.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten047 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("hh:mm:ss") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten048.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten048.ets new file mode 100644 index 000000000..fb42f4ff5 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten048.ets @@ -0,0 +1,93 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten048 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .onDateChange(() => { + if(this.SwitchNumber == 450){ + this.controller.start() + this.SwitchNumber = 500 + } + }) + .format("hh:mm:ss") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 },]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten049.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten049.ets new file mode 100644 index 000000000..2e95b0dec --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten049.ets @@ -0,0 +1,88 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten049 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("hh:mm:ss") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 },]) + .padding(10) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten050.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten050.ets new file mode 100644 index 000000000..465278c75 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten050.ets @@ -0,0 +1,88 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten050 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .format("hh:mm:ss") + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 },]) + .padding(20) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten051.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten051.ets new file mode 100644 index 000000000..20b12c5c0 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten051.ets @@ -0,0 +1,62 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten051 { + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [10, 20, 30] + @State offsetXModeStr: string[] = ['10', '20', '30'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [10, 20, 30] + @State offsetYModeStr: string[] = ['10', '20', '30'] + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .offset({ x: this.offsetXMode[this.offsetXIndex], y: this.offsetYMode[this.offsetYIndex] }) + + Row() { + Button('更改offsetx:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsety:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten052.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten052.ets new file mode 100644 index 000000000..9c06dccb2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten052.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten052 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .margin(20) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten053.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten053.ets new file mode 100644 index 000000000..760b24a63 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten053.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten053 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.NONE) + + TextClock({ controller: this.controller }) + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.NONE) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten054.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten054.ets new file mode 100644 index 000000000..a59e9d213 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten054.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten054 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.SRC_IN) + + TextClock({ controller: this.controller }) + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.SRC_IN) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten055.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten055.ets new file mode 100644 index 000000000..394fc099f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten055.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten055 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextClock({ controller: this.controller }) + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.DST_IN) + + TextClock({ controller: this.controller }) + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.DST_IN) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten056.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten056.ets new file mode 100644 index 000000000..b9b5249e2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten056.ets @@ -0,0 +1,35 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten056 { + textTimerController: TextTimerController = new TextTimerController() + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(50) + .textShadow({radius: 10, color: Color.Red, offsetX: -10, offsetY: -10 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From 20a013b3bff4879cf095344e2d5b85946af72297 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:14:31 +0800 Subject: [PATCH 14/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextBrighten/UiTextBrighten057.ets | 38 ++++++++ .../UiTextBrighten/UiTextBrighten058.ets | 35 +++++++ .../UiTextBrighten/UiTextBrighten059.ets | 92 +++++++++++++++++++ .../UiTextBrighten/UiTextBrighten060.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten061.ets | 39 ++++++++ .../UiTextBrighten/UiTextBrighten062.ets | 49 ++++++++++ .../UiTextBrighten/UiTextBrighten063.ets | 40 ++++++++ .../UiTextBrighten/UiTextBrighten064.ets | 40 ++++++++ .../UiTextBrighten/UiTextBrighten065.ets | 40 ++++++++ .../UiTextBrighten/UiTextBrighten066.ets | 50 ++++++++++ .../UiTextBrighten/UiTextBrighten067.ets | 40 ++++++++ .../UiTextBrighten/UiTextBrighten068.ets | 40 ++++++++ .../UiTextBrighten/UiTextBrighten069.ets | 50 ++++++++++ .../UiTextBrighten/UiTextBrighten070.ets | 46 ++++++++++ .../UiTextBrighten/UiTextBrighten071.ets | 49 ++++++++++ 15 files changed, 687 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten057.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten058.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten060.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten061.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten062.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten063.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten064.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten065.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten066.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten067.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten068.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten069.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten070.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten071.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten057.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten057.ets new file mode 100644 index 000000000..ea83c16b6 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten057.ets @@ -0,0 +1,38 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten057 { + textTimerController: TextTimerController = new TextTimerController() + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(50) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten058.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten058.ets new file mode 100644 index 000000000..d5060cb2e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten058.ets @@ -0,0 +1,35 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten058 { + textTimerController: TextTimerController = new TextTimerController() + + controller: TextClockController = new TextClockController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(50) + .textShadow([]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets new file mode 100644 index 000000000..d9c17d7a3 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets @@ -0,0 +1,92 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten059 { + @State format: string = 'mm:ss.SS' + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ isCountDown: true, count: 30000, controller: this.textTimerController }) + .format(this.format) + .fontColor(Color.Black) + .fontSize(50) + .onTimer((utc: number, elapsedTime: number) => { + console.info('textTimer notCountDown utc is:' + utc + ', elapsedTime: ' + elapsedTime) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 },]) + + Button("start").onClick(() => { + this.textTimerController.start() + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten060.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten060.ets new file mode 100644 index 000000000..d333b4ec2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten060.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten060 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(10) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten061.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten061.ets new file mode 100644 index 000000000..fa918517e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten061.ets @@ -0,0 +1,39 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten061 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten062.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten062.ets new file mode 100644 index 000000000..8724180dc --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten062.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten062 { + @State fontSizeIndex: number = 0; + @State fontSizeMode: number[] = [10, 20, 30] + @State fontSizeModeStr: string[] = ['10', '20', '30'] + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(this.fontSizeMode[this.fontSizeIndex]) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + + Row() { + Button('更改fontSize:' + this.fontSizeModeStr[this.fontSizeIndex]).onClick(() => { + this.fontSizeIndex++ + if (this.fontSizeIndex > (this.fontSizeModeStr.length - 1)) { + this.fontSizeIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten063.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten063.ets new file mode 100644 index 000000000..ca9e6940b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten063.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten063 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .fontWeight(FontWeight.Lighter) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten064.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten064.ets new file mode 100644 index 000000000..938ea6cc1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten064.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten064 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .fontWeight(FontWeight.Normal) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten065.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten065.ets new file mode 100644 index 000000000..2f8e54389 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten065.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten065 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .fontWeight(FontWeight.Bolder) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten066.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten066.ets new file mode 100644 index 000000000..3e26da3f9 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten066.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten066 { + @State fontWeightIndex: number = 0; + @State fontWeightMode: FontWeight[] = [FontWeight.Lighter, FontWeight.Normal, FontWeight.Regular] + @State fontWeightModeStr: string[] = ['Lighter', 'Normal', 'Regular'] + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .fontWeight(this.fontWeightMode[this.fontWeightIndex]) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + + Row() { + Button('更改fontSize:' + this.fontWeightModeStr[this.fontWeightIndex]).onClick(() => { + this.fontWeightIndex++ + if (this.fontWeightIndex > (this.fontWeightModeStr.length - 1)) { + this.fontWeightIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten067.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten067.ets new file mode 100644 index 000000000..f1e1d042b --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten067.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten067 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .fontStyle(FontStyle.Normal) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten068.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten068.ets new file mode 100644 index 000000000..1fd13a93e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten068.ets @@ -0,0 +1,40 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten068 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten069.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten069.ets new file mode 100644 index 000000000..1f0a5c034 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten069.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten069 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .fontColor(Color.Black) + .fontSize(30) + .fontStyle(this.fontStyleMode[this.fontStyleIndex]) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten070.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten070.ets new file mode 100644 index 000000000..a7ac18f02 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten070.ets @@ -0,0 +1,46 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten070 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + + Row(){ + Button("start").onClick(() => { + this.textTimerController.start() + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten071.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten071.ets new file mode 100644 index 000000000..c135270e6 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten071.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten071 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + + Button("start").onClick(() => { + this.textTimerController.start() + }) + + Button("pause").onClick(() => { + this.textTimerController.pause() + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From a6e080fd04fd90ba3d5772eaaf13526137be1878 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:18:37 +0800 Subject: [PATCH 15/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextBrighten/UiTextBrighten072.ets | 49 ++++++++ .../UiTextBrighten/UiTextBrighten073.ets | 89 +++++++++++++++ .../UiTextBrighten/UiTextBrighten074.ets | 41 +++++++ .../UiTextBrighten/UiTextBrighten075.ets | 41 +++++++ .../UiTextBrighten/UiTextBrighten076.ets | 41 +++++++ .../UiTextBrighten/UiTextBrighten077.ets | 68 +++++++++++ .../UiTextBrighten/UiTextBrighten078.ets | 42 +++++++ .../UiTextBrighten/UiTextBrighten079.ets | 41 +++++++ .../UiTextBrighten/UiTextBrighten080.ets | 41 +++++++ .../UiTextBrighten/UiTextBrighten081.ets | 41 +++++++ .../UiTextBrighten/UiTextBrighten082.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten083.ets | 47 ++++++++ .../UiTextBrighten/UiTextBrighten084.ets | 44 +++++++ .../UiTextBrighten/UiTextBrighten085.ets | 107 ++++++++++++++++++ .../UiTextBrighten/UiTextBrighten086.ets | 47 ++++++++ .../UiTextBrighten/UiTextBrighten087.ets | 47 ++++++++ .../UiTextBrighten/UiTextBrighten088.ets | 69 +++++++++++ .../UiTextBrighten/UiTextBrighten089.ets | 47 ++++++++ .../UiTextBrighten/UiTextBrighten090.ets | 47 ++++++++ 19 files changed, 993 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten072.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten073.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten074.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten075.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten076.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten077.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten078.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten079.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten080.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten081.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten082.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten083.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten084.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten085.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten086.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten087.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten088.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten089.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten090.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten072.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten072.ets new file mode 100644 index 000000000..212c73955 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten072.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten072 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + + Button("start").onClick(() => { + this.textTimerController.start() + }) + + Button("reset").onClick(() => { + this.textTimerController.reset() + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten073.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten073.ets new file mode 100644 index 000000000..3e7917fc9 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten073.ets @@ -0,0 +1,89 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten073 { + @State radiusIndex: number = 0; + @State radiusMode: number[] = [10, 20, 30] + @State radiusModeStr: string[] = ['10', '20', '30'] + + @State colorIndex: number = 0; + @State colorMode: Color[] = [Color.White, Color.Black, Color.Blue] + @State colorModeStr: string[] = ['White', 'Black', 'Blue'] + + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [10, 20, 30] + @State offsetXModeStr: string[] = ['10', '20', '30'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [10, 20, 30] + @State offsetYModeStr: string[] = ['10', '20', '30'] + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex]}]) + + Row() { + Button('更改radius:' + this.radiusModeStr[this.radiusIndex]).onClick(() => { + this.radiusIndex++ + if (this.radiusIndex > (this.radiusModeStr.length - 1)) { + this.radiusIndex = 0 + } + }) + } + + Row() { + Button('更改offsetX:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsetY:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + + Row() { + Button('更改color:' + this.colorModeStr[this.colorIndex]).onClick(() => { + this.colorIndex++ + if (this.colorIndex > (this.colorModeStr.length - 1)) { + this.colorIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten074.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten074.ets new file mode 100644 index 000000000..51a9205cd --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten074.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten074 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .format("HH:mm:ss.SS") + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten075.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten075.ets new file mode 100644 index 000000000..10cbefbc1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten075.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten075 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .padding(10) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten076.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten076.ets new file mode 100644 index 000000000..054ce22ba --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten076.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten076 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .padding(20) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten077.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten077.ets new file mode 100644 index 000000000..19d953286 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten077.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten077 { + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [10, 20, 30] + @State offsetXModeStr: string[] = ['10', '20', '30'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [10, 20, 30] + @State offsetYModeStr: string[] = ['10', '20', '30'] + + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .padding(20) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .offset({ x: this.offsetXMode[this.offsetXIndex], y: this.offsetYMode[this.offsetYIndex] }) + + Row() { + Button('更改offsetx:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsety:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten078.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten078.ets new file mode 100644 index 000000000..7e5975f1a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten078.ets @@ -0,0 +1,42 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten078 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer({ controller: this.textTimerController }) + .fontColor(Color.Black) + .fontSize(30) + .padding(20) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten079.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten079.ets new file mode 100644 index 000000000..c4c46f325 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten079.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten079 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.NONE) + + TextTimer() + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.NONE) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten080.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten080.ets new file mode 100644 index 000000000..87794bc05 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten080.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten080 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.SRC_IN) + + TextTimer() + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.SRC_IN) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten081.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten081.ets new file mode 100644 index 000000000..2bffa765e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten081.ets @@ -0,0 +1,41 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten081 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + textTimerController: TextTimerController = new TextTimerController() + + build() { + Row() { + Column() { + TextTimer() + .backgroundColor(Color.Green) + .fontColor(Color.Red) + .blendMode(BlendMode.DST_IN) + + TextTimer() + .backgroundColor(Color.Yellow) + .fontColor(Color.Red) + .blendMode(BlendMode.DST_IN) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten082.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten082.ets new file mode 100644 index 000000000..dd1fd9e0c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten082.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten082 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontSize: 30, + textShadow: {radius: 10, color: Color.Red, offsetX: -10, offsetY: -10 } + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten083.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten083.ets new file mode 100644 index 000000000..9bb0ffe0c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten083.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten083 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontSize: 30, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten084.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten084.ets new file mode 100644 index 000000000..045e27166 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten084.ets @@ -0,0 +1,44 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten084 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontSize: 30, + textShadow: [] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten085.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten085.ets new file mode 100644 index 000000000..cbeb9672a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten085.ets @@ -0,0 +1,107 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten085 { + @State SwitchNumber: number = 450 + + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: this.fontStyleMode[this.fontStyleIndex], + fontSize: 30, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }] + } + }) + }) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten086.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten086.ets new file mode 100644 index 000000000..90e19006a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten086.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten086 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontSize: 10, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten087.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten087.ets new file mode 100644 index 000000000..7c63ec271 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten087.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten087 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontSize: 30, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten088.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten088.ets new file mode 100644 index 000000000..bdda911f0 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten088.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten088 { + @State SwitchNumber: number = 450 + + @State fontSizeIndex: number = 0; + @State fontSizeMode: number[] = [10, 20, 30] + @State fontSizeModeStr: string[] = ['10', '20', '30'] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontSize: this.fontSizeMode[this.fontSizeIndex], + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + + Row() { + Button('更改fontSize:' + this.fontSizeModeStr[this.fontSizeIndex]).onClick(() => { + this.fontSizeIndex++ + if (this.fontSizeIndex > (this.fontSizeModeStr.length - 1)) { + this.fontSizeIndex = 0 + } + }) + + Button("UpdateSpanStyle fontSize").onClick(() => { + this.controller.updateSpanStyle({ start: -1, end: -1, + textStyle: { + fontColor: Color.Brown, + fontSize: this.fontSizeMode[this.fontSizeIndex] + } + }) + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten089.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten089.ets new file mode 100644 index 000000000..bb4130624 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten089.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten089 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontWeight: FontWeight.Lighter, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten090.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten090.ets new file mode 100644 index 000000000..bb87fd079 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten090.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten090 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontWeight: FontWeight.Normal, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From 581838f27faacee6ae29f84c4ac6080a3f6b2c86 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:19:01 +0800 Subject: [PATCH 16/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextBrighten/UiTextBrighten091.ets | 47 +++++++++++++ .../UiTextBrighten/UiTextBrighten092.ets | 67 +++++++++++++++++++ .../UiTextBrighten/UiTextBrighten093.ets | 45 +++++++++++++ .../UiTextBrighten/UiTextBrighten094.ets | 45 +++++++++++++ .../UiTextBrighten/UiTextBrighten095.ets | 67 +++++++++++++++++++ .../UiTextBrighten/UiTextBrighten096.ets | 63 +++++++++++++++++ .../UiTextBrighten/UiTextBrighten097.ets | 67 +++++++++++++++++++ .../UiTextBrighten/UiTextBrighten098.ets | 52 ++++++++++++++ .../UiTextBrighten/UiTextBrighten099.ets | 50 ++++++++++++++ .../UiTextBrighten/UiTextBrighten100.ets | 50 ++++++++++++++ 10 files changed, 553 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten091.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten092.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten093.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten094.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten095.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten096.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten097.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten098.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten099.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten100.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten091.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten091.ets new file mode 100644 index 000000000..8a08f79dc --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten091.ets @@ -0,0 +1,47 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten091 { + @State SwitchNumber: number = 450 + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontWeight: FontWeight.Bolder, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten092.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten092.ets new file mode 100644 index 000000000..4608d374c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten092.ets @@ -0,0 +1,67 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten092 { + @State FontWeightIndex: number = 0; + @State FontWeightMode: FontWeight[] = [FontWeight.Lighter, FontWeight.Normal, FontWeight.Regular] + @State FontWeightModeStr: string[] = ['Lighter', 'Normal', 'Regular'] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontWeight: this.FontWeightMode[this.FontWeightIndex], + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + + Row() { + Button('更改FontWeight:' + this.FontWeightModeStr[this.FontWeightIndex]).onClick(() => { + this.FontWeightIndex++ + if (this.FontWeightIndex > (this.FontWeightModeStr.length - 1)) { + this.FontWeightIndex = 0 + } + }) + + Button("UpdateSpanStyle FontWeight").onClick(() => { + this.controller.updateSpanStyle({ start: -1, end: -1, + textStyle: { + fontColor: Color.Brown, + fontSize: this.FontWeightMode[this.FontWeightIndex] + } + }) + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten093.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten093.ets new file mode 100644 index 000000000..9f5e85686 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten093.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten093 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Normal, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten094.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten094.ets new file mode 100644 index 000000000..7ac533946 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten094.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten094 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten095.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten095.ets new file mode 100644 index 000000000..027e0054c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten095.ets @@ -0,0 +1,67 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten095 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: this.fontStyleMode[this.fontStyleIndex], + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + + Button("UpdateSpanStyle fontStyle").onClick(() => { + this.controller.updateSpanStyle({ start: -1, end: -1, + textStyle: { + fontColor: Color.Brown, + fontSize: this.fontStyleMode[this.fontStyleIndex] + } + }) + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten096.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten096.ets new file mode 100644 index 000000000..8150250eb --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten096.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import font from '@ohos.font' + +@Entry +@Component +struct UiTextBrighten096 { + @State message: string = 'Hello World' + + @State unicode: string = '\u0000' + @State codePoint: string = String.fromCharCode(0x0000) + + aboutToAppear() { + font.registerFont({ + familyName: 'iconFont', + familySrc: '/font/iconFont.ttf' + }) + + font.registerFont({ + familyName: 'medium', + familySrc: '/font/medium.ttf' + }) + } + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontFamily: "iconFont", + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten097.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten097.ets new file mode 100644 index 000000000..d49b21652 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten097.ets @@ -0,0 +1,67 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten097 { + @State stringIndex: number = 0; + @State stringMode: string[] = ["test string", "这是测试文字"] + @State stringModeStr: string[] = ['test string', '这是测试文字'] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan(this.stringMode[this.stringIndex], + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + } + }) + }) + + Row() { + Button('更改string:' + this.stringModeStr[this.stringIndex]).onClick(() => { + this.stringIndex++ + if (this.stringIndex > (this.stringModeStr.length - 1)) { + this.stringIndex = 0 + } + }) + + Button("UpdateSpanStyle string").onClick(() => { + this.controller.updateSpanStyle({ start: -1, end: -1, + textStyle: { + fontColor: Color.Brown, + fontSize: this.stringMode[this.stringIndex] + } + }) + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten098.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten098.ets new file mode 100644 index 000000000..c7279ee01 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten098.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextBrighten098 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }] + } + }) + + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 },] + } + }) + }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten099.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten099.ets new file mode 100644 index 000000000..5fd7aecad --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten099.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten099 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .width("80%") + .height("30%") + .border({ width: 1, radius: 5 }) + .draggable(false) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten100.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten100.ets new file mode 100644 index 000000000..1a7d10b43 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten100.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten100 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Center, + } + }) + }) + .width("80%") + .height("30%") + .border({ width: 1, radius: 5 }) + .draggable(false) + } + } + } +} \ No newline at end of file -- Gitee From 064f4a3c988f796585fcd58057458afd3a70b0a0 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:21:18 +0800 Subject: [PATCH 17/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../UiTextBrighten/UiTextBrighten101.ets | 50 ++++++++++ .../UiTextBrighten/UiTextBrighten102.ets | 78 +++++++++++++++ .../UiTextBrighten/UiTextBrighten103.ets | 67 +++++++++++++ .../UiTextBrighten/UiTextBrighten104.ets | 64 +++++++++++++ .../UiTextBrighten/UiTextBrighten105.ets | 94 +++++++++++++++++++ .../UiTextBrighten/UiTextBrighten106.ets | 49 ++++++++++ .../UiTextBrighten/UiTextBrighten107.ets | 49 ++++++++++ .../UiTextBrighten/UiTextBrighten108.ets | 76 +++++++++++++++ .../UiTextBrighten/UiTextBrighten109.ets | 50 ++++++++++ .../UiTextBrighten/UiTextBrighten110.ets | 82 ++++++++++++++++ .../UiTextBrighten/UiTextBrighten111.ets | 75 +++++++++++++++ .../UiTextBrighten/UiTextBrighten112.ets | 75 +++++++++++++++ 12 files changed, 809 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten101.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten102.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten103.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten104.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten105.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten106.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten107.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten108.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten109.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten110.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten111.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten112.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten101.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten101.ets new file mode 100644 index 000000000..3a140a6e5 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten101.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten101 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.End, + } + }) + }) + .width("80%") + .height("30%") + .border({ width: 1, radius: 5 }) + .draggable(false) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten102.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten102.ets new file mode 100644 index 000000000..4a9099c2f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten102.ets @@ -0,0 +1,78 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten102 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .width("80%") + .height("30%") + .border({ width: 1, radius: 5 }) + .draggable(false) + + Column({ space: 5 }) { + Button("段落左对齐").onClick(() => { + this.controller.updateParagraphStyle({ start: -1, end: -1, + style: { + textAlign: TextAlign.Start, + } + }) + }) + + Button("段落右对齐").onClick(() => { + this.controller.updateParagraphStyle({ start: -1, end: -1, + style: { + textAlign: TextAlign.End, + } + }) + }) + + Button("段落居中").onClick(() => { + this.controller.updateParagraphStyle({ start: -1, end: -1, + style: { + textAlign: TextAlign.Center, + } + }) + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten103.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten103.ets new file mode 100644 index 000000000..b178687cf --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten103.ets @@ -0,0 +1,67 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten103 { + @State textIndex: number = 0; + @State textMode: string[] = [" ", "\n"] + @State textModeStr: string[] = ['空行', '换行'] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string" + this.textMode[this.textIndex], + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.End, + } + }) + }) + + Row() { + Button('更改text:' + this.textModeStr[this.textIndex]).onClick(() => { + if(this.textIndex == 0){ + this.controller.addTextSpan(this.textMode[this.textIndex]) + this.textIndex++ + }else{ + this.controller.addTextSpan(this.textMode[this.textIndex]) + this.textIndex++ + } + if (this.textIndex > (this.textModeStr.length - 1)) { + this.textIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten104.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten104.ets new file mode 100644 index 000000000..b6be896f2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten104.ets @@ -0,0 +1,64 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten104 { + @State textShadows : (ShadowOptions | Array ) = + [{ radius: 10, color: Color.Red, offsetX: 10, offsetY: 0 },{ radius: 10, color: Color.Black, offsetX: 20, offsetY: 0 }, + { radius: 10, color: Color.Brown, offsetX: 30, offsetY: 0 },{ radius: 10, color: Color.Green, offsetX: 40, offsetY: 0 }, + { radius: 10, color: Color.Yellow, offsetX: 100, offsetY: 0 }] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.End, + } + }) + }) + + Row() { + Button("更新样式: 加粗 & 文本阴影").onClick(() => { + this.controller.updateSpanStyle({ + textStyle: + { + textShadow: this.textShadows + } + }) + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten105.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten105.ets new file mode 100644 index 000000000..f9f7b74c1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten105.ets @@ -0,0 +1,94 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten105 { + @State listPosition: number = 0; + private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor(0X330000FF) + .fontSize(16) + .textAlign(TextAlign.Center) + .onClick(() => { + this.scrollerForList.scrollToIndex(5) + }) + + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.End, + } + }) + }) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.None) + .friction(0.6) + .onReachStart(() => { + this.listPosition = 0 + }) + .onReachEnd(() => { + this.listPosition = 2 + }) + .onScrollFrameBegin((offset: number) => { + if ((this.listPosition == 0 && offset <= 0) || (this.listPosition == 2 && offset >= 0)) { + this.scrollerForScroll.scrollBy(0, offset) + return { offsetRemain: 0 } + } + this.listPosition = 1 + return { offsetRemain: offset }; + }) + + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor(0X330000FF) + .fontSize(16) + .textAlign(TextAlign.Center) + } + } + .width("100%").height("100%") + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten106.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten106.ets new file mode 100644 index 000000000..afeb980b2 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten106.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten106 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .padding(10) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten107.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten107.ets new file mode 100644 index 000000000..06dffa5d3 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten107.ets @@ -0,0 +1,49 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten107 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .padding(20) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten108.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten108.ets new file mode 100644 index 000000000..e5c1b933c --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten108.ets @@ -0,0 +1,76 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten108 { + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [10, 20, 30] + @State offsetXModeStr: string[] = ['10', '20', '30'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [10, 20, 30] + @State offsetYModeStr: string[] = ['10', '20', '30'] + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .padding(20) + .offset({ x: this.offsetXMode[this.offsetXIndex], y: this.offsetYMode[this.offsetYIndex] }) + + Row() { + Button('更改offsetx:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsety:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten109.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten109.ets new file mode 100644 index 000000000..8599f063f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten109.ets @@ -0,0 +1,50 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten109 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Orange, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .padding(20) + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten110.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten110.ets new file mode 100644 index 000000000..a0f68d675 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten110.ets @@ -0,0 +1,82 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten110 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + controller2: RichEditorController = new RichEditorController(); + options2: RichEditorOptions = { controller: this.controller2 } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string1", + { + style: + { + fontColor: Color.Red, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .width("80%") + .height("30%") + .border({ width: 1, radius: 5 }) + .draggable(false) + .backgroundColor(Color.Green) + .blendMode(BlendMode.NONE) + + RichEditor(this.options2) + .onReady(() => { + this.controller2.addTextSpan("test string2", + { + style: + { + fontColor: Color.Red, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Center, + } + }) + }) + .width("80%") + .height("30%") + .border({ width: 1, radius: 5 }) + .draggable(false) + .backgroundColor(Color.Yellow) + .blendMode(BlendMode.NONE) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten111.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten111.ets new file mode 100644 index 000000000..07bda9f30 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten111.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten111 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + controller2: RichEditorController = new RichEditorController(); + options2: RichEditorOptions = { controller: this.controller2 } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Red, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .padding(20) + .backgroundColor(Color.Green) + .blendMode(BlendMode.SRC_IN) + + RichEditor(this.options2) + .onReady(() => { + this.controller2.addTextSpan("test string", + { + style: + { + fontColor: Color.Red, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .backgroundColor(Color.Yellow) + .blendMode(BlendMode.SRC_IN) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten112.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten112.ets new file mode 100644 index 000000000..81394273e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten112.ets @@ -0,0 +1,75 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextBrighten112 { + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + controller2: RichEditorController = new RichEditorController(); + options2: RichEditorOptions = { controller: this.controller2 } + + build() { + Row() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan("test string", + { + style: + { + fontColor: Color.Red, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .padding(20) + .backgroundColor(Color.Green) + .blendMode(BlendMode.DST_IN) + + RichEditor(this.options2) + .onReady(() => { + this.controller2.addTextSpan("test string", + { + style: + { + fontColor: Color.Red, + fontStyle: FontStyle.Italic, + textShadow: [{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }] + }, + paragraphStyle: { + textAlign: TextAlign.Start, + } + }) + }) + .backgroundColor(Color.Yellow) + .blendMode(BlendMode.DST_IN) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From d1431441099621e9177ed27703a6ce4731f75526 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:23:52 +0800 Subject: [PATCH 18/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../pages/UiTextShadow/UiTextShadow001.ets | 40 +++++++ .../pages/UiTextShadow/UiTextShadow002.ets | 43 +++++++ .../pages/UiTextShadow/UiTextShadow003.ets | 40 +++++++ .../pages/UiTextShadow/UiTextShadow004.ets | 43 +++++++ .../pages/UiTextShadow/UiTextShadow005.ets | 43 +++++++ .../pages/UiTextShadow/UiTextShadow006.ets | 56 +++++++++ .../pages/UiTextShadow/UiTextShadow007.ets | 44 +++++++ .../pages/UiTextShadow/UiTextShadow008.ets | 44 +++++++ .../pages/UiTextShadow/UiTextShadow009.ets | 44 +++++++ .../pages/UiTextShadow/UiTextShadow010.ets | 57 +++++++++ .../pages/UiTextShadow/UiTextShadow011.ets | 44 +++++++ .../pages/UiTextShadow/UiTextShadow012.ets | 44 +++++++ .../pages/UiTextShadow/UiTextShadow013.ets | 57 +++++++++ .../pages/UiTextShadow/UiTextShadow014.ets | 57 +++++++++ .../pages/UiTextShadow/UiTextShadow015.ets | 44 +++++++ .../pages/UiTextShadow/UiTextShadow016.ets | 44 +++++++ .../pages/UiTextShadow/UiTextShadow017.ets | 43 +++++++ .../pages/UiTextShadow/UiTextShadow018.ets | 43 +++++++ .../pages/UiTextShadow/UiTextShadow019.ets | 111 ++++++++++++++++++ .../pages/UiTextShadow/UiTextShadow020.ets | 94 +++++++++++++++ .../pages/UiTextShadow/UiTextShadow021.ets | 72 ++++++++++++ .../pages/UiTextShadow/UiTextShadow022.ets | 46 ++++++++ 22 files changed, 1153 insertions(+) create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow001.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow002.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow003.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow004.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow005.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow006.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow007.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow008.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow009.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow010.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow011.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow012.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow013.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow014.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow015.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow016.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow017.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow018.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow019.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow020.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow021.ets create mode 100644 function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow022.ets diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow001.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow001.ets new file mode 100644 index 000000000..8f7c823ec --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow001.ets @@ -0,0 +1,40 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow001 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow({radius: 10, color: Color.Red, offsetX: -10, offsetY: -10 }) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow002.ets new file mode 100644 index 000000000..8078da260 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow002.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow002 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow003.ets new file mode 100644 index 000000000..1f9059df1 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow003.ets @@ -0,0 +1,40 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow003 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow004.ets new file mode 100644 index 000000000..7eb91432d --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow004.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextShadow004 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({ fontColor: Color.Blue })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(10) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow005.ets new file mode 100644 index 000000000..a3d8c30ca --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow005.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Entry +@Component +struct UiTextShadow005 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({ fontColor: Color.Blue })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(30) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow006.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow006.ets new file mode 100644 index 000000000..c32df3a8a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow006.ets @@ -0,0 +1,56 @@ +/* + * 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. + */ + +@Entry +@Component +struct UiTextShadow006 { + @State fontSizeIndex: number = 0; + @State fontSizeMode: number[] = [10, 20, 30] + @State fontSizeModeStr: string[] = ['10', '20', '30'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({ fontColor: Color.Blue })}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontSize(this.fontSizeMode[this.fontSizeIndex]) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + + Row() { + Button('更改fontSize:' + this.fontSizeModeStr[this.fontSizeIndex]).onClick(() => { + this.fontSizeIndex++ + if (this.fontSizeIndex > (this.fontSizeModeStr.length - 1)) { + this.fontSizeIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow007.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow007.ets new file mode 100644 index 000000000..27746550f --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow007.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow007 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontWeight(FontWeight.Lighter) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow008.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow008.ets new file mode 100644 index 000000000..6775c30b6 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow008.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow008 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontWeight(FontWeight.Normal) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow009.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow009.ets new file mode 100644 index 000000000..1775c9243 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow009.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow009 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontWeight(FontWeight.Bolder) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow010.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow010.ets new file mode 100644 index 000000000..b81f7ebf6 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow010.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow010 { + @State fontWeightIndex: number = 0; + @State fontWeightMode: FontWeight[] = [FontWeight.Lighter, FontWeight.Normal, FontWeight.Regular] + @State fontWeightModeStr: string[] = ['Lighter', 'Normal', 'Regular'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontWeight(this.fontWeightMode[this.fontWeightIndex]) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + + Row() { + Button('更改fontWeight:' + this.fontWeightModeStr[this.fontWeightIndex]).onClick(() => { + this.fontWeightIndex++ + if (this.fontWeightIndex > (this.fontWeightModeStr.length - 1)) { + this.fontWeightIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow011.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow011.ets new file mode 100644 index 000000000..546b89091 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow011.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow011 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontStyle(FontStyle.Normal) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow012.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow012.ets new file mode 100644 index 000000000..f59caf875 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow012.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow012 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontStyle(FontStyle.Italic) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow013.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow013.ets new file mode 100644 index 000000000..23712b6cd --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow013.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow013 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .fontStyle(this.fontStyleMode[this.fontStyleIndex]) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow014.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow014.ets new file mode 100644 index 000000000..b1d09ba6e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow014.ets @@ -0,0 +1,57 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow014 { + @State baselineOffsetIndex: number = 0; + @State baselineOffsetMode: number[] = [0, -10, -20] + @State baselineOffsetModeStr: string[] = ['0', '-10', '-20'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .baselineOffset(this.baselineOffsetMode[this.baselineOffsetIndex]) + .margin({ top: 20 }) + + Row() { + Button('更改baselineOffset:' + this.baselineOffsetModeStr[this.baselineOffsetIndex]).onClick(() => { + this.baselineOffsetIndex++ + if (this.baselineOffsetIndex > (this.baselineOffsetModeStr.length - 1)) { + this.baselineOffsetIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow015.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow015.ets new file mode 100644 index 000000000..150df239e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow015.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow015 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .padding(10) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow016.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow016.ets new file mode 100644 index 000000000..10c63d3d6 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow016.ets @@ -0,0 +1,44 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow016 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .padding(20) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow017.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow017.ets new file mode 100644 index 000000000..c0b0f6fe9 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow017.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow017 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow018.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow018.ets new file mode 100644 index 000000000..94c0f8c2e --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow018.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow018 { + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字\n这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .margin({ top: 20 }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow019.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow019.ets new file mode 100644 index 000000000..45eca017a --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow019.ets @@ -0,0 +1,111 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow019 { + @State fontStyleIndex: number = 0; + @State fontStyleMode: FontStyle[] = [FontStyle.Normal, FontStyle.Italic] + @State fontStyleModeStr: string[] = ['Normal', 'Italic'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字\n这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }, + { radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }]) + .fontStyle(this.fontStyleMode[this.fontStyleIndex]) + .margin({ top: 20 }) + + Row() { + Button('更改fontStyle:' + this.fontStyleModeStr[this.fontStyleIndex]).onClick(() => { + this.fontStyleIndex++ + if (this.fontStyleIndex > (this.fontStyleModeStr.length - 1)) { + this.fontStyleIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow020.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow020.ets new file mode 100644 index 000000000..3081587bb --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow020.ets @@ -0,0 +1,94 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow020 { + @State radiusIndex: number = 0; + @State radiusMode: number[] = [10, 20, 30] + @State radiusModeStr: string[] = ['10', '20', '30'] + + @State colorIndex: number = 0; + @State colorMode: Color[] = [Color.White, Color.Black, Color.Blue] + @State colorModeStr: string[] = ['White', 'Black', 'Blue'] + + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [10, 20, 30] + @State offsetXModeStr: string[] = ['10', '20', '30'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [10, 20, 30] + @State offsetYModeStr: string[] = ['10', '20', '30'] + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字\n这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex] }, + { radius: this.radiusMode[this.radiusIndex], color: this.colorMode[this.colorIndex], offsetX: this.offsetXMode[this.offsetXIndex], offsetY: this.offsetYMode[this.offsetYIndex]}]) + .margin({ top: 20 }) + Row() { + Button('更改radius:' + this.radiusModeStr[this.radiusIndex]).onClick(() => { + this.radiusIndex++ + if (this.radiusIndex > (this.radiusModeStr.length - 1)) { + this.radiusIndex = 0 + } + }) + } + + Row() { + Button('更改offsetX:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsetY:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + + Row() { + Button('更改color:' + this.colorModeStr[this.colorIndex]).onClick(() => { + this.colorIndex++ + if (this.colorIndex > (this.colorModeStr.length - 1)) { + this.colorIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow021.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow021.ets new file mode 100644 index 000000000..08dc98f01 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow021.ets @@ -0,0 +1,72 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow021 { + @State offsetXIndex: number = 0; + @State offsetXMode: number[] = [10, 20, 30] + @State offsetXModeStr: string[] = ['10', '20', '30'] + + @State offsetYIndex: number = 0; + @State offsetYMode: number[] = [10, 20, 30] + @State offsetYModeStr: string[] = ['10', '20', '30'] + + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字\n这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .offset({ x: this.offsetXMode[this.offsetXIndex], y: this.offsetYMode[this.offsetYIndex] }) + + Row() { + Button('更改offsetx:' + this.offsetXModeStr[this.offsetXIndex]).onClick(() => { + this.offsetXIndex++ + if (this.offsetXIndex > (this.offsetXModeStr.length - 1)) { + this.offsetXIndex = 0 + } + }) + } + + Row() { + Button('更改offsety:' + this.offsetYModeStr[this.offsetYIndex]).onClick(() => { + this.offsetYIndex++ + if (this.offsetYIndex > (this.offsetYModeStr.length - 1)) { + this.offsetYIndex = 0 + } + }) + } + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow022.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow022.ets new file mode 100644 index 000000000..725415d11 --- /dev/null +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextShadow/UiTextShadow022.ets @@ -0,0 +1,46 @@ +/* + * 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 { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; + +@Entry +@Component +struct UiTextShadow022 { + @State accumulateTime: number = 0 + @State SwitchNumber: number = 450 + + @State message: string = '这是一段测试文字' + mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字\n这是一段测试文字", + [{start:0, length:8, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontSize:new LengthMetrics(40, LengthUnit.PX)})}]); + + controller1: TextController = new TextController(); + + build() { + Row() { + Column() { + Text(undefined, { controller: this.controller1 }) + .onAreaChange(() => { + this.controller1.setStyledString(this.mutableStyledString1) + }) + .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, + { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, + { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, + { radius: 10, color: Color.Black, offsetX: 10, offsetY: -10 }]) + .motionPath({ path: 'Mstart.x start.y L300 200 L300 500 Lend.x end.y', from: 0.0, to: 1.0, rotatable: true }) + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file -- Gitee From 11d4f5cf453ae72270f5ac3f51d68e588d7aec99 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:48:02 +0800 Subject: [PATCH 19/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingStyle001.test.ets | 2 -- 1 file changed, 2 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets index a0dec8b91..adc1fe9f8 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingStyleTest/ComponentAttributeStringModifyingStyle001.test.ets @@ -59,8 +59,6 @@ export default function ComponentAttributeStringModifyingStyle001() { * @tc.name STRING_MODIFYING_STYLE * @tc.desc Replace the specified range style to obtain the string style * @tc.level Level 3 - * @tc.type - * @tc.size */ it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0020', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_STYLE_0020 start.`); -- Gitee From 02988c1f7119a55b496e470db227034545352af2 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:49:01 +0800 Subject: [PATCH 20/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingText001.test.ets | 2 -- 1 file changed, 2 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets index 499cc0adb..0737584ab 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentAttributeStringModifyingTextTest/ComponentAttributeStringModifyingText001.test.ets @@ -139,8 +139,6 @@ export default function ComponentAttributeStringModifyingText001() { * @tc.name STRING_MODIFYING_STYLE_TEXT * @tc.desc Insert a string to obtain its length and content * @tc.level Level 3 - * @tc.type - * @tc.size */ it('SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0130', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ATTRIBUTE_STRING_MODIFYING_TEXT_0130 start.`); -- Gitee From a2f952c2746b1c782c7abb7c737bda6eda04c3ce Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:49:26 +0800 Subject: [PATCH 21/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentLayoutCommonPixelTest001.test.ets | 4 ---- 1 file changed, 4 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets index 5e1488870..0e12a457e 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentLayoutCommonPixelTest/ComponentLayoutCommonPixelTest001.test.ets @@ -187,8 +187,6 @@ export default function ComponentLayoutCommonPixelTest001() { * @tc.name LAYOUT_COMMON_PIXEL * @tc.desc Add a SwinerItem subcomponent with floating-point width and height values at index=2 position, and check if there are pixel gaps in the layout * @tc.level Level 3 - * @tc.type - * @tc.size */ it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0830', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_0830 start.`); @@ -317,8 +315,6 @@ export default function ComponentLayoutCommonPixelTest001() { * @tc.name LAYOUT_COMMON_PIXEL * @tc.desc Add a FlowItem subcomponent with floating-point width and height values at index=2 position, and check if there are pixel gaps in the layout * @tc.level Level 3 - * @tc.type - * @tc.size */ it('SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1060', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LAYOUT_COMMON_PIXEL_1060 start.`); -- Gitee From 9853fd6491b696d4fef3d6749e0bb85c6f3fc4d3 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:50:13 +0800 Subject: [PATCH 22/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentTextAttributeStringTest001.test.ets | 2 -- 1 file changed, 2 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets index 0866954ef..f38d8d59f 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/ComponentTextAttributeStringTest/ComponentTextAttributeStringTest001.test.ets @@ -155,8 +155,6 @@ export default function ComponentTextAttributeStringTest001() { * @tc.name STRING * @tc.desc Attribute string setting font width, fontWeight (1000) * @tc.level Level 3 - * @tc.type - * @tc.size */ it('SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0080', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_TEXT_ATTRIBUTE_STRING_0080 start.`); -- Gitee From 370146e34451fb0a9d730e8701efc4738f9f2868 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:51:08 +0800 Subject: [PATCH 23/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets | 2 -- 1 file changed, 2 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets index 0f4d7cd6e..d1349c499 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/test/UiTextShadowTest/UiTextShadowTest001.test.ets @@ -59,8 +59,6 @@ export default function UiTextShadowTest001() { * @tc.name TEXT-SHADOW * @tc.desc Text component, set multi-layer shadows * @tc.level Level 3 - * @tc.type - * @tc.size */ it('SUB_ACE_UI_TEXTSHADOW_0020', 0, async (done: Function) => { Logger.info('TEST', `SUB_ACE_UI_TEXTSHADOW_0020 start.`); -- Gitee From 4ea703e8d3f2855482d952940bd323808ef93440 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Tue, 13 Aug 2024 14:55:13 +0800 Subject: [PATCH 24/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets | 3 --- 1 file changed, 3 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets index d9c17d7a3..aebe38b1c 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/UiTextBrighten/UiTextBrighten059.ets @@ -26,9 +26,6 @@ struct UiTextBrighten059 { .format(this.format) .fontColor(Color.Black) .fontSize(50) - .onTimer((utc: number, elapsedTime: number) => { - console.info('textTimer notCountDown utc is:' + utc + ', elapsedTime: ' + elapsedTime) - }) .textShadow([{ radius: 0, color: Color.Red, offsetX: -10, offsetY: -10 }, { radius: 3, color: Color.Blue, offsetX: 10, offsetY: 10 }, { radius: 8, color: Color.Green, offsetX: -10, offsetY: 10 }, -- Gitee From f1707a49c067290d89602c165dff3ed50f19e6f6 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:05:35 +0800 Subject: [PATCH 25/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...ntAttributeStringModifyingStyleText005.ets | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets index ad7431f27..fb8d73d9f 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText005.ets @@ -18,6 +18,9 @@ @Component struct ComponentAttributeStringModifyingStyleText005 { @State message: string = '这是一段测试文字' + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " + @State messageStyledStringKey: string = "mutableStyledString1 StyledStringKey " @State TestSwitch: number = 450; mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); @@ -34,15 +37,25 @@ struct ComponentAttributeStringModifyingStyleText005 { this.controller1.setStyledString(this.mutableStyledString1) this.mutableStyledString1.appendStyledString(new StyledString('文本输入', [{styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) - console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) - console.info("mutableStyledString1 length", this.mutableStyledString1.length) - console.info("mutableStyledString1 StyledStringKey", this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)) + let attachment1 = this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[0].styledValue as TextStyle + let attachment2 = this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[1].styledValue as TextStyle + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length + this.messageStyledStringKey = this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[0].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[0].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[0].styledKey + "\n" + + "styledValue " + attachment1.fontColor + "\n" + this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[1].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[1].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,12,StyledStringKey.FONT)[1].styledKey + "\n" + + "styledValue " + attachment2.fontColor this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) + Text(this.messageStyledStringKey).fontSize(10) } .width('100%') .height('100%') -- Gitee From 66065c586873f7bad902228fef7e4d1736dfa0bf Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:06:20 +0800 Subject: [PATCH 26/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...ponentAttributeStringModifyingStyle002.ets | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets index e9931f12e..a7ace705a 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle002.ets @@ -18,6 +18,10 @@ @Component struct ComponentAttributeStringModifyingStyle002 { @State message: string = '这是一段测试文字' + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " + @State messageStyledStringKey: string = "mutableStyledString1 StyledStringKey " + @State TestSwitch: number = 450; mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); @@ -28,26 +32,37 @@ struct ComponentAttributeStringModifyingStyle002 { Row() { Column() { Text(undefined, { controller: this.controller1 }) - .key('mutableStyledString002') .onAreaChange(() => { - this.controller1.setStyledString(this.mutableStyledString1) - - this.mutableStyledString1.replaceStyle({ - start:2, - length:4, - styledKey:StyledStringKey.FONT, - styledValue: new TextStyle({fontColor:Color.Green}) - }) - - let styles = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT) - - for (let i = 0; i < styles.length; i++) { - console.info('test {' + styles[i].start + ',' + styles[i].length + ',' + 'styledKey:StyledStringKey.FONT' + styles[i].styledKey + '}') + if(this.TestSwitch == 450){ + this.mutableStyledString1.replaceStyle({ + start:2, + length:4, + styledKey:StyledStringKey.FONT, + styledValue: new TextStyle({fontColor:Color.Green}) + }) + this.controller1.setStyledString(this.mutableStyledString1) + let attachment1 = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].styledValue as TextStyle + let attachment2 = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].styledValue as TextStyle + let attachment3 = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].styledValue as TextStyle + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length + this.messageStyledStringKey = this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].styledKey + "\n" + + "styledValue " + attachment1.fontColor + "\n" + this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].styledKey + "\n" + + "styledValue " + attachment2.fontColor + "\n" + this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].styledKey + "\n" + + "styledValue " + attachment3.fontColor + this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) + Text(this.messageStyledStringKey).fontSize(10) } .width('100%') .height('100%') -- Gitee From 9a49bbb706321f57d195d73621992312d51d4392 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:09:36 +0800 Subject: [PATCH 27/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingText009.ets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets index 021e9672c..4be50dee1 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText009.ets @@ -19,6 +19,8 @@ struct ComponentAttributeStringModifyingText009 { @State message: string = '这是一段测试文字' @State TestSwitch: number = 450; + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); @@ -34,12 +36,17 @@ struct ComponentAttributeStringModifyingText009 { this.mutableStyledString1.removeString(0,2) console.info("mutableStyledString1 content:", this.mutableStyledString1.getString()); console.info("mutableStyledString1 length:", this.mutableStyledString1.length); + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) } .width('100%') .height('100%') -- Gitee From 1d9188e43f456918b31bf04133bd5dda57c68437 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:12:00 +0800 Subject: [PATCH 28/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingStyleText004.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets index 88cc90bfa..2f3cc6a78 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText004.ets @@ -19,6 +19,7 @@ struct ComponentAttributeStringModifyingStyleText004 { @State message: string = '这是一段测试文字' @State TestSwitch: number = 450; + @State messageContent: string = "mutableStyledString1 content " mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); @@ -34,6 +35,7 @@ struct ComponentAttributeStringModifyingStyleText004 { this.mutableStyledString1.appendStyledString(new StyledString('文本输入', [{styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) + this.messageContent += this.mutableStyledString1.getString() this.controller1.setStyledString(this.mutableStyledString1) this.TestSwitch = 500 } @@ -41,6 +43,8 @@ struct ComponentAttributeStringModifyingStyleText004 { .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) } .width('100%') .height('100%') -- Gitee From 102761a4d051d96b71ac5d4d425668d4fc26b2d8 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:17:45 +0800 Subject: [PATCH 29/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...ntAttributeStringModifyingStyleText002.ets | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets index 149d21444..e31c1bc22 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyleText/ComponentAttributeStringModifyingStyleText002.ets @@ -19,6 +19,9 @@ struct ComponentAttributeStringModifyingStyleText002 { @State message: string = '这是一段测试文字' @State TestSwitch: number = 450; + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " + @State messageStyledStringKey: string = "mutableStyledString1 StyledStringKey " mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); @@ -34,21 +37,29 @@ struct ComponentAttributeStringModifyingStyleText002 { if(this.TestSwitch == 450){ this.mutableStyledString1.replaceStyledString(2, 2, new StyledString('输入框', [{start:0,length:3,styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Green})}])) - console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) - console.info("mutableStyledString1 length", this.mutableStyledString1.length) - let fontArray = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT) - for (let i = 0; i < fontArray.length; i++) { - console.info('mutableStyledString1 style object start:' + fontArray[i].start) - console.info('mutableStyledString1 style object length:' + fontArray[i].length) - console.info('mutableStyledString1 style object key:' + fontArray[i].styledKey) - } this.controller1.setStyledString(this.mutableStyledString1) + let attachment1 = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].styledValue as TextStyle + let attachment2 = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].styledValue as TextStyle + let attachment3 = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].styledValue as TextStyle + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length + this.messageStyledStringKey = this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].styledKey + "\n" + + "styledValue " + attachment1.fontColor + "\n" + this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[1].styledKey + "\n" + + "styledValue " + attachment2.fontColor + "\n" + this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[2].styledKey + "\n" + + "styledValue " + attachment3.fontColor this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) + Text(this.messageStyledStringKey).fontSize(10) } .width('100%') .height('100%') -- Gitee From 5f7ab4be8c0ae18bdd09b5234266fa327ac35b4b Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:20:52 +0800 Subject: [PATCH 30/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingText010.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets index babd37574..a7d0bd496 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText010.ets @@ -19,6 +19,7 @@ struct ComponentAttributeStringModifyingText010 { @State message: string = '这是一段测试文字' @State TestSwitch: number = 450; + @State messageFontColor: string = "mutableStyledString1 fontColor " mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); @@ -34,12 +35,15 @@ struct ComponentAttributeStringModifyingText010 { let styles = this.mutableStyledString1.getStyles(0, this.mutableStyledString1.length) let fontAttr = styles[0].styledValue as TextStyle; console.info('mutableStyledString1 fontColor:' + fontAttr.fontColor) + this.messageFontColor += fontAttr.fontColor this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageFontColor).fontSize(10) } .width('100%') .height('100%') -- Gitee From 137266fbee6eee55246d719e2829002e4f780396 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:32:50 +0800 Subject: [PATCH 31/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- ...ponentAttributeStringModifyingStyle005.ets | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets index e65f1765a..d5b5f322c 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingStyle/ComponentAttributeStringModifyingStyle005.ets @@ -18,6 +18,10 @@ @Component struct ComponentAttributeStringModifyingStyle005 { @State message: string = '这是一段测试文字' + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " + @State messageStyledStringKey: string = "mutableStyledString1 StyledStringKey " + @State TestSwitch: number = 450; mutableStyledString1: MutableStyledString = new MutableStyledString("这是一段测试文字", [{start:0, length:4, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}, {start:4, length:4, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Red})}]); @@ -28,25 +32,23 @@ struct ComponentAttributeStringModifyingStyle005 { Row() { Column() { Text(undefined, { controller: this.controller1 }) - .key('mutableStyledString005') .onAreaChange(() => { - this.controller1.setStyledString(this.mutableStyledString1) - - this.mutableStyledString1.clearStyles() - - let styles = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT) - - for (let i = 0; i < styles.length; i++) { - if(styles[i].start == null){ - console.info("return null") - }else{ - console.info('test {' + styles[i].start + ',' + styles[i].length + ',' + 'styledKey:StyledStringKey.FONT' + styles[i].styledKey + '}') - } + if(this.TestSwitch == 450){ + this.mutableStyledString1.clearStyles() + this.controller1.setStyledString(this.mutableStyledString1) + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length + this.messageStyledStringKey += this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT) + this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) + Text(this.messageStyledStringKey).fontSize(10) } .width('100%') .height('100%') -- Gitee From 3a2581e4a1da000eb9037b2f3bd2a10afe7109b8 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:35:22 +0800 Subject: [PATCH 32/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingText003.ets | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets index 3813febaa..0e1be31be 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText003.ets @@ -18,6 +18,8 @@ @Component struct ComponentAttributeStringModifyingText003 { @State message: string = '这是一段测试文字' + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " @State TestSwitch: number = 450; mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); @@ -30,16 +32,21 @@ struct ComponentAttributeStringModifyingText003 { Text(undefined, { controller: this.controller1 }) .onAreaChange(() => { if(this.TestSwitch == 450){ - this.controller1.setStyledString(this.mutableStyledString1) this.mutableStyledString1.replaceString(0, 2, '已经替换') + this.controller1.setStyledString(this.mutableStyledString1) console.info("mutableStyledString1 content:", this.mutableStyledString1.getString()); console.info("mutableStyledString1 length:", this.mutableStyledString1.length); + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) } .width('100%') .height('100%') -- Gitee From c5e8d48ae77c2346928720e300263d5705a96006 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:37:22 +0800 Subject: [PATCH 33/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingText005.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets index e8f5840ac..816ebabd1 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText005.ets @@ -18,6 +18,7 @@ @Component struct ComponentAttributeStringModifyingText005 { @State message: string = '这是一段测试文字' + @State messageContent: string = "mutableStyledString1 content " @State TestSwitch: number = 450; mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); @@ -33,6 +34,7 @@ struct ComponentAttributeStringModifyingText005 { this.mutableStyledString1.insertString(1,' ') this.mutableStyledString1.insertString(4,'\n') console.info("mutableStyledString1 content", this.mutableStyledString1.getString()) + this.messageContent += this.mutableStyledString1.getString() this.controller1.setStyledString(this.mutableStyledString1) this.TestSwitch = 500 } @@ -40,6 +42,8 @@ struct ComponentAttributeStringModifyingText005 { .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) } .width('100%') .height('100%') -- Gitee From 07cf5c9cc52a67800c3d3c40a8fbb98914aca1b2 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:39:15 +0800 Subject: [PATCH 34/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentAttributeStringModifyingText007.ets | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets index 6b879c048..702d9ec00 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentAttributeStringModifyingText/ComponentAttributeStringModifyingText007.ets @@ -19,6 +19,8 @@ struct ComponentAttributeStringModifyingText007 { @State message: string = '这是一段测试文字' @State TestSwitch: number = 450; + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " mutableStyledString1: MutableStyledString = new MutableStyledString('这是一段测试文字', [{start:0, length:8, styledKey:StyledStringKey.FONT, styledValue: new TextStyle({fontColor:Color.Blue})}]); @@ -30,16 +32,21 @@ struct ComponentAttributeStringModifyingText007 { Text(undefined, { controller: this.controller1 }) .onAreaChange(() => { if(this.TestSwitch == 450){ - this.controller1.setStyledString(this.mutableStyledString1) this.mutableStyledString1.insertString(0,'输入框') + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length console.info("mutableStyledString1 content:", this.mutableStyledString1.getString()); console.info("mutableStyledString1 length:", this.mutableStyledString1.length); + this.controller1.setStyledString(this.mutableStyledString1) this.TestSwitch = 500 } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) } .width('100%') .height('100%') -- Gitee From 38e83693af1fcdfd735cc4eca794ea5e80a24449 Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:43:52 +0800 Subject: [PATCH 35/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentTextAttributeString015.ets | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets index 3ff310e55..4906f9d52 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString015.ets @@ -17,6 +17,10 @@ @Component struct ComponentTextAttributeString015 { @State message: string = '这是一段测试文字' + @State messageContent: string = "mutableStyledString1 content " + @State messageLength: string = "mutableStyledString1 length " + @State messageStyledStringKey: string = "mutableStyledString1 StyledStringKey " + @State TestSwitch: number = 450; mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", [{start:0, length:2, styledKey: StyledStringKey.FONT, styledValue: new TextStyle({fontFamily: 'custom'})}]); @@ -28,12 +32,25 @@ struct ComponentTextAttributeString015 { Text(undefined, { controller: this.controller1 }) .key('mutableStyledString8') .onAreaChange(() => { - this.controller1.setStyledString(this.mutableStyledString1) - console.info("mutableStyledString1 length",this.mutableStyledString1.getStyles(0, this.mutableStyledString1.length)) + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + console.info("mutableStyledString1 length",this.mutableStyledString1.getStyles(0, this.mutableStyledString1.length)) + let attachment1 = this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].styledValue as TextStyle + this.messageContent += this.mutableStyledString1.getString() + this.messageLength += this.mutableStyledString1.length + this.messageStyledStringKey = this.messageStyledStringKey + " start " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].start + "\n" + + "length " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].length + "\n" + "styledKey " + this.mutableStyledString1.getStyles(0,8,StyledStringKey.FONT)[0].styledKey + "\n" + + "styledValue " + attachment1.fontColor + "\n" + this.TestSwitch = 500 + } }) .fontSize(20) .fontColor(Color.Blue) .margin({ top: 20 }) + + Text(this.messageContent).fontSize(10) + Text(this.messageLength).fontSize(10) + Text(this.messageStyledStringKey).fontSize(10) } .width('100%') .height('100%') -- Gitee From d6e655bd3fd8bd26cad37330818d3d272de5a43f Mon Sep 17 00:00:00 2001 From: yuxiangxin Date: Wed, 14 Aug 2024 11:48:47 +0800 Subject: [PATCH 36/36] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuxiangxin --- .../ComponentTextAttributeString045.ets | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets index 4a712bfca..97125b0ec 100644 --- a/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets +++ b/function/ui_compare/uicompare/entry/src/ohosTest/ets/testability/pages/ComponentTextAttributeString/ComponentTextAttributeString045.ets @@ -18,6 +18,7 @@ import { LengthMetrics, LengthUnit } from '@ohos.arkui.node'; @Component struct ComponentTextAttributeString045 { @State message: string = '这是一段测试文字' + @State TestSwitch: number = 450; fontStyleAttr1: StyledStringValue = new TextStyle({ fontSize: new LengthMetrics(20), fontStyle: FontStyle.Italic, fontWeight:FontWeight.Bolder, fontColor: Color.Red ,}); mutableStyledString1: MutableStyledString = new MutableStyledString("这是属性字符串文本", [{start:2, length:7,styledKey:StyledStringKey.FONT,styledValue: this.fontStyleAttr1}, @@ -36,8 +37,10 @@ struct ComponentTextAttributeString045 { Text(undefined, { controller: this.controller1 }) .key('mutableStyledString8') .onAreaChange(() => { - this.controller1.setStyledString(this.mutableStyledString1) - console.info("mutableStyledString1 length" + this.mutableStyledString1.getStyles(0, this.mutableStyledString1.length)) + if(this.TestSwitch == 450){ + this.controller1.setStyledString(this.mutableStyledString1) + this.TestSwitch = 500 + } }) .fontSize(20) .margin({ top: 20 }) -- Gitee