diff --git a/AppScope/app.json5 b/AppScope/app.json5 index 31e70b74dd3579f5d13819c2594e3774a160a861..ccaeee9b911a4d913f44109886f24aa95b89aab3 100644 --- a/AppScope/app.json5 +++ b/AppScope/app.json5 @@ -1,9 +1,9 @@ { "app": { - "bundleName": "jp.wasabeef.example.recyclerview", + "bundleName": "cn.openharmony.recyclerview", "vendor": "example", "versionCode": 1000000, - "versionName": "1.1.0", + "versionName": "1.0.0", "icon": "$media:app_icon", "label": "$string:app_name", "distributedNotificationEnabled": true diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json index 3adf43f5c81bdbe0a92e2b5af9d31770570ca112..f35fd86ed8e7196bc94dc80a8e9072cc38b8b26f 100644 --- a/AppScope/resources/base/element/string.json +++ b/AppScope/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "app_name", - "value": "recyclerview" + "value": "RecyclerviewAnimators" } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b20ce531e8ef985c5331cfad9c7e3241f13a32b..e39066d0a455aa2db58f3b00c1c69e040d73f6d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.1.1 + +- 适配DevEco Studio 版本:3.1 Beta1(3.1.0.200),OpenHarmony SDK:API9(3.2.10.6) + ## v1.1.0 1. 名称由recyclerview-animators-ets修改recyclerview-animators。 diff --git a/OAT.xml b/OAT.xml index 29b566eaaf092e188ae115da2eb1cdfa7360aa16..dcc3ae95e54a272f4acb1f8edba1591aeb38d206 100644 --- a/OAT.xml +++ b/OAT.xml @@ -2,11 +2,37 @@ - - + + + + - - + + + + diff --git a/README.md b/README.md index c780f5e546fd1a0c4b657aba79beafa8548edab5..3926c211c23f0e0dce362106adb785018d141bb8 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ build() { 在下述版本验证通过: -DevEco Studio 版本:3.1 Beta1(3.1.0.200),SDK:API9 Beta5(3.2.10.6) +- DevEco Studio 版本:3.1 Beta1(3.1.0.200),OpenHarmony SDK:API9(3.2.10.6) ## 目录结构 ```` diff --git a/build-profile.json5 b/build-profile.json5 index bb53cf837fbc752d41a8cd54b7f23b63bff8535f..a2df217740562988b0ac0f206bcc817abde51002 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,15 +1,14 @@ { "app": { + "signingConfigs": [ + ], "compileSdkVersion": 9, "compatibleSdkVersion": 9, "products": [ { "name": "default", - "signingConfig": "default" + "signingConfig": "default", } - ], - "signingConfigs": [ - ] }, "modules": [ diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index 7dc37bb919dada5132609c409200db266559004f..f8f03407f77914b43168aeca6bb0929efd6700b4 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -4,7 +4,7 @@ }, "targets": [ { - "name": "default", + "name": "default" }, { "name": "ohosTest", diff --git a/hvigorfile.js b/entry/hvigorfile.ts similarity index 63% rename from hvigorfile.js rename to entry/hvigorfile.ts index 5f2735e3deeaf655828407544bbed9365c258278..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 100644 --- a/hvigorfile.js +++ b/entry/hvigorfile.ts @@ -1,2 +1,2 @@ // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').appTasks \ No newline at end of file +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/entry/package.json b/entry/package.json index 36bca6febfef3e2f0774cc20d0304dbc0b8a3234..616cf200963d62c8aa46a82c466c83b1039eedd8 100644 --- a/entry/package.json +++ b/entry/package.json @@ -1,16 +1,16 @@ { - "license":"Apache-2.0", - "devDependencies":{}, - "name":"entry", - "ohos":{ - "org":"huawei", - "directoryLevel":"module", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.1.0", - "dependencies":{ - "@ohos/recyclerview-animators":"file:../recyclerview_animators" - } -} \ No newline at end of file + "license": "Apache-2.0", + "devDependencies": {}, + "name": "entry", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.1.1", + "dependencies": { + "@ohos/recyclerview-animators": "file:../recyclerview_animators" + } +} diff --git a/entry/src/main/ets/Application/AbilityStage.ts b/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 47de1828c2acc7d43b81808415895a78c921ed4c..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/entry/src/main/ets/MainAbility/MainAbility.ts b/entry/src/main/ets/entryability/EntryAbility.ts similarity index 47% rename from entry/src/main/ets/MainAbility/MainAbility.ts rename to entry/src/main/ets/entryability/EntryAbility.ts index 606656a0b1fdf7d77239cfffb4953d2118406d91..06d557b869b511bba8bc8e3ec44eafceecc21f51 100644 --- a/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,37 +14,44 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; -export default class MainAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); } onDestroy() { - console.log("[Demo] MainAbility onDestroy") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); } - onWindowStageCreate(windowStage) { + onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/main", null) + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/main', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); } onWindowStageDestroy() { // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); } onForeground() { // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); } onBackground() { // Ability has back to background - console.log("[Demo] MainAbility onBackground") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } } diff --git a/entry/src/main/ets/pages/index_adapter_animator.ets b/entry/src/main/ets/pages/index_adapter_animator.ets index e66d21d1a46c140e241c6f59895fb38e065438e0..00ace17218626fcdb8d44afda307f994c728f8ee 100644 --- a/entry/src/main/ets/pages/index_adapter_animator.ets +++ b/entry/src/main/ets/pages/index_adapter_animator.ets @@ -57,11 +57,12 @@ struct Index_adapter_animator { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { Select(this.animTypes) .selected(this.selectIndex) + .value(this.animTypes[this.selectIndex].value) .font({ size: 18, weight: 400, family: 'serif', style: FontStyle.Normal }) .selectedOptionFont({ size: 18, weight: 500, family: 'serif', style: FontStyle.Normal }) .optionFont({ size: 18, weight: 400, family: 'serif', style: FontStyle.Normal }) - // @ts-ignore - .onSelected((index: number) => { + .backgroundColor('#3dc49d') + .onSelect((index: number) => { this.selectIndex = index this.controller.setAdapterAnimation(this.animTypes[index].enumType) }) diff --git a/entry/src/main/ets/pages/index_item_animator.ets b/entry/src/main/ets/pages/index_item_animator.ets index 676c261ec67c1be62477ea60b922e3efbcdd98eb..da3429967789d9d966e2eec447ad916a4606bbd5 100644 --- a/entry/src/main/ets/pages/index_item_animator.ets +++ b/entry/src/main/ets/pages/index_item_animator.ets @@ -15,7 +15,7 @@ */ import { RecyclerView } from "@ohos/recyclerview-animators" -import router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -59,7 +59,7 @@ struct Index_item_animator { RecyclerView({ array: this.listDatas, controller: this.controller, - columnsNum: router.getParams().isOn == true ? 2 : 1, + columnsNum: router.getParams()['isOn'] == true ? 2 : 1, // @ts-ignore child: (itemData) => { this.SpecificChild(itemData) @@ -71,11 +71,12 @@ struct Index_item_animator { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { Select(this.animTypes) .selected(this.selectIndex) + .value(this.animTypes[this.selectIndex].value) .font({ size: 18, weight: 400, family: 'serif', style: FontStyle.Normal }) .selectedOptionFont({ size: 18, weight: 500, family: 'serif', style: FontStyle.Normal }) .optionFont({ size: 18, weight: 400, family: 'serif', style: FontStyle.Normal }) - // @ts-ignore - .onSelected((index: number) => { + .backgroundColor('#3dc49d') + .onSelect((index: number) => { this.selectIndex = index this.controller.setItemAnimation(this.animTypes[index].enumType) }) diff --git a/entry/src/main/ets/pages/main.ets b/entry/src/main/ets/pages/main.ets index 7baeb3e6e8124440e04c9cc53daa3bafd23ca33e..6a13a0b67dfb8e4c900ee185e1dfbb2e2671c9ec 100644 --- a/entry/src/main/ets/pages/main.ets +++ b/entry/src/main/ets/pages/main.ets @@ -14,7 +14,7 @@ * limitations under the License. */ -import router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -28,8 +28,8 @@ struct Index { .backgroundColor('#d6d7d7') .fontColor('black') .onClick(e => { - router.push({ - uri: 'pages/index_item_animator', + router.pushUrl({ + url: 'pages/index_item_animator', params: { isOn: this.isOn } }) }) @@ -53,8 +53,8 @@ struct Index { .fontColor('black') .margin({left: 30}) .onClick(e => { - router.push({ - uri: 'pages/index_adapter_animator' + router.pushUrl({ + url: 'pages/index_adapter_animator' }) }) } diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index 35faec6f888650226cccc18c6b76c8140434e186..f6353470a13a33b01f3f042e937af5730f0cd611 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -2,9 +2,8 @@ "module": { "name": "entry", "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", + "description": "$string:module_desc", + "mainElement": "EntryAbility", "deviceTypes": [ "default", "tablet" @@ -12,13 +11,21 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "abilities": [ { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", + "name": "EntryAbility", + "srcEntrance": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", "icon": "$media:icon", - "label": "$string:MainAbility_label", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", "visible": true, "skills": [ { @@ -29,9 +36,7 @@ "action.system.home" ] } - ], - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:background_color" + ] } ] } diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json index 3fc805d64a74798b777b98fd8e4099d8d6ad0003..3c712962da3c2751c2b9ddb53559afcbd2b54a02 100644 --- a/entry/src/main/resources/base/element/color.json +++ b/entry/src/main/resources/base/element/color.json @@ -1,8 +1,8 @@ { "color": [ { - "name": "background_color", - "value": "#ffffff" + "name": "start_window_background", + "value": "#FFFFFF" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 490210a3908f47722dc942d49dacc98b97669a5f..4a6cdae73b46ad8d61b010424b3aa6ed13778489 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -1,16 +1,16 @@ { "string": [ { - "name": "entry_desc", - "value": "description" + "name": "module_desc", + "value": "module description" }, { - "name": "MainAbility_desc", + "name": "EntryAbility_desc", "value": "description" }, { - "name": "MainAbility_label", - "value": "label" + "name": "EntryAbility_label", + "value": "RecyclerviewAnimators" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..4a6cdae73b46ad8d61b010424b3aa6ed13778489 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "RecyclerviewAnimators" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..776829d8fab7ed4e71512c6b29ffe8e2efab0951 --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "RecyclerviewAnimators" + } + ] +} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/TestAbility/TestAbility.ts b/entry/src/ohosTest/ets/TestAbility/TestAbility.ets similarity index 40% rename from entry/src/ohosTest/ets/TestAbility/TestAbility.ts rename to entry/src/ohosTest/ets/TestAbility/TestAbility.ets index f7a2dd9338b36d53b9d64b0fbf4bbc78f47d1d5b..d79f7ecaa98ef16e5c3596f976e98e64eaea7580 100644 --- a/entry/src/ohosTest/ets/TestAbility/TestAbility.ts +++ b/entry/src/ohosTest/ets/TestAbility/TestAbility.ets @@ -14,42 +14,51 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; -export default class TestAbility extends Ability { +export default class TestAbility extends UIAbility { onCreate(want, launchParam) { - console.log('TestAbility onCreate') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); var abilityDelegator: any abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegatorArguments: any abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } onDestroy() { - console.log('TestAbility onDestroy') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); } - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.setUIContent(this.context, 'TestAbility/pages/index', null) - - globalThis.abilityContext = this.context; + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); } onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); } onForeground() { - console.log('TestAbility onForeground') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); } onBackground() { - console.log('TestAbility onBackground') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); } } \ No newline at end of file diff --git a/entry/src/ohosTest/ets/TestAbility/pages/index.ets b/entry/src/ohosTest/ets/TestAbility/pages/index.ets index 58e81268ce26f0567051ba5676af64b47693dcd1..b2b95b9007f7ac0df3b966b5b0d3800073825525 100644 --- a/entry/src/ohosTest/ets/TestAbility/pages/index.ets +++ b/entry/src/ohosTest/ets/TestAbility/pages/index.ets @@ -14,13 +14,13 @@ * limitations under the License. */ -import router from '@ohos.router'; +import hilog from '@ohos.hilog'; @Entry @Component struct Index { aboutToAppear() { - console.info('TestAbility index aboutToAppear') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); } @State message: string = 'Hello World' build() { diff --git a/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts index 97d7e3b735778deedf822972fc96088f7f7d3f79..c189137955c42f2fba75da4b772a20784c2f9cba 100644 --- a/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -14,32 +14,19 @@ * limitations under the License. */ -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; var abilityDelegator = undefined var abilityDelegatorArguments = undefined -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } export default class OpenHarmonyTestRunner implements TestRunner { @@ -47,11 +34,11 @@ export default class OpenHarmonyTestRunner implements TestRunner { } onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); } async onRun() { - console.log('OpenHarmonyTestRunner onRun run') + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' @@ -61,14 +48,18 @@ export default class OpenHarmonyTestRunner implements TestRunner { }; abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - console.info('cmd : '+cmd) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); abilityDelegator.executeShellCommand(cmd, (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); }) - console.info('OpenHarmonyTestRunner onRun end') + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/Ability.test.ets b/entry/src/ohosTest/ets/test/Ability.test.ets index b56e663da15e82ed6ace7626f62232de9b62b0d7..5c22875be2bfaca088c945ba3f61653c346782a6 100644 --- a/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/entry/src/ohosTest/ets/test/Ability.test.ets @@ -14,16 +14,38 @@ * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' export default function abilityTest() { - describe('ActsAbilityTest', function () { - it('assertContain',0, function () { - console.info("it begin") - let a = 'abc' - let b = 'b' - expect(a).assertContain(b) - expect(a).assertEqual(a) - }) + describe('ActsAbilityTest', function () { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(function () { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. }) + beforeEach(function () { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(function () { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(function () { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain',0, function () { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc' + let b = 'b' + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b) + expect(a).assertEqual(a) + }) + }) } \ No newline at end of file diff --git a/entry/src/ohosTest/module.json5 b/entry/src/ohosTest/module.json5 index d4d6e200a6ee51067910f642cece7e2412cbad3a..476d15376f43323426498a79fb3d58a658a27a56 100644 --- a/entry/src/ohosTest/module.json5 +++ b/entry/src/ohosTest/module.json5 @@ -2,8 +2,7 @@ "module": { "name": "entry_test", "type": "feature", - "srcEntrance": "./ets/TestAbility/TestAbility.ts", - "description": "$string:entry_test_desc", + "description": "$string:module_test_desc", "mainElement": "TestAbility", "deviceTypes": [ "default", @@ -15,11 +14,13 @@ "abilities": [ { "name": "TestAbility", - "srcEntrance": "./ets/TestAbility/TestAbility.ts", + "srcEntrance": "./ets/testability/TestAbility.ets", "description": "$string:TestAbility_desc", "icon": "$media:icon", "label": "$string:TestAbility_label", "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", "skills": [ { "actions": [ diff --git a/entry/src/ohosTest/resources/base/element/color.json b/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/string.json b/entry/src/ohosTest/resources/base/element/string.json index 8407800739f589b2e0620ae2cd1601f8a338721a..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c 100644 --- a/entry/src/ohosTest/resources/base/element/string.json +++ b/entry/src/ohosTest/resources/base/element/string.json @@ -1,16 +1,16 @@ { "string": [ { - "name": "entry_test_desc", - "value": "i am an entry for tv" + "name": "module_test_desc", + "value": "test ability description" }, { "name": "TestAbility_desc", - "value": "the tv entry test ability" + "value": "the test ability" }, { "name": "TestAbility_label", - "value": "tvBase" + "value": "test label" } ] } \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/profile/test_pages.json b/entry/src/ohosTest/resources/base/profile/test_pages.json index fcef82b4dfc18e28106ff9ecd1c8b48ec74d18a4..b7e7343cacb32ce982a45e76daad86e435e054fe 100644 --- a/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1,5 +1,5 @@ { "src": [ - "TestAbility/pages/index" + "testability/pages/Index" ] } diff --git a/entry/hvigorfile.js b/hvigorfile.ts similarity index 63% rename from entry/hvigorfile.js rename to hvigorfile.ts index d7720ee6a7aad5c617d1fd2f6fc8c87067bfa32c..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 100644 --- a/entry/hvigorfile.js +++ b/hvigorfile.ts @@ -1,2 +1,2 @@ // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/package.json b/package.json index 537cde7ba70b7e58765c29e5f38111c9e991f412..69058f81d39466dc50aa9a19d3985f025f0d2cb0 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,18 @@ { - "license": "Apache-2.0", - "devDependencies": {}, - "name": "recyclerview_animators", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.1.0", - "dependencies": { - "@ohos/hypium": "1.0.1", - "@ohos/hvigor-ohos-plugin": "1.1.6", - "hypium": "^1.0.0", - "@ohos/hvigor": "1.1.6" - } + "license": "Apache-2.0", + "devDependencies": {}, + "name": "recyclerview_animators", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.1.1", + "dependencies": { + "@ohos/hypium": "1.0.5", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } diff --git a/recyclerview_animators/build-profile.json5 b/recyclerview_animators/build-profile.json5 index 35dff6d53cb3a241f8de4fb68bd01d38ade0f108..79961f96a6fe0507354b7952a378c3be2ae4bfab 100644 --- a/recyclerview_animators/build-profile.json5 +++ b/recyclerview_animators/build-profile.json5 @@ -1,5 +1,10 @@ { "apiType": "stageMode", "buildOption": { - } + }, + "targets": [ + { + "name": "default" + } + ] } diff --git a/recyclerview_animators/hvigorfile.js b/recyclerview_animators/hvigorfile.ts similarity index 62% rename from recyclerview_animators/hvigorfile.js rename to recyclerview_animators/hvigorfile.ts index 42ed4b4a54a873e2b53441556aae93fab24b794f..47e6e1f81d365872f101585f5dbf816bcad65864 100644 --- a/recyclerview_animators/hvigorfile.js +++ b/recyclerview_animators/hvigorfile.ts @@ -1,3 +1,2 @@ // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').harTasks - +export { harTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/recyclerview_animators/package.json b/recyclerview_animators/package.json index 4b9f44d3be0959c5dfd2d21a33a86442ec6d3901..a55fd284681017df1984b5569cfcb802511795d3 100644 --- a/recyclerview_animators/package.json +++ b/recyclerview_animators/package.json @@ -1,23 +1,26 @@ { - "types":"", - "keywords":[ - "UI", - "Animation" - ], - "author":"hihope", - "description":"RecyclerView Animators is an Ohos library that allows developers to easily create RecyclerView with animations.", - "ohos":{ - "org":"opensource" - }, - "main":"index.ets", - "repository":"https://gitee.com/openharmony-sig/recyclerview-animators", - "version":"1.1.0", - "tags":[ - "UI", - "Animation" - ], - "dependencies":{}, - "license":"Apache-2.0", - "devDependencies":{}, - "name":"@ohos/recyclerview-animators" -} \ No newline at end of file + "types": "", + "keywords": [ + "UI", + "Animation", + "HarmonyOS" + ], + "author": "hihope", + "description": "RecyclerView Animators is an Ohos library that allows developers to easily create RecyclerView with animations.", + "ohos": { + "org": "opensource" + }, + "main": "index.ets", + "type": "module", + "repository": "https://gitee.com/openharmony-sig/recyclerview-animators", + "version": "1.1.1", + "tags": [ + "UI", + "Animation", + "HarmonyOS" + ], + "dependencies": {}, + "license": "Apache-2.0", + "devDependencies": {}, + "name": "@ohos/recyclerview-animators" +} diff --git a/recyclerview_animators/src/main/ets/components/RecyclerView.ets b/recyclerview_animators/src/main/ets/components/RecyclerView.ets index f22424f81daa9bda4234081aca4ba6a04708e373..64fe22abf717e87790a3e3ec31a68595da6ba35c 100644 --- a/recyclerview_animators/src/main/ets/components/RecyclerView.ets +++ b/recyclerview_animators/src/main/ets/components/RecyclerView.ets @@ -41,7 +41,7 @@ import {SlideInBottomAnimationAdapter} from './adapterAnimator/SlideInBottomAnim struct RecyclerView { array: Array = [] @BuilderParam child: (itemData) => {}; - controller: RecyclerView.Controller = new RecyclerView.Controller() + @State controller: RecyclerView.Controller = new RecyclerView.Controller() columnsNum: number = 1 build() { @@ -307,6 +307,8 @@ namespace RecyclerView { itemAnimation = RecyclerView.ItemAnimationType.FadeIn adapterAnimation = null isFirstOnly: boolean = false + mWidth: number = 480 + mHeight: number = 855 public addValue(index: number, value: any) { this.addValueCallback(index, value) @@ -331,6 +333,16 @@ namespace RecyclerView { public setFirstOnly(isFirstOnly: boolean) { this.isFirstOnly = isFirstOnly } + + public setWidth(width: number) { + this.mWidth = width + return this + } + + public setHeight(height: number) { + this.mHeight = height + return this + } } } diff --git a/recyclerview_animators/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets b/recyclerview_animators/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets index 40fe0e16da7504e86a83282ed5170a45fbfa794b..4f78f257964b853e8115575748ca5c1396be1004 100644 --- a/recyclerview_animators/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets +++ b/recyclerview_animators/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets @@ -22,6 +22,7 @@ export struct AlphaInAnimationAdapter { @BuilderParam child: (itemData) => {}; @State controller: RecyclerView.Controller = new RecyclerView.Controller() @State private list: Array = [] + @State private animateList: Array = [] @State private start: number = 0 @State private end: number = 0 @@ -32,6 +33,7 @@ export struct AlphaInAnimationAdapter { value: item } this.list.push(temp) + this.animateList.push(temp) }) } @@ -42,7 +44,7 @@ export struct AlphaInAnimationAdapter { this.child(item.value) } .width('100%') - .opacity(item.alpha) + .opacity(this.animateList[index].alpha) .animation({ duration: this.controller.duration, // 动画时长 curve: Curve.Ease, // 动画曲线 @@ -50,26 +52,26 @@ export struct AlphaInAnimationAdapter { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .width('100%') .onScrollIndex((start, end) => { this.start = start this.end = end - this.list.forEach((item, index) => { + this.animateList.forEach((item, index) => { if (index >= start && index <= end) { let temp = { alpha: 1, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } else { if (this.controller.isFirstOnly) { let temp = { alpha: 0, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } } }) diff --git a/recyclerview_animators/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets b/recyclerview_animators/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets index 4703abd5bc0ad2ba688ed12f2406a6adebc7ca76..c365eb00188360d2430ddcd8d13b4159011472cd 100644 --- a/recyclerview_animators/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets +++ b/recyclerview_animators/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets @@ -22,6 +22,7 @@ export struct ScaleInAnimationAdapter { @BuilderParam child: (itemData) => {}; @State controller: RecyclerView.Controller = new RecyclerView.Controller() @State private list: Array = [] + @State private animateList: Array = [] @State private start: number = 0 @State private end: number = 0 @@ -32,6 +33,7 @@ export struct ScaleInAnimationAdapter { value: item } this.list.push(temp) + this.animateList.push(temp) }) } @@ -44,9 +46,9 @@ export struct ScaleInAnimationAdapter { .width('100%') .scale( { - x: item.landing, - y: item.landing, - z: item.landing + x: this.animateList[index].landing, + y: this.animateList[index].landing, + z: this.animateList[index].landing } ) .animation({ @@ -56,26 +58,26 @@ export struct ScaleInAnimationAdapter { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .width('100%') .onScrollIndex((start, end) => { this.start = start this.end = end - this.list.forEach((item, index) => { + this.animateList.forEach((item, index) => { if (index >= start && index <= end) { let temp = { landing: 1, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } else { if (this.controller.isFirstOnly) { let temp = { landing: 0, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } } }) diff --git a/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets b/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets index 8797b3bc2fd356a591d12867db4ea5e820218652..5d734a106f9fbe6f54ac1f436157b96911dd3967 100644 --- a/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets +++ b/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets @@ -22,16 +22,18 @@ export struct SlideInBottomAnimationAdapter { @BuilderParam child: (itemData) => { }; @State controller: RecyclerView.Controller = new RecyclerView.Controller() @State private list: Array = [] + @State private animateList: Array = [] @State private start: number = 0 @State private end: number = 0 aboutToAppear() { this.array.forEach(item => { let temp = { - y: '100%', + y: this.controller.mHeight, value: item } this.list.push(temp) + this.animateList.push(temp) }) } @@ -43,7 +45,7 @@ export struct SlideInBottomAnimationAdapter { } .width('100%') .translate({ - y: item.y + y: this.animateList[index].y }) .animation({ duration: this.controller.duration, // 动画时长 @@ -52,26 +54,26 @@ export struct SlideInBottomAnimationAdapter { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .width('100%') .onScrollIndex((start, end) => { this.start = start this.end = end - this.list.forEach((item, index) => { + this.animateList.forEach((item, index) => { if (index >= start && index <= end) { let temp = { - y: '0%', + y: 0, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } else { if (this.controller.isFirstOnly) { let temp = { - y: '100%', + y: this.controller.mHeight, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } } }) diff --git a/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets b/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets index 9be62e41c7d5e1909933d6fa67ac61cbef8a4b4b..30ab61194959d8fab425695c2d371e24785a1699 100644 --- a/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets +++ b/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets @@ -22,16 +22,18 @@ export struct SlideInLeftAnimationAdapter { @BuilderParam child: (itemData) => { }; @State controller: RecyclerView.Controller = new RecyclerView.Controller() @State private list: Array = [] + @State private animateList: Array = [] @State private start: number = 0 @State private end: number = 0 aboutToAppear() { this.array.forEach(item => { let temp = { - x: '-100%', + x: -this.controller.mWidth, value: item } this.list.push(temp) + this.animateList.push(temp) }) } @@ -43,7 +45,7 @@ export struct SlideInLeftAnimationAdapter { } .width('100%') .translate({ - x: item.x + x: this.animateList[index].x }) .animation({ duration: this.controller.duration, // 动画时长 @@ -52,26 +54,26 @@ export struct SlideInLeftAnimationAdapter { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .width('100%') .onScrollIndex((start, end) => { this.start = start this.end = end - this.list.forEach((item, index) => { + this.animateList.forEach((item, index) => { if (index >= start && index <= end) { let temp = { - x: '0%', + x: 0, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } else { if (this.controller.isFirstOnly) { let temp = { - x: '-100%', + x: -this.controller.mWidth, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } } }) diff --git a/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets b/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets index eeeb20892ad43af93434b7bed54d54d5c3a62a4b..6adf3750371e93fd9b143efebb1b3b9bb80d6a6d 100644 --- a/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets +++ b/recyclerview_animators/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets @@ -22,16 +22,18 @@ export struct SlideInRightAnimationAdapter { @BuilderParam child: (itemData) => { }; @State controller: RecyclerView.Controller = new RecyclerView.Controller() @State private list: Array = [] + @State private animateList: Array = [] @State private start: number = 0 @State private end: number = 0 aboutToAppear() { this.array.forEach(item => { let temp = { - x: '100%', + x: this.controller.mWidth, value: item } this.list.push(temp) + this.animateList.push(temp) }) } @@ -43,7 +45,7 @@ export struct SlideInRightAnimationAdapter { } .width('100%') .translate({ - x: item.x + x: this.animateList[index].x }) .animation({ duration: this.controller.duration, // 动画时长 @@ -52,26 +54,26 @@ export struct SlideInRightAnimationAdapter { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .width('100%') .onScrollIndex((start, end) => { this.start = start this.end = end - this.list.forEach((item, index) => { + this.animateList.forEach((item, index) => { if (index >= start && index <= end) { let temp = { - x: '0%', + x: 0, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } else { if (this.controller.isFirstOnly) { let temp = { - x: '100%', + x: this.controller.mWidth, value: item.value } - this.list.splice(index, 1, temp) + this.animateList.splice(index, 1, temp) } } }) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInAnimator.ets index 7796c9fd70063f8609ee96a8d0107ba280fff231..269d96a3394ba1effa73f86b579351591586c4f1 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInAnimator.ets @@ -108,7 +108,7 @@ export struct FadeInAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets index 5d74d634b5e837b45fbf0650f58cdf8d0e59077f..e5234d9b6b8ca2534865c1b9c6ab1a6191869544 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets @@ -113,7 +113,7 @@ export struct FadeInDownAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets index b051613780f4a999cfb104ab16c1f4e16b2dc5a1..43287215cfd6eec5bfc6f93ad59a3b092621b37f 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets @@ -113,7 +113,7 @@ export struct FadeInLeftAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets index 12f6221f0ca16d9206470a165414aaab1116dd3f..db4fde6242d40a93eac7bfae83f38a9c1797a0b2 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets @@ -113,7 +113,7 @@ export struct FadeInRightAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets index b800b0fb92e8e23f2e137260d6afefaa04d566f1..c8bde955d8c17032c713b9e5cddb2323b9ffb51a 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets @@ -113,7 +113,7 @@ export struct FadeInUpAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/LandingAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/LandingAnimator.ets index 6f2f8cb01c707a04db78f58563bde230a8da0217..e4cbf946cc44d2b2ee9b1fb74ce20b526ec9a95e 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/LandingAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/LandingAnimator.ets @@ -126,7 +126,7 @@ export struct LandingAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets index 13a26bd31393544f3eb7ebec7985e761ca000f39..a2bae54b407afac5caeb6b36c083d1c0882c5747 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets @@ -129,7 +129,7 @@ export struct OvershootInLeftAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets index bb48bf9d7ebea6e6c30ce3506bdf0300a5011a4b..0a1a698be6a6f7ae29dec793868f8aafbcd76b75 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets @@ -130,7 +130,7 @@ export struct OvershootInRightAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInAnimator.ets index 0f9696b2d0b8f401530a668000253233859821fa..2c00457245504015bea1a8b611ee1c7bcd72d59b 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInAnimator.ets @@ -126,7 +126,7 @@ export struct ScaleInAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets index 67088e0ae4a13ac969fa07693c2caf00da37ffbd..10b83523eb7e587633a90b557e96ceb4aa46f868 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets @@ -128,7 +128,7 @@ export struct ScaleInBottomAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets index 54c42850ab772ef8833d7b337d4e74317afc04e6..14af4564bf5ad73cb7f445b3487b1a08696a9123 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets @@ -128,7 +128,7 @@ export struct ScaleInLeftAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets index cff9d0be3d46c28f907897c318a698f259971c4d..3f3212819095c65702cf9cffd03c3588139899c4 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets @@ -128,7 +128,7 @@ export struct ScaleInRightAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets index 91f3bba8fa5adfa5c5378c5495553863431a4f0e..023b07d9781220fdb6bdc1e28300d98c97ac4bdc 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets @@ -128,7 +128,7 @@ export struct ScaleInTopAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets index 0adb3197950ddc50546b84d2e4ac88038decfc3b..f37a605340bfddab607b4c56a61d88db131c035b 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets @@ -128,7 +128,7 @@ export struct SlideInDownAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets index d83ed0dea8fa490b993aa204b706ab3ec45c4089..31aa876a2eaacaa0788c13a0715b02a881de1d31 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets @@ -124,7 +124,7 @@ export struct SlideInLeftAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets index f63a98ce35ca548803e5d49029e9a217cf0e2c4a..6c44e0e2dcf05a74c5a3148e4cd823672e62ab08 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets @@ -124,7 +124,7 @@ export struct SlideInRightAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets index 665aa76595268647febde6698dcf354a3f3193d0..074eab8827b2154638271a6a8e47a632a1719859 100644 --- a/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets +++ b/recyclerview_animators/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets @@ -128,7 +128,7 @@ export struct SlideInUpAnimator { iterations: 1, // 播放次数 playMode: PlayMode.Normal // 动画模式 }) - }, item => item.toString()) + }) } .columnsTemplate(this.colNumStr) .columnsGap(2) diff --git a/recyclerview_animators/src/main/module.json5 b/recyclerview_animators/src/main/module.json5 index b5092a788bb50bc670bd697e11d1896bd4d65175..9cae898ea47689143db37dfe8c02b50174fa2f30 100644 --- a/recyclerview_animators/src/main/module.json5 +++ b/recyclerview_animators/src/main/module.json5 @@ -5,6 +5,6 @@ "deviceTypes": [ "default", "tablet" - ], + ] } -} \ No newline at end of file +} diff --git a/recyclerview_animators/src/main/resources/en_US/element/string.json b/recyclerview_animators/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/recyclerview_animators/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/recyclerview_animators/src/main/resources/zh_CN/element/string.json b/recyclerview_animators/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/recyclerview_animators/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +}