From 3932cea85afa70a83fb9f2f814619ddd6e74d8e4 Mon Sep 17 00:00:00 2001 From: hexagon1337 Date: Fri, 2 Aug 2024 16:22:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=96=B0=E7=89=88?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86=E8=A3=85=E9=A5=B0=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hexagon1337 --- AppScope/app.json5 | 2 +- CHANGELOG.md | 4 ++++ build-profile.json5 | 5 ++--- entry/oh-package.json5 | 2 +- .../main/ets/pages/index_adapter_animator.ets | 6 +++--- .../src/main/ets/pages/index_item_animator.ets | 10 +++++----- entry/src/main/ets/pages/main.ets | 2 +- hvigor/hvigor-config.json5 | 5 ++--- library/oh-package.json5 | 2 +- .../src/main/ets/components/RecyclerView.ets | 13 +++++++------ .../AlphaInAnimationAdapter.ets | 14 +++++++------- .../ScaleInAnimationAdapter.ets | 14 +++++++------- .../SlideInBottomAnimationAdapter.ets | 14 +++++++------- .../SlideInLeftAnimationAdapter.ets | 14 +++++++------- .../SlideInRightAnimationAdapter.ets | 14 +++++++------- .../components/itemAnimator/FadeInAnimator.ets | 14 +++++++------- .../itemAnimator/FadeInDownAnimator.ets | 16 ++++++++-------- .../itemAnimator/FadeInLeftAnimator.ets | 16 ++++++++-------- .../itemAnimator/FadeInRightAnimator.ets | 16 ++++++++-------- .../itemAnimator/FadeInUpAnimator.ets | 16 ++++++++-------- .../itemAnimator/LandingAnimator.ets | 16 ++++++++-------- .../itemAnimator/OvershootInLeftAnimator.ets | 18 +++++++++--------- .../itemAnimator/OvershootInRightAnimator.ets | 18 +++++++++--------- .../itemAnimator/ScaleInAnimator.ets | 16 ++++++++-------- .../itemAnimator/ScaleInBottomAnimator.ets | 16 ++++++++-------- .../itemAnimator/ScaleInLeftAnimator.ets | 16 ++++++++-------- .../itemAnimator/ScaleInRightAnimator.ets | 16 ++++++++-------- .../itemAnimator/ScaleInTopAnimator.ets | 16 ++++++++-------- .../itemAnimator/SlideInDownAnimator.ets | 18 +++++++++--------- .../itemAnimator/SlideInLeftAnimator.ets | 18 +++++++++--------- .../itemAnimator/SlideInRightAnimator.ets | 18 +++++++++--------- .../itemAnimator/SlideInUpAnimator.ets | 18 +++++++++--------- oh-package.json5 | 3 ++- 33 files changed, 205 insertions(+), 201 deletions(-) diff --git a/AppScope/app.json5 b/AppScope/app.json5 index 97bb805..b77dfd4 100644 --- a/AppScope/app.json5 +++ b/AppScope/app.json5 @@ -3,7 +3,7 @@ "bundleName": "cn.openharmony.recyclerviewanimators", "vendor": "example", "versionCode": 1000000, - "versionName": "1.0.0", + "versionName": "2.1.0", "icon": "$media:app_icon", "label": "$string:app_name", "distributedNotificationEnabled": true diff --git a/CHANGELOG.md b/CHANGELOG.md index a518dcd..539c945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v2.1.0 + +1. 适配新版状态管理装饰器 + ## v2.0.0 1. 适配DevEco Studio 版本: 4.1 Canary(4.1.3.317), OpenHarmony SDK: API11 (4.1.0.36) diff --git a/build-profile.json5 b/build-profile.json5 index f0668ed..2d162d6 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -5,9 +5,8 @@ { "name": "default", "signingConfig": "default", - "compileSdkVersion": 10, - "compatibleSdkVersion": 10, - "targetSdkVersion": 10, + "compatibleSdkVersion": 12, + "targetSdkVersion": 12, "runtimeOS": "OpenHarmony" } ], diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 index 8cbfdc8..26622cc 100644 --- a/entry/oh-package.json5 +++ b/entry/oh-package.json5 @@ -9,7 +9,7 @@ }, "description": "This is an example for using the recyclerview-animators library", "repository": {}, - "version": "2.0.0", + "version": "2.1.0", "dependencies": { "@ohos/recyclerview-animators": "file:../library" } diff --git a/entry/src/main/ets/pages/index_adapter_animator.ets b/entry/src/main/ets/pages/index_adapter_animator.ets index 36bcb2f..ac99a4e 100644 --- a/entry/src/main/ets/pages/index_adapter_animator.ets +++ b/entry/src/main/ets/pages/index_adapter_animator.ets @@ -17,7 +17,7 @@ import { RecyclerView } from "@ohos/recyclerview-animators" @Entry -@Component +@ComponentV2 struct Index_adapter_animator { private listDatas = ["Apple", "Ball", "Camera", "Day", "Egg", "Foo", "GL", "Hello", "Iron", "Japan", "Coke", "Dog", "Cat", "Yahoo", "Sony", "Canon", "Fujitsu", "USA", "Nexus", @@ -32,8 +32,8 @@ struct Index_adapter_animator { new AnimType('SlideInLeft', RecyclerView.AdapterAnimationType.SlideInLeft), new AnimType('SlideInRight', RecyclerView.AdapterAnimationType.SlideInRight) ]; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State selectIndex: number = 0 + @Local controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local selectIndex: number = 0 aboutToAppear() { this.controller.setAdapterAnimation(RecyclerView.AdapterAnimationType.AlphaIn) diff --git a/entry/src/main/ets/pages/index_item_animator.ets b/entry/src/main/ets/pages/index_item_animator.ets index 54d42d7..a0a500b 100644 --- a/entry/src/main/ets/pages/index_item_animator.ets +++ b/entry/src/main/ets/pages/index_item_animator.ets @@ -19,7 +19,7 @@ import router from '@ohos.router'; import promptAction from '@ohos.promptAction' @Entry -@Component +@ComponentV2 struct Index_item_animator { private listDatas = ["Apple", "Ball", "Camera", "Day", "Egg", "Foo", "GL", "Hello", "Iron", "Japan", "Coke", "Dog", "Cat", "Yahoo", "Sony", "Canon", "Fujitsu", "USA", "Nexus", @@ -47,10 +47,10 @@ struct Index_item_animator { new AnimType('OvershootInLeft', RecyclerView.ItemAnimationType.OvershootInLeft) ]; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State selectIndex: number = 0 - @State listDataTailFlag: number = this.listDatas.length - 1; - @State addFlag: number = 0; + @Local controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local selectIndex: number = 0 + @Local listDataTailFlag: number = this.listDatas.length - 1; + @Local addFlag: number = 0; aboutToAppear() { diff --git a/entry/src/main/ets/pages/main.ets b/entry/src/main/ets/pages/main.ets index 6a13a0b..a2155d8 100644 --- a/entry/src/main/ets/pages/main.ets +++ b/entry/src/main/ets/pages/main.ets @@ -17,7 +17,7 @@ import router from '@ohos.router'; @Entry -@Component +@ComponentV2 struct Index { private isOn: boolean = false diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 index 277e9a1..73bfab4 100644 --- a/hvigor/hvigor-config.json5 +++ b/hvigor/hvigor-config.json5 @@ -1,7 +1,6 @@ { - "hvigorVersion": "3.0.2", + "modelVersion": "5.0.0", "dependencies": { - "@ohos/hvigor-ohos-plugin": "3.0.2" }, "execution": { // "daemon": true, /* Enable daemon compilation. Default: true */ @@ -15,4 +14,4 @@ "debugging": { // "stacktrace": false /* Disable stacktrace compilation. Default: false */ } -} +} \ No newline at end of file diff --git a/library/oh-package.json5 b/library/oh-package.json5 index 0da36e4..d93cac7 100644 --- a/library/oh-package.json5 +++ b/library/oh-package.json5 @@ -13,7 +13,7 @@ "main": "Index.ets", "type": "module", "repository": "https://gitee.com/openharmony-sig/recyclerview-animators", - "version": "2.0.0", + "version": "2.1.0", "tags": [ "UI", "Animation", diff --git a/library/src/main/ets/components/RecyclerView.ets b/library/src/main/ets/components/RecyclerView.ets index fce5272..7d3078e 100644 --- a/library/src/main/ets/components/RecyclerView.ets +++ b/library/src/main/ets/components/RecyclerView.ets @@ -37,12 +37,12 @@ import {ScaleInAnimationAdapter} from './adapterAnimator/ScaleInAnimationAdapter import {SlideInRightAnimationAdapter} from './adapterAnimator/SlideInRightAnimationAdapter' import {SlideInBottomAnimationAdapter} from './adapterAnimator/SlideInBottomAnimationAdapter' -@Component +@ComponentV2 struct RecyclerView { - array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - columnsNum: number = 1 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Param columnsNum: number = 1 build() { if (this.controller.adapterAnimation !== null) { @@ -278,12 +278,13 @@ namespace RecyclerView { SlideInRight // 从右侧平移进入 } + @ObservedV2 export class Controller { addValueCallback: (index: number, value: ESObject) => void = () => {}; deleteValueCallback: (index: number) => void = () => {}; duration: number = 500 - itemAnimation = RecyclerView.ItemAnimationType.FadeIn - adapterAnimation: ESObject = null + @Trace itemAnimation = RecyclerView.ItemAnimationType.FadeIn + @Trace adapterAnimation: ESObject = null isFirstOnly: boolean = false mWidth: number = 480 mHeight: number = 855 diff --git a/library/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets b/library/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets index d0f0881..efb8ff7 100644 --- a/library/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets +++ b/library/src/main/ets/components/adapterAnimator/AlphaInAnimationAdapter.ets @@ -16,15 +16,15 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct AlphaInAnimationAdapter { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @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 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private list: Array = [] + @Local private animateList: Array = [] + @Local private start: number = 0 + @Local private end: number = 0 aboutToAppear() { this.array.forEach((item: string) => { diff --git a/library/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets b/library/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets index c21f2a2..63216e2 100644 --- a/library/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets +++ b/library/src/main/ets/components/adapterAnimator/ScaleInAnimationAdapter.ets @@ -16,15 +16,15 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct ScaleInAnimationAdapter { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @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 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private list: Array = [] + @Local private animateList: Array = [] + @Local private start: number = 0 + @Local private end: number = 0 aboutToAppear() { this.array.forEach((item: string) => { diff --git a/library/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets b/library/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets index ea9135a..3ba15d2 100644 --- a/library/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets +++ b/library/src/main/ets/components/adapterAnimator/SlideInBottomAnimationAdapter.ets @@ -16,15 +16,15 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct SlideInBottomAnimationAdapter { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @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 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private list: Array = [] + @Local private animateList: Array = [] + @Local private start: number = 0 + @Local private end: number = 0 aboutToAppear() { this.array.forEach((item: string) => { diff --git a/library/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets b/library/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets index 1d5982b..c4aaff5 100644 --- a/library/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets +++ b/library/src/main/ets/components/adapterAnimator/SlideInLeftAnimationAdapter.ets @@ -16,15 +16,15 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct SlideInLeftAnimationAdapter { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @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 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private list: Array = [] + @Local private animateList: Array = [] + @Local private start: number = 0 + @Local private end: number = 0 aboutToAppear() { this.array.forEach((item: string) => { diff --git a/library/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets b/library/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets index e8c8d47..0936a05 100644 --- a/library/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets +++ b/library/src/main/ets/components/adapterAnimator/SlideInRightAnimationAdapter.ets @@ -16,15 +16,15 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct SlideInRightAnimationAdapter { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @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 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private list: Array = [] + @Local private animateList: Array = [] + @Local private start: number = 0 + @Local private end: number = 0 aboutToAppear() { this.array.forEach((item: string) => { diff --git a/library/src/main/ets/components/itemAnimator/FadeInAnimator.ets b/library/src/main/ets/components/itemAnimator/FadeInAnimator.ets index 6350e38..49670f9 100644 --- a/library/src/main/ets/components/itemAnimator/FadeInAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/FadeInAnimator.ets @@ -16,16 +16,16 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct FadeInAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - columnsNum: number = 1 + @Local private trans: number = 0 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets b/library/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets index 03d74ce..0239510 100644 --- a/library/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/FadeInDownAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct FadeInDownAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State offsetY: number = -30 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local offsetY: number = -30 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets b/library/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets index c45a227..8e49803 100644 --- a/library/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/FadeInLeftAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct FadeInLeftAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State offsetX: number = -50 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local offsetX: number = -50 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets b/library/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets index 7ed054e..7686252 100644 --- a/library/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/FadeInRightAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct FadeInRightAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State offsetX: number = 50 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local offsetX: number = 50 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets b/library/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets index dff4d66..d77c3d2 100644 --- a/library/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/FadeInUpAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct FadeInUpAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller(); - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller(); + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State offsetY: number = 30 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local offsetY: number = 30 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/LandingAnimator.ets b/library/src/main/ets/components/itemAnimator/LandingAnimator.ets index 34da84d..73fa96a 100644 --- a/library/src/main/ets/components/itemAnimator/LandingAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/LandingAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct LandingAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State landing: number = 1 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local landing: number = 1 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets b/library/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets index 13a695c..34777e0 100644 --- a/library/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/OvershootInLeftAnimator.ets @@ -16,18 +16,18 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct OvershootInLeftAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State x: string = '0%' - @State y: string = '0%' - columnsNum: number = 1 + @Local private trans: number = 0 + @Local x: string = '0%' + @Local y: string = '0%' + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets b/library/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets index cb8935f..b479a68 100644 --- a/library/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/OvershootInRightAnimator.ets @@ -16,19 +16,19 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct OvershootInRightAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - columnsNum: number = 1 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Param columnsNum: number = 1 private colNumStr: string = '' - @State private myArr: Array = [] - @State private duration: number = 0 + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State private x: string = '0%' - @State private y: string = '0%' + @Local private trans: number = 0 + @Local private x: string = '0%' + @Local private y: string = '0%' aboutToAppear() { this.controller.addValueCallback = (index: number, value: ESObject) => { diff --git a/library/src/main/ets/components/itemAnimator/ScaleInAnimator.ets b/library/src/main/ets/components/itemAnimator/ScaleInAnimator.ets index 2a502ab..d351c5c 100644 --- a/library/src/main/ets/components/itemAnimator/ScaleInAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/ScaleInAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct ScaleInAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State landing: number = 1 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local landing: number = 1 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets b/library/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets index c17b0f9..8185155 100644 --- a/library/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/ScaleInBottomAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct ScaleInBottomAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State landing: number = 1 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local landing: number = 1 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets b/library/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets index cc62f58..199400e 100644 --- a/library/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/ScaleInLeftAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct ScaleInLeftAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State landing: number = 1 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local landing: number = 1 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets b/library/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets index 444c95c..e7d15ec 100644 --- a/library/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/ScaleInRightAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct ScaleInRightAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State landing: number = 1 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local landing: number = 1 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets b/library/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets index b05dd36..908dc1b 100644 --- a/library/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/ScaleInTopAnimator.ets @@ -16,17 +16,17 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct ScaleInTopAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State landing: number = 1 - columnsNum: number = 1 + @Local private trans: number = 0 + @Local landing: number = 1 + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets b/library/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets index 7455d92..4d60962 100644 --- a/library/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/SlideInDownAnimator.ets @@ -16,18 +16,18 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct SlideInDownAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State x: string = '0%' - @State y: string = '0%' - columnsNum: number = 1 + @Local private trans: number = 0 + @Local x: string = '0%' + @Local y: string = '0%' + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets b/library/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets index 26253e4..05f692a 100644 --- a/library/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/SlideInLeftAnimator.ets @@ -16,18 +16,18 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct SlideInLeftAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State x: string = '0%' - @State y: string = '0%' - columnsNum: number = 1 + @Local private trans: number = 0 + @Local x: string = '0%' + @Local y: string = '0%' + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets b/library/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets index cc3d661..b38285e 100644 --- a/library/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/SlideInRightAnimator.ets @@ -16,18 +16,18 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct SlideInRightAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State x: string = '0%' - @State y: string = '0%' - columnsNum: number = 1 + @Local private trans: number = 0 + @Local x: string = '0%' + @Local y: string = '0%' + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/library/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets b/library/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets index 2ddb710..266df4f 100644 --- a/library/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets +++ b/library/src/main/ets/components/itemAnimator/SlideInUpAnimator.ets @@ -16,18 +16,18 @@ import RecyclerView from '../RecyclerView' -@Component +@ComponentV2 export struct SlideInUpAnimator { - @State array: Array = [] + @Param array: Array = [] @BuilderParam child: (itemData: ESObject) => void; - @State controller: RecyclerView.Controller = new RecyclerView.Controller() - @State private myArr: Array = [] - @State private duration: number = 0 + @Param controller: RecyclerView.Controller = new RecyclerView.Controller() + @Local private myArr: Array = [] + @Local private duration: number = 0 private isClick: boolean = true - @State private trans: number = 0 - @State x: string = '0%' - @State y: string = '0%' - columnsNum: number = 1 + @Local private trans: number = 0 + @Local x: string = '0%' + @Local y: string = '0%' + @Param columnsNum: number = 1 private colNumStr: string = '' aboutToAppear() { diff --git a/oh-package.json5 b/oh-package.json5 index 2094d00..a3f7d5d 100644 --- a/oh-package.json5 +++ b/oh-package.json5 @@ -1,4 +1,5 @@ { + "modelVersion": "5.0.0", "license": "Apache-2.0", "devDependencies": { "@ohos/hypium": "1.0.6" @@ -12,6 +13,6 @@ }, "description": "example description", "repository": {}, - "version": "2.0.0", + "version": "2.1.0", "dependencies": {} } \ No newline at end of file -- Gitee From 53973b831bd3edb7c1dff9e2215582a04ff50739 Mon Sep 17 00:00:00 2001 From: hexagon1337 Date: Fri, 2 Aug 2024 16:22:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=96=B0=E7=89=88?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86=E8=A3=85=E9=A5=B0=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hexagon1337 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7641a6..a5a0e15 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,8 @@ build() { 在下述版本验证通过: -- DevEco Studio 版本: 4.1 Canary(4.1.3.317) -- OpenHarmony SDK: API11 (4.1.0.36) +- DevEco Studio NEXT Developer Beta3: 5.0(5.0.3.530) +- SDK: API12 (5.0.0.35(SP3)) ## 目录结构 ```` -- Gitee From b4cad28735c2e4ea2546e8228a6ddd912f835bea Mon Sep 17 00:00:00 2001 From: hexagon1337 Date: Fri, 2 Aug 2024 16:22:20 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=96=B0=E7=89=88?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86=E8=A3=85=E9=A5=B0=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hexagon1337 --- README.md | 4 ++-- hvigor/hvigor-config.json5 | 2 +- oh-package.json5 | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a7641a6..a5a0e15 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,8 @@ build() { 在下述版本验证通过: -- DevEco Studio 版本: 4.1 Canary(4.1.3.317) -- OpenHarmony SDK: API11 (4.1.0.36) +- DevEco Studio NEXT Developer Beta3: 5.0(5.0.3.530) +- SDK: API12 (5.0.0.35(SP3)) ## 目录结构 ```` diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 index 73bfab4..7bc22e3 100644 --- a/hvigor/hvigor-config.json5 +++ b/hvigor/hvigor-config.json5 @@ -1,5 +1,5 @@ { - "modelVersion": "5.0.0", + "hvigorVersion": "3.0.2", "dependencies": { }, "execution": { diff --git a/oh-package.json5 b/oh-package.json5 index a3f7d5d..46c8272 100644 --- a/oh-package.json5 +++ b/oh-package.json5 @@ -1,5 +1,4 @@ { - "modelVersion": "5.0.0", "license": "Apache-2.0", "devDependencies": { "@ohos/hypium": "1.0.6" -- Gitee From 2886f926e7ef9bd70f1f90f32421d55af41f749c Mon Sep 17 00:00:00 2001 From: hexagon1337 Date: Tue, 6 Aug 2024 10:11:42 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hexagon1337 --- AppScope/app.json5 | 2 +- CHANGELOG.md | 2 +- entry/oh-package.json5 | 2 +- library/oh-package.json5 | 2 +- oh-package.json5 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AppScope/app.json5 b/AppScope/app.json5 index b77dfd4..86f83eb 100644 --- a/AppScope/app.json5 +++ b/AppScope/app.json5 @@ -3,7 +3,7 @@ "bundleName": "cn.openharmony.recyclerviewanimators", "vendor": "example", "versionCode": 1000000, - "versionName": "2.1.0", + "versionName": "2.1.0-rc.0", "icon": "$media:app_icon", "label": "$string:app_name", "distributedNotificationEnabled": true diff --git a/CHANGELOG.md b/CHANGELOG.md index 539c945..07d465a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v2.1.0 +## v2.1.0-rc.0 1. 适配新版状态管理装饰器 diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 index 26622cc..8f7d2fb 100644 --- a/entry/oh-package.json5 +++ b/entry/oh-package.json5 @@ -9,7 +9,7 @@ }, "description": "This is an example for using the recyclerview-animators library", "repository": {}, - "version": "2.1.0", + "version": "2.1.0-rc.0", "dependencies": { "@ohos/recyclerview-animators": "file:../library" } diff --git a/library/oh-package.json5 b/library/oh-package.json5 index d93cac7..ba58034 100644 --- a/library/oh-package.json5 +++ b/library/oh-package.json5 @@ -13,7 +13,7 @@ "main": "Index.ets", "type": "module", "repository": "https://gitee.com/openharmony-sig/recyclerview-animators", - "version": "2.1.0", + "version": "2.1.0-rc.0", "tags": [ "UI", "Animation", diff --git a/oh-package.json5 b/oh-package.json5 index 46c8272..910925e 100644 --- a/oh-package.json5 +++ b/oh-package.json5 @@ -12,6 +12,6 @@ }, "description": "example description", "repository": {}, - "version": "2.1.0", + "version": "2.1.0-rc.0", "dependencies": {} } \ No newline at end of file -- Gitee