diff --git a/android/sdk/src/main/java/com/tencent/mtt/hippy/views/refresh/RefreshWrapper.java b/android/sdk/src/main/java/com/tencent/mtt/hippy/views/refresh/RefreshWrapper.java index e575ebab2..c5c6cf440 100644 --- a/android/sdk/src/main/java/com/tencent/mtt/hippy/views/refresh/RefreshWrapper.java +++ b/android/sdk/src/main/java/com/tencent/mtt/hippy/views/refresh/RefreshWrapper.java @@ -96,15 +96,17 @@ public class RefreshWrapper extends HippyViewGroup void bounceToHead(float toTransY) { - Animator contentAnimator = ObjectAnimator.ofFloat(mContentView, "TranslationY", mContentView.getTranslationY(), toTransY); - contentAnimator.setDuration(mBounceTime); - contentAnimator.setInterpolator(new AccelerateInterpolator()); - Animator wrapperAnimator = ObjectAnimator.ofFloat(mRefreshWrapperItemView, "TranslationY", mRefreshWrapperItemView.getTranslationY(), - toTransY); - wrapperAnimator.setInterpolator(new AccelerateInterpolator()); - wrapperAnimator.setDuration(mBounceTime); - contentAnimator.start(); - wrapperAnimator.start(); + if (mContentView != null && mRefreshWrapperItemView != null) { + Animator contentAnimator = ObjectAnimator.ofFloat(mContentView, "TranslationY", mContentView.getTranslationY(), toTransY); + contentAnimator.setDuration(mBounceTime); + contentAnimator.setInterpolator(new AccelerateInterpolator()); + Animator wrapperAnimator = ObjectAnimator.ofFloat(mRefreshWrapperItemView, "TranslationY", mRefreshWrapperItemView.getTranslationY(), + toTransY); + wrapperAnimator.setInterpolator(new AccelerateInterpolator()); + wrapperAnimator.setDuration(mBounceTime); + contentAnimator.start(); + wrapperAnimator.start(); + } }