Skip to content

Commit 2a1b850

Browse files
committed
Fix AnimatorCompatHelper ClassNotFoundException
It seems that method was deprecated since SDK 26
1 parent ef03001 commit 2a1b850

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Mar 12 14:19:50 JST 2017
1+
#Tue Jun 13 17:38:24 CDT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

library/build.gradle

+3-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ android {
5656
}
5757

5858
dependencies {
59-
compile 'com.android.support:appcompat-v7:25.3.0'
60-
compile 'com.android.support:recyclerview-v7:25.3.0'
59+
compile 'com.android.support:appcompat-v7:25.3.1'
60+
compile 'com.android.support:design:25.3.1'
61+
compile 'com.android.support:recyclerview-v7:25.3.1'
6162

6263
testCompile 'junit:junit:4.12'
6364
testCompile 'org.hamcrest:hamcrest-library:1.3'

library/src/main/java/com/h6ah4i/android/widget/advrecyclerview/animator/impl/BaseItemAnimationManager.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
package com.h6ah4i.android.widget.advrecyclerview.animator.impl;
1818

19-
import android.support.v4.animation.AnimatorCompatHelper;
2019
import android.support.v4.view.ViewCompat;
2120
import android.support.v4.view.ViewPropertyAnimatorCompat;
2221
import android.support.v4.view.ViewPropertyAnimatorListener;
2322
import android.support.v7.widget.RecyclerView;
2423
import android.view.View;
24+
import android.view.animation.Interpolator;
2525

2626
import com.h6ah4i.android.widget.advrecyclerview.animator.BaseItemAnimator;
2727

@@ -158,10 +158,24 @@ protected void endAnimation(RecyclerView.ViewHolder holder) {
158158
}
159159

160160
protected void resetAnimation(RecyclerView.ViewHolder holder) {
161-
AnimatorCompatHelper.clearInterpolator(holder.itemView);
161+
clearInterpolator(holder.itemView);
162162
endAnimation(holder);
163163
}
164164

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+
165179
protected void dispatchFinishedWhenDone() {
166180
mItemAnimator.dispatchFinishedWhenDone();
167181
}

0 commit comments

Comments
 (0)