mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-28 21:48:13 +08:00
fix(android): avoid null pointer before bouncing RefreshWrapper
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user