package com.tencent.mm.plugin.sns.ui.b.b;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.ab;
import java.util.Iterator;

class g$2 extends AnimatorListenerAdapter {
    final /* synthetic */ g rGB;

    g$2(g gVar) {
        this.rGB = gVar;
    }

    public final void onAnimationStart(Animator animator) {
        AppMethodBeat.i(40075);
        if (this.rGB.rGA.eBB) {
            ab.i("MicroMsg.TurnCardAdBackAnimation", "holder is busy");
            Iterator it = this.rGB.rGa.getChildAnimations().iterator();
            while (it.hasNext()) {
                ((Animator) it.next()).cancel();
            }
            AppMethodBeat.o(40075);
            return;
        }
        this.rGB.rGA.eBB = true;
        this.rGB.rGA.rGQ.setAlpha(0.0f);
        this.rGB.rGA.rGR.setAlpha(0.0f);
        this.rGB.rGA.rJf.getLocationInWindow(this.rGB.rGg);
        ab.i("MicroMsg.TurnCardAdBackAnimation", "location in window %s, %s", new Object[]{Integer.valueOf(this.rGB.rGg[0]), Integer.valueOf(this.rGB.rGg[1])});
        this.rGB.rGA.rHB.removeView(this.rGB.rGA.rJf);
        LayoutParams layoutParams = this.rGB.rGA.rHB.getLayoutParams();
        layoutParams.width = this.rGB.rGA.rJf.getWidth();
        layoutParams.height = (this.rGB.rGA.rJf.getHeight() + this.rGB.rGn.topMargin) + this.rGB.rGn.bottomMargin;
        this.rGB.rGA.rHB.setLayoutParams(layoutParams);
        this.rGB.rGj = new FrameLayout.LayoutParams(-2, -2);
        this.rGB.rGj.leftMargin = this.rGB.rGg[0];
        this.rGB.rGj.rightMargin = (this.rGB.rGb.getWidth() - this.rGB.rGj.leftMargin) - this.rGB.rGA.rJf.getWidth();
        this.rGB.rGj.topMargin = this.rGB.rGg[1];
        this.rGB.rGj.bottomMargin = (this.rGB.rGb.getHeight() - this.rGB.rGj.topMargin) - this.rGB.rGA.rJf.getHeight();
        this.rGB.rGb.addView(this.rGB.rGA.rJf, this.rGB.rGj);
        AppMethodBeat.o(40075);
    }
}
