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

import a.f.b.j;
import a.f.b.u.c;
import a.l;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.PointF;
import android.graphics.drawable.GradientDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.story.model.b.a;
import com.tencent.mm.sdk.platformtools.ab;

@l(dWo = {1, 1, 13}, dWp = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, dWq = {"<anonymous>", "", "run"})
final class CommentsContainer$b implements Runnable {
    final /* synthetic */ a sfO;
    final /* synthetic */ int siE;
    final /* synthetic */ CommentsContainer siQ;
    final /* synthetic */ CommentItemView siR;

    CommentsContainer$b(CommentsContainer commentsContainer, CommentItemView commentItemView, a aVar, int i) {
        this.siQ = commentsContainer;
        this.siR = commentItemView;
        this.sfO = aVar;
        this.siE = i;
    }

    public final void run() {
        AppMethodBeat.i(110368);
        View maskView = this.siR.getMaskView();
        CommentsContainer.a aVar = CommentsContainer.siP;
        Context context = this.siQ.getContext();
        j.o(context, "context");
        a aVar2 = this.sfO;
        j.p(context, "context");
        j.p(aVar2, "comment");
        int color = context.getResources().getColor(2131689547);
        int color2 = context.getResources().getColor(2131690525);
        if (aVar2.rVh) {
            color2 = color;
        }
        float fromDPToPix = (float) com.tencent.mm.bz.a.fromDPToPix(context, 24);
        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setColor(color2);
        gradientDrawable.setCornerRadius(fromDPToPix);
        maskView.setBackground(gradientDrawable);
        this.siR.setVisibility(0);
        int measuredHeight = this.siR.getMeasuredHeight();
        CommentsContainer.a(this.siQ, ((long) com.tencent.mm.bz.a.ao(this.siQ.getContext(), this.siE - this.siQ.getPaddingBottom())) * 9);
        if (CommentsContainer.a(this.siQ) <= 0) {
            CommentsContainer.a(this.siQ, 4000);
        }
        CommentItemView commentItemView = this.siR;
        long a = CommentsContainer.a(this.siQ);
        int paddingBottom = this.siQ.getPaddingBottom();
        int i = this.siE - (measuredHeight / 2);
        a.f.a.a aVar3 = (a.f.a.a) new 1(this);
        a.f.a.a aVar4 = (a.f.a.a) new 2(this);
        commentItemView.six = commentItemView.getMeasuredWidth();
        commentItemView.siw = commentItemView.getMeasuredHeight();
        ViewGroup viewGroup = commentItemView.sis;
        if (viewGroup == null) {
            j.avw("contentLayout");
        }
        viewGroup.setVisibility(8);
        LayoutParams layoutParams = commentItemView.getLayoutParams();
        layoutParams.height = commentItemView.siv;
        layoutParams.width = commentItemView.siv;
        commentItemView.setLayoutParams(layoutParams);
        ab.i("MicroMsg.CommentItemView", "LogStory: animation start " + commentItemView.siv + ", " + commentItemView.six + ' ' + commentItemView.siw);
        c cVar = new c();
        cVar.AVE = aVar3;
        CommentItemView.c cVar2 = new CommentItemView.c(new PointF(0.05f, 0.1f));
        commentItemView.siq = ObjectAnimator.ofFloat(new float[]{0.0f, 1.0f});
        ValueAnimator valueAnimator = commentItemView.siq;
        if (valueAnimator != null) {
            valueAnimator.setInterpolator((TimeInterpolator) cVar2);
        }
        ValueAnimator valueAnimator2 = commentItemView.siq;
        if (valueAnimator2 != null) {
            valueAnimator2.setDuration(a);
        }
        valueAnimator = commentItemView.siq;
        if (valueAnimator != null) {
            valueAnimator.addUpdateListener(new CommentItemView$e(commentItemView, i, paddingBottom, cVar, aVar4));
        }
        valueAnimator2 = commentItemView.siq;
        if (valueAnimator2 != null) {
            valueAnimator2.start();
        }
        CommentsContainer.b(this.siQ, ((long) (com.tencent.mm.bz.a.ao(this.siQ.getContext(), measuredHeight) + 96)) * 6);
        if (CommentsContainer.d(this.siQ) == CommentsContainer.e(this.siQ).size() - 1) {
            CommentsContainer.b(this.siQ, CommentsContainer.a(this.siQ));
            this.siQ.postDelayed(CommentsContainer.f(this.siQ), CommentsContainer.c(this.siQ));
        }
        this.siQ.postDelayed(CommentsContainer.g(this.siQ), CommentsContainer.c(this.siQ));
        AppMethodBeat.o(110368);
    }
}
