ValueAnimator尚未初始化

时间:2020-06-10 17:39:20

标签: java android animation animator

错误在最后一行显示为

变量结果可能尚未初始化

这是我的代码:

 public static void animateLayoutHeight(final View view, int i) {
        final ValueAnimator ofInt = ValueAnimator.ofInt(new int[]{0, i});
        ofInt.setDuration(500);
        ofInt.setInterpolator(new AccelerateDecelerateInterpolator());
        ofInt.addListener(new AnimatorListenerAdapter() {
            public void onAnimationStart(Animator animator) {
                view.setVisibility(0);
            }
        });
        ofInt.addUpdateListener(new AnimatorUpdateListener(view) {
            private final /* synthetic */ View f$0;



            public final void onAnimationUpdate(ValueAnimator valueAnimator) {
                AnimationUtility.lambda$animateLayoutHeight$0(this.f$0, valueAnimator);
            }
        });
        ofInt.start();
    }

0 个答案:

没有答案