package com.google.android.material.transformation;

import X.1gt;
import X.C5079OHq;
import X.C6215Okc;
import X.Qsz;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.bytedance.covode.number.Covode;
import java.util.ArrayList;

public class FabTransformationScrimBehavior extends ExpandableTransformationBehavior {
    public final C6215Okc LIZJ = new C6215Okc(75);
    public final C6215Okc LIZLLL = new C6215Okc(0);

    static {
        Covode.recordClassIndex(44068);
    }

    public FabTransformationScrimBehavior() {
    }

    public FabTransformationScrimBehavior(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public boolean layoutDependsOn(1gt r2, View view, View view2) {
        return view2 instanceof Qsz;
    }

    public boolean onTouchEvent(1gt r2, View view, MotionEvent motionEvent) {
        return FabTransformationScrimBehavior.super.onTouchEvent(r2, view, motionEvent);
    }

    public final AnimatorSet LIZIZ(View view, final View view2, final boolean z, boolean z2) {
        C6215Okc okc;
        ObjectAnimator ofFloat;
        ArrayList arrayList = new ArrayList();
        new ArrayList();
        if (z) {
            okc = this.LIZJ;
        } else {
            okc = this.LIZLLL;
        }
        if (z) {
            if (!z2) {
                view2.setAlpha(0.0f);
            }
            ofFloat = ObjectAnimator.ofFloat(view2, View.ALPHA, new float[]{1.0f});
        } else {
            ofFloat = ObjectAnimator.ofFloat(view2, View.ALPHA, new float[]{0.0f});
        }
        okc.LIZ((Animator) ofFloat);
        arrayList.add(ofFloat);
        AnimatorSet animatorSet = new AnimatorSet();
        C5079OHq.LIZ(animatorSet, arrayList);
        animatorSet.addListener(new AnimatorListenerAdapter() {
            static {
                Covode.recordClassIndex(44069);
            }

            public final void onAnimationEnd(Animator animator) {
                if (!z) {
                    view2.setVisibility(4);
                }
            }

            public final void onAnimationStart(Animator animator) {
                if (z) {
                    view2.setVisibility(0);
                }
            }
        });
        return animatorSet;
    }
}
