From bcc2cbc93049cffc6d619048e2bd3ab744971c29 Mon Sep 17 00:00:00 2001 From: 15296721452 <123> Date: Tue, 29 Jun 2021 10:49:02 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/additive_animations/MainAbility.java | 6 + .../Pagelider/Animatext.java | 2 +- .../Pagelider/Chaining.java | 4 +- .../Pagelider/ChainingRe.java | 2 +- .../Pagelider/Margins.java | 5 +- .../Pagelider/Multiple.java | 2 +- .../Pagelider/Repeating.java | 9 +- .../Pagelider/TapDrag.java | 6 +- .../custom/AdditiveRectAnimator.java | 2 - .../additive_animations/custom/DemoView.java | 2 +- .../slideDrawer/SlidingDrawer.java | 134 +++++++++--------- 11 files changed, 91 insertions(+), 83 deletions(-) diff --git a/demo/src/main/java/additive_animations/MainAbility.java b/demo/src/main/java/additive_animations/MainAbility.java index a03acc2..1d46470 100644 --- a/demo/src/main/java/additive_animations/MainAbility.java +++ b/demo/src/main/java/additive_animations/MainAbility.java @@ -182,6 +182,12 @@ public class MainAbility extends Ability implements Component.ClickedListener, A ADDITIVE_ANIMATIONS_ENABLED = isChecked; } + /** + * 解决触摸冲突 + * + * @param touchEvent 点击事件 + * @return 是否阻拦 + */ public boolean isNeedMove(TouchEvent touchEvent) { boolean isTouch = true; int[] mHeight = mSwitch.getLocationOnScreen(); diff --git a/demo/src/main/java/additive_animations/Pagelider/Animatext.java b/demo/src/main/java/additive_animations/Pagelider/Animatext.java index fa2fcef..3f9e85b 100644 --- a/demo/src/main/java/additive_animations/Pagelider/Animatext.java +++ b/demo/src/main/java/additive_animations/Pagelider/Animatext.java @@ -8,7 +8,7 @@ import ohos.agp.components.Text; import ohos.agp.utils.Color; import ohos.app.AbilityContext; -public class Animatext { +public class Animatext { private Component root; private AbilityContext mContext; private AnimatorValue animatorValue = new AnimatorValue(); diff --git a/demo/src/main/java/additive_animations/Pagelider/Chaining.java b/demo/src/main/java/additive_animations/Pagelider/Chaining.java index ca5ab03..e48fca8 100644 --- a/demo/src/main/java/additive_animations/Pagelider/Chaining.java +++ b/demo/src/main/java/additive_animations/Pagelider/Chaining.java @@ -6,7 +6,6 @@ import at.wirecube.additiveanimations.additive_animator.TouchUtile; import at.wirecube.additiveanimations.additiveanimationsdemo.ResourceTable; import at.wirecube.additiveanimations.helper.AddAnimatorGroup; import at.wirecube.additiveanimations.helper.EaseInOutPathInterpolator; -import ohos.agp.animation.Animator; import ohos.agp.animation.AnimatorGroup; import ohos.agp.animation.AnimatorProperty; import ohos.agp.components.Component; @@ -50,7 +49,8 @@ public class Chaining { float mTouchX = touchX - mComponent.getWidth() / 2; float mTouchY = touchY - mComponent.getHeight() / 2; if (touchEvent.getAction() == TouchEvent.POINT_MOVE - || touchEvent.getAction() == TouchEvent.PRIMARY_POINT_DOWN || touchEvent.getAction() == TouchEvent.PRIMARY_POINT_UP) { + || touchEvent.getAction() == TouchEvent.PRIMARY_POINT_DOWN + || touchEvent.getAction() == TouchEvent.PRIMARY_POINT_UP) { if (!((MainAbility) mContext).isNeedMove(touchEvent)) { return true; } diff --git a/demo/src/main/java/additive_animations/Pagelider/ChainingRe.java b/demo/src/main/java/additive_animations/Pagelider/ChainingRe.java index 6a18e99..d61e025 100644 --- a/demo/src/main/java/additive_animations/Pagelider/ChainingRe.java +++ b/demo/src/main/java/additive_animations/Pagelider/ChainingRe.java @@ -14,7 +14,7 @@ import ohos.agp.utils.Color; import ohos.app.AbilityContext; import ohos.multimodalinput.event.TouchEvent; -public class ChainingRe { +public class ChainingRe { private Component root; private AbilityContext mContext; private Component mComponent; diff --git a/demo/src/main/java/additive_animations/Pagelider/Margins.java b/demo/src/main/java/additive_animations/Pagelider/Margins.java index 2b11d43..67801c6 100644 --- a/demo/src/main/java/additive_animations/Pagelider/Margins.java +++ b/demo/src/main/java/additive_animations/Pagelider/Margins.java @@ -13,7 +13,8 @@ public class Margins { private Component root; private Component mAnimatedView; private AbilityContext mContext; - private float mX, mY; + private float mX; + private float mY; /** * 构造 @@ -36,7 +37,7 @@ public class Margins { public boolean onTouchEvent(Component component, TouchEvent touchEvent) { float touchX = TouchUtile.getTouchX(touchEvent, 0, component); float touchY = TouchUtile.getTouchY(touchEvent, 0, component); - if (touchEvent.getAction() == TouchEvent.POINT_MOVE) { + if (touchEvent.getAction() == TouchEvent.POINT_MOVE || touchEvent.getAction() == TouchEvent.PRIMARY_POINT_DOWN) { if (!((MainAbility) mContext).isNeedMove(touchEvent)) { return true; } diff --git a/demo/src/main/java/additive_animations/Pagelider/Multiple.java b/demo/src/main/java/additive_animations/Pagelider/Multiple.java index fc742ab..543f785 100644 --- a/demo/src/main/java/additive_animations/Pagelider/Multiple.java +++ b/demo/src/main/java/additive_animations/Pagelider/Multiple.java @@ -30,7 +30,7 @@ public class Multiple { * 构造 * * @param context 上下文 - * @param root 布局 + * @param root 布局 */ public Multiple(AbilityContext context, Component root) { this.root = root; diff --git a/demo/src/main/java/additive_animations/Pagelider/Repeating.java b/demo/src/main/java/additive_animations/Pagelider/Repeating.java index 595b324..df73528 100644 --- a/demo/src/main/java/additive_animations/Pagelider/Repeating.java +++ b/demo/src/main/java/additive_animations/Pagelider/Repeating.java @@ -27,12 +27,12 @@ public class Repeating { * * @param context 上下文 * @param root 布局 - * @param mLayout 布局 + * @param layout 布局 */ - public Repeating(AbilityContext context, Component root, DirectionalLayout mLayout) { + public Repeating(AbilityContext context, Component root, DirectionalLayout layout) { this.root = root; this.mContext = context; - this.mLayout = mLayout; + this.mLayout = layout; } /** @@ -43,7 +43,8 @@ public class Repeating { root.setTouchEventListener(new Component.TouchEventListener() { @Override public boolean onTouchEvent(Component component, TouchEvent touchEvent) { - if (touchEvent.getAction() == TouchEvent.PRIMARY_POINT_DOWN || touchEvent.getAction() == TouchEvent.POINT_MOVE) { + if (touchEvent.getAction() == TouchEvent.PRIMARY_POINT_DOWN + || touchEvent.getAction() == TouchEvent.POINT_MOVE) { if (!((MainAbility) mContext).isNeedMove(touchEvent)) { return true; } diff --git a/demo/src/main/java/additive_animations/Pagelider/TapDrag.java b/demo/src/main/java/additive_animations/Pagelider/TapDrag.java index 5857ecd..64d917b 100644 --- a/demo/src/main/java/additive_animations/Pagelider/TapDrag.java +++ b/demo/src/main/java/additive_animations/Pagelider/TapDrag.java @@ -15,7 +15,8 @@ public class TapDrag { private AbilityContext mContext; private Component mTouch; private Component mAnimated; - private float mY, mX; + private float mY; + private float mX; /** * 构造 @@ -59,7 +60,8 @@ public class TapDrag { if (mX == touchX && mY == touchY && mX != 0) { animation.moveFromX(positionX).moveFromY(positionY). moveToX(touchX - mAnimated.getWidth() / 2) - .moveToY(touchY - mAnimated.getHeight() / 2).setDuration(1500).setCurve(EaseInOutPathInterpolator.create()); + .moveToY(touchY - mAnimated.getHeight() / 2).setDuration(1500) + .setCurve(EaseInOutPathInterpolator.create()); animation.start(); } else { animation.stop(); diff --git a/demo/src/main/java/additive_animations/custom/AdditiveRectAnimator.java b/demo/src/main/java/additive_animations/custom/AdditiveRectAnimator.java index 3621db5..5867d39 100644 --- a/demo/src/main/java/additive_animations/custom/AdditiveRectAnimator.java +++ b/demo/src/main/java/additive_animations/custom/AdditiveRectAnimator.java @@ -26,8 +26,6 @@ public class AdditiveRectAnimator extends BaseAdditiveAnimator rect.mSize, (rect, s) -> rect.mSize = s)); } diff --git a/demo/src/main/java/additive_animations/custom/DemoView.java b/demo/src/main/java/additive_animations/custom/DemoView.java index f9bba9a..737fbeb 100644 --- a/demo/src/main/java/additive_animations/custom/DemoView.java +++ b/demo/src/main/java/additive_animations/custom/DemoView.java @@ -21,7 +21,7 @@ public class DemoView extends Component implements Component.DrawTask, Component final List mRects = new ArrayList<>(); final List mPaints = new ArrayList<>(); private AnimatorValue mAnimatorValue = new AnimatorValue(); - float rotationTarget = 0; + private float rotationTarget = 0; /** * 构造 diff --git a/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java b/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java index 1f84d4e..5ec81f6 100644 --- a/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java +++ b/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java @@ -49,6 +49,72 @@ public class SlidingDrawer extends DirectionalLayout implements Component.DrawTa private OnDrawerCloseListener onDrawerCloseListener; private OnDrawerScrollListener onDrawerScrollListener; + DraggedListener mDragListener = new DraggedListener() { + @Override + public void onDragDown(Component component, DragInfo dragInfo) { + } + + /** + * 拖动开始 + * + * @param component type + * @param dragInfo info + */ + @Override + public void onDragStart(Component component, DragInfo dragInfo) { + start = ((getOrientation() == VERTICAL) + ? dragInfo.startPoint.position[1] : dragInfo.startPoint.position[0]); + updateBounds(); + } + + /** + * 更新 + * + * @param component type + * @param dragInfo info + */ + @Override + public void onDragUpdate(Component component, DragInfo dragInfo) { + } + + /** + * 结束 + * + * @param component type + * @param dragInfo info + */ + @Override + public void onDragEnd(Component component, DragInfo dragInfo) { + if (getOrientation() == VERTICAL) { + if (mDelta < 0) { + animate(begening - getCurrentPosition(), 0); + } else { + animate(ending - getCurrentPosition(), 0); + } + } else { + if (mDelta > 0) { + animate(-(viewContent.getWidth()), 0); + } else if (mDelta < 0) { + animate(0, 0); + } + } + if (onDrawerScrollListener != null) { + scrollState = 0; + onDrawerScrollListener.onScrollEnded(); + } + } + + /** + * 关闭 + * + * @param component type + * @param dragInfo info + */ + @Override + public void onDragCancel(Component component, DragInfo dragInfo) { + } + }; + /** * 构造 * @@ -372,70 +438,4 @@ public class SlidingDrawer extends DirectionalLayout implements Component.DrawTa ending = getWidth(); } } - - DraggedListener mDragListener = new DraggedListener() { - @Override - public void onDragDown(Component component, DragInfo dragInfo) { - } - - /** - * 拖动开始 - * - * @param component type - * @param dragInfo info - */ - @Override - public void onDragStart(Component component, DragInfo dragInfo) { - start = ((getOrientation() == VERTICAL) ? - dragInfo.startPoint.position[1] : dragInfo.startPoint.position[0]); - updateBounds(); - } - - /** - * 更新 - * - * @param component type - * @param dragInfo info - */ - @Override - public void onDragUpdate(Component component, DragInfo dragInfo) { - } - - /** - * 结束 - * - * @param component type - * @param dragInfo info - */ - @Override - public void onDragEnd(Component component, DragInfo dragInfo) { - if (getOrientation() == VERTICAL) { - if (mDelta < 0) { - animate(begening - getCurrentPosition(), 0); - } else { - animate(ending - getCurrentPosition(), 0); - } - } else { - if (mDelta > 0) { - animate(-(viewContent.getWidth()), 0); - } else if (mDelta < 0) { - animate(0, 0); - } - } - if (onDrawerScrollListener != null) { - scrollState = 0; - onDrawerScrollListener.onScrollEnded(); - } - } - - /** - * 关闭 - * - * @param component type - * @param dragInfo info - */ - @Override - public void onDragCancel(Component component, DragInfo dragInfo) { - } - }; -} +} \ No newline at end of file -- Gitee From 90a60febf8d9d944d9dd90c1e056efe9c1fda6c7 Mon Sep 17 00:00:00 2001 From: 15296721452 <123> Date: Tue, 29 Jun 2021 12:11:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/additive_animations/MainAbility.java | 8 +++ .../slideDrawer/OnOpenCloseListener.java | 24 +++++++++ .../slideDrawer/SlidingDrawer.java | 54 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 demo/src/main/java/additive_animations/slideDrawer/OnOpenCloseListener.java diff --git a/demo/src/main/java/additive_animations/MainAbility.java b/demo/src/main/java/additive_animations/MainAbility.java index 1d46470..00a8a3e 100644 --- a/demo/src/main/java/additive_animations/MainAbility.java +++ b/demo/src/main/java/additive_animations/MainAbility.java @@ -1,6 +1,7 @@ package additive_animations; import additive_animations.Pagelider.*; +import additive_animations.slideDrawer.OnOpenCloseListener; import additive_animations.slideDrawer.SlidingDrawer; import at.wirecube.additiveanimations.additiveanimationsdemo.ResourceTable; import ohos.aafwk.ability.Ability; @@ -23,6 +24,12 @@ public class MainAbility extends Ability implements Component.ClickedListener, A private LayoutScatter layoutScatter; private Checkbox mSwitch; private DependentLayout depen; + private OnOpenCloseListener onOpenCloseListener = new OnOpenCloseListener() { + @Override + public void isOpen() { + mComponent.setVisibility(Component.HIDE); + } + }; @Override public void onStart(Intent intent) { @@ -64,6 +71,7 @@ public class MainAbility extends Ability implements Component.ClickedListener, A tapDrag = (StackLayout) layoutScatter.parse(ResourceTable.Layout_layout_tapdrag, null, false); layout.addComponent(tapDrag); new TapDrag(MainAbility.this, tapDrag).instantiateComponent(); + slideDrawer.setOnOpenCloseListener(onOpenCloseListener); } @Override diff --git a/demo/src/main/java/additive_animations/slideDrawer/OnOpenCloseListener.java b/demo/src/main/java/additive_animations/slideDrawer/OnOpenCloseListener.java new file mode 100644 index 0000000..668aaee --- /dev/null +++ b/demo/src/main/java/additive_animations/slideDrawer/OnOpenCloseListener.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package additive_animations.slideDrawer; + +public interface OnOpenCloseListener { + /** + * 监听是否侧滑关闭 + */ + void isOpen(); +} diff --git a/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java b/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java index 5ec81f6..ce68d3d 100644 --- a/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java +++ b/demo/src/main/java/additive_animations/slideDrawer/SlidingDrawer.java @@ -48,6 +48,7 @@ public class SlidingDrawer extends DirectionalLayout implements Component.DrawTa private OnDrawerOpenListener onDrawerOpenListener; private OnDrawerCloseListener onDrawerCloseListener; private OnDrawerScrollListener onDrawerScrollListener; + private OnOpenCloseListener onOpenCloseListener; DraggedListener mDragListener = new DraggedListener() { @Override @@ -75,6 +76,47 @@ public class SlidingDrawer extends DirectionalLayout implements Component.DrawTa */ @Override public void onDragUpdate(Component component, DragInfo dragInfo) { + if (!isLocked) { + if (scrollState == 0) { + if (onDrawerScrollListener != null) { + onDrawerScrollListener.onScrollStarted(); + } + scrollState = 1; + } + float delta = (start - ((getOrientation() == VERTICAL) + ? dragInfo.updatePoint.position[1] : dragInfo.updatePoint.position[0])); + + if (getOrientation() == VERTICAL) { + if (getCurrentPosition() <= ending && delta > 0) { + delta = 0; + } + if (getCurrentPosition() >= begening && delta < 0) { + delta = 0; + } + if ((getCurrentPosition() > ending) && ((getCurrentPosition() - delta) < ending)) { + delta = -(ending - getCurrentPosition()); + } else if ((getCurrentPosition() < begening) && ((getCurrentPosition() + delta) > begening)) { + delta = (begening - getCurrentPosition()); + } + createAnimatorProperty().moveByY(-delta).setDuration(0).start(); + } else { + if (delta > 0 && getCurrentPosition() <= (-viewContent.getWidth())) { + delta = 0; + } + if (delta < 0 && getCurrentPosition() >= 0) { + delta = 0; + } + if (getCurrentPosition() > -viewContent.getWidth() && (getCurrentPosition() - delta) + < -viewContent.getWidth()) { + delta = viewContent.getWidth() + getCurrentPosition(); + } + if (getCurrentPosition() < 0 && (getCurrentPosition() - delta) > 0) { + delta = getCurrentPosition(); + } + createAnimatorProperty().moveByX(-delta).setDuration(0).start(); + } + mDelta = delta; + } } /** @@ -94,6 +136,9 @@ public class SlidingDrawer extends DirectionalLayout implements Component.DrawTa } else { if (mDelta > 0) { animate(-(viewContent.getWidth()), 0); + if (onOpenCloseListener != null) { + onOpenCloseListener.isOpen(); + } } else if (mDelta < 0) { animate(0, 0); } @@ -210,6 +255,15 @@ public class SlidingDrawer extends DirectionalLayout implements Component.DrawTa this.onDrawerOpenListener = onDrawerOpenListener; } + /** + * 设置监听 + * + * @param openCloseListener 监听 + */ + public void setOnOpenCloseListener(OnOpenCloseListener openCloseListener) { + this.onOpenCloseListener = openCloseListener; + } + /** * 设置绘制关闭 * -- Gitee From f6fa78da4ca9b2752e621ba5c35281bec06b9ddd Mon Sep 17 00:00:00 2001 From: 15296721452 <123> Date: Tue, 29 Jun 2021 14:07:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01f3222..6cdf327 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,4 +2,4 @@ ohos 第一个版本 * 实现了原库大部分功能 -* Multiple component、Custom drawing on cancas、Chaining animations、Chaining repeated原库使用数值转换器实现,ohos暂不支持,还有属性方法的不同,导致效果有差异 \ No newline at end of file +* Multiple component、Custom drawing on canvas、Chaining animations、Chaining repeated原库使用数值转换器实现,ohos暂不支持,还有属性方法的不同,导致效果有差异 \ No newline at end of file diff --git a/README.md b/README.md index d9a7fd0..6dfdde3 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ CloudTest代码测试无异常 - 0.0.1-SNAPSHOT ## 版权信息 +AdditiveAnimator is licensed under the Apache v2 license: + ``` Copyright 2021 David Ganster -- Gitee From 7ceaa24f377656aa03d1fe5004e026650bd3d059 Mon Sep 17 00:00:00 2001 From: 15296721452 <123> Date: Tue, 29 Jun 2021 14:13:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6dfdde3..ba1f73c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - 功能:一种简单的方法来添加任何物体的任何属性动画 - 项目移植状态:主功能完成 - 调用差异:无 -- 开发版本:sdk5,DevEco Studio 2.2 Beta1 +- 开发版本:sdk6,DevEco Studio 2.2 Beta1 - 基线版本:Release v1.9.1 ## 效果演示 @@ -32,7 +32,7 @@ dependencies { ...... } ``` -在sdk5,DevEco Studio 2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 +在sdk6,DevEco Studio 2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 ## 使用说明 使用该库非常简单, -- Gitee From 103df1af1b75c065ce0cecf232b8988a86afc521 Mon Sep 17 00:00:00 2001 From: 15296721452 <123> Date: Tue, 29 Jun 2021 14:20:13 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdditiveAnimationAccumulator.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/additive_animations/src/main/java/at/wirecube/additiveanimations/additive_animator/AdditiveAnimationAccumulator.java b/additive_animations/src/main/java/at/wirecube/additiveanimations/additive_animator/AdditiveAnimationAccumulator.java index 8057a52..694b5e0 100644 --- a/additive_animations/src/main/java/at/wirecube/additiveanimations/additive_animator/AdditiveAnimationAccumulator.java +++ b/additive_animations/src/main/java/at/wirecube/additiveanimations/additive_animator/AdditiveAnimationAccumulator.java @@ -177,11 +177,14 @@ class AdditiveAnimationAccumulator { } /** - * Removes the animation with the given name from the given object. + * 删除 + * + * @param vv 属性 + * @param additiveAnimationName 字符串 */ - private void removeAnimationFromTarget(Object v, String additiveAnimationName) { + private void removeAnimationFromTarget(Object vv, String additiveAnimationName) { AdditiveAnimationWrapper animationToRemove = null; - for (AdditiveAnimationWrapper anim : getAnimationWrappers(v)) { + for (AdditiveAnimationWrapper anim : getAnimationWrappers(vv)) { if (anim.animation.getTag().equals(additiveAnimationName)) { animationToRemove = anim; break; @@ -252,10 +255,12 @@ class AdditiveAnimationAccumulator { } /** - * Remove all properties belonging to `v`. + * 关闭 + * + * @param vv 要关闭 */ - final void cancel(Object v) { - removeTarget(v); + final void cancel(Object vv) { + removeTarget(vv); } final void cancel() { -- Gitee