|
16 | 16 |
|
17 | 17 | package com.h6ah4i.android.widget.advrecyclerview.animator.impl;
|
18 | 18 |
|
19 |
| -import android.support.v4.animation.AnimatorCompatHelper; |
20 | 19 | import android.support.v4.view.ViewCompat;
|
21 | 20 | import android.support.v4.view.ViewPropertyAnimatorCompat;
|
22 | 21 | import android.support.v4.view.ViewPropertyAnimatorListener;
|
23 | 22 | import android.support.v7.widget.RecyclerView;
|
24 | 23 | import android.view.View;
|
| 24 | +import android.view.animation.Interpolator; |
25 | 25 |
|
26 | 26 | import com.h6ah4i.android.widget.advrecyclerview.animator.BaseItemAnimator;
|
27 | 27 |
|
@@ -158,10 +158,24 @@ protected void endAnimation(RecyclerView.ViewHolder holder) {
|
158 | 158 | }
|
159 | 159 |
|
160 | 160 | protected void resetAnimation(RecyclerView.ViewHolder holder) {
|
161 |
| - AnimatorCompatHelper.clearInterpolator(holder.itemView); |
| 161 | + clearInterpolator(holder.itemView); |
162 | 162 | endAnimation(holder);
|
163 | 163 | }
|
164 | 164 |
|
| 165 | + protected void clearInterpolator(View v) { |
| 166 | + ViewCompat.setAlpha(v, 1.0F); |
| 167 | + ViewCompat.setScaleY(v, 1.0F); |
| 168 | + ViewCompat.setScaleX(v, 1.0F); |
| 169 | + ViewCompat.setTranslationY(v, 0.0F); |
| 170 | + ViewCompat.setTranslationX(v, 0.0F); |
| 171 | + ViewCompat.setRotation(v, 0.0F); |
| 172 | + ViewCompat.setRotationY(v, 0.0F); |
| 173 | + ViewCompat.setRotationX(v, 0.0F); |
| 174 | + //v.setPivotY((float)(v.getMeasuredHeight() / 2)); |
| 175 | + ViewCompat.setPivotX(v, (float) (v.getMeasuredWidth() / 2)); |
| 176 | + ViewCompat.animate(v).setInterpolator((Interpolator) null); |
| 177 | + } |
| 178 | + |
165 | 179 | protected void dispatchFinishedWhenDone() {
|
166 | 180 | mItemAnimator.dispatchFinishedWhenDone();
|
167 | 181 | }
|
|
0 commit comments