diff --git a/library/src/main/java/com/bartoszlipinski/viewpropertyobjectanimator/ViewPropertyObjectAnimator.java b/library/src/main/java/com/bartoszlipinski/viewpropertyobjectanimator/ViewPropertyObjectAnimator.java index 81c86b8..131dad9 100644 --- a/library/src/main/java/com/bartoszlipinski/viewpropertyobjectanimator/ViewPropertyObjectAnimator.java +++ b/library/src/main/java/com/bartoszlipinski/viewpropertyobjectanimator/ViewPropertyObjectAnimator.java @@ -23,6 +23,7 @@ import android.annotation.SuppressLint; import android.os.Build; import android.support.v4.util.ArrayMap; +import android.support.v4.view.ViewCompat; import android.util.Property; import android.view.View; import android.view.animation.Interpolator; @@ -823,7 +824,7 @@ public void onAnimationStart(Animator animation) { View view = mView.get(); mCurrentLayerType = view.getLayerType(); view.setLayerType(View.LAYER_TYPE_HARDWARE, null); - if(view.isAttachedToWindow()) { + if(ViewCompat.isAttachedToWindow(view)) { view.buildLayer(); } }