package com.tencent.mm.plugin.story.ui.view;

import a.f.a.a;
import a.f.b.j;
import a.f.b.u.c;
import a.l;
import a.v;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import com.tencent.matrix.trace.core.AppMethodBeat;

@l(dWo = {1, 1, 13}, dWp = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, dWq = {"<anonymous>", "", "it", "Landroid/animation/ValueAnimator;", "kotlin.jvm.PlatformType", "onAnimationUpdate"})
final class CommentItemView$e implements AnimatorUpdateListener {
    final /* synthetic */ CommentItemView siD;
    final /* synthetic */ int siE;
    final /* synthetic */ int siF;
    final /* synthetic */ float siG = 0.1f;
    final /* synthetic */ c siH;
    final /* synthetic */ a siI;

    CommentItemView$e(CommentItemView commentItemView, int i, int i2, c cVar, a aVar) {
        this.siD = commentItemView;
        this.siE = i;
        this.siF = i2;
        this.siH = cVar;
        this.siI = aVar;
    }

    public final void onAnimationUpdate(ValueAnimator valueAnimator) {
        AppMethodBeat.i(110345);
        j.o(valueAnimator, "it");
        Object animatedValue = valueAnimator.getAnimatedValue();
        if (animatedValue == null) {
            v vVar = new v("null cannot be cast to non-null type kotlin.Float");
            AppMethodBeat.o(110345);
            throw vVar;
        }
        a aVar;
        float floatValue = ((Float) animatedValue).floatValue();
        int i = (int) (((float) (this.siE - this.siF)) * (1.0f - floatValue));
        this.siD.setTranslationY((float) i);
        if (floatValue < this.siG) {
            this.siD.setScaleX(floatValue / this.siG);
            this.siD.setScaleY(floatValue / this.siG);
            this.siD.setAlpha(((floatValue / this.siG) * 0.5f) + 0.5f);
        } else {
            this.siD.setScaleX(1.0f);
            this.siD.setScaleY(1.0f);
            this.siD.setAlpha(1.0f);
            aVar = (a) this.siH.AVE;
            if (aVar != null) {
                aVar.invoke();
            }
            this.siH.AVE = null;
            if (!CommentItemView.a(this.siD)) {
                CommentItemView.b(this.siD);
                CommentItemView commentItemView = this.siD;
                long j = 0;
                if (commentItemView.sit.rVi) {
                    LayoutParams layoutParams = commentItemView.getLayoutParams();
                    layoutParams.width = commentItemView.six;
                    layoutParams.height = commentItemView.siw;
                    commentItemView.setLayoutParams(layoutParams);
                } else {
                    ValueAnimator ofFloat = ObjectAnimator.ofFloat(new float[]{0.0f, 1.0f});
                    ofFloat.addUpdateListener(new CommentItemView$d(commentItemView));
                    j.o(ofFloat, "sizeAnimator");
                    ofFloat.setDuration(300);
                    ofFloat.start();
                    j = 300;
                }
                ViewGroup viewGroup = commentItemView.sis;
                if (viewGroup == null) {
                    j.avw("contentLayout");
                }
                viewGroup.setVisibility(0);
                viewGroup = commentItemView.sis;
                if (viewGroup == null) {
                    j.avw("contentLayout");
                }
                viewGroup.setAlpha(0.0f);
                viewGroup = commentItemView.sis;
                if (viewGroup == null) {
                    j.avw("contentLayout");
                }
                ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(viewGroup, "alpha", new float[]{0.0f, 1.0f});
                j.o(ofFloat2, "contentLayoutAnim");
                ofFloat2.setStartDelay(j);
                ofFloat2.setDuration(100);
                ofFloat2.start();
            }
        }
        if (i < 100) {
            this.siD.setAlpha(((float) i) / 100.0f);
        }
        if (this.siD.getAlpha() < 0.05f) {
            ValueAnimator normalAnimator = this.siD.getNormalAnimator();
            if (normalAnimator != null) {
                normalAnimator.removeAllUpdateListeners();
            }
            aVar = this.siI;
            if (aVar != null) {
                aVar.invoke();
                AppMethodBeat.o(110345);
                return;
            }
        }
        AppMethodBeat.o(110345);
    }
}
