package X6FRs_4.JZJr_16;

import android.graphics.Rect;
import android.view.ViewGroup;
import androidx.transition.Transition;
/* compiled from: CircularPropagation.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends B9ET3_39 {
    public float KQgRr5e_0 = 3.0f;

    @Override // X6FRs_4.JZJr_16.ZzDuCHW_20
    public long KQgRr5e_0(ViewGroup viewGroup, Transition transition, H5YG8fq_22 h5YG8fq_22, H5YG8fq_22 h5YG8fq_222) {
        int i;
        int round;
        int i2;
        if (h5YG8fq_22 == null && h5YG8fq_222 == null) {
            return 0L;
        }
        if (h5YG8fq_222 == null || KQgRr5e_0(h5YG8fq_22) == 0) {
            i = -1;
        } else {
            h5YG8fq_22 = h5YG8fq_222;
            i = 1;
        }
        int QxJ9d_1 = QxJ9d_1(h5YG8fq_22);
        int PGPF6hQ_2 = PGPF6hQ_2(h5YG8fq_22);
        Rect epicenter = transition.getEpicenter();
        if (epicenter != null) {
            i2 = epicenter.centerX();
            round = epicenter.centerY();
        } else {
            int[] iArr = new int[2];
            viewGroup.getLocationOnScreen(iArr);
            int round2 = Math.round(iArr[0] + (viewGroup.getWidth() / 2) + viewGroup.getTranslationX());
            round = Math.round(iArr[1] + (viewGroup.getHeight() / 2) + viewGroup.getTranslationY());
            i2 = round2;
        }
        float KQgRr5e_0 = KQgRr5e_0(QxJ9d_1, PGPF6hQ_2, i2, round) / KQgRr5e_0(0.0f, 0.0f, viewGroup.getWidth(), viewGroup.getHeight());
        long duration = transition.getDuration();
        if (duration < 0) {
            duration = 300;
        }
        return Math.round((((float) (duration * i)) / this.KQgRr5e_0) * KQgRr5e_0);
    }

    public static float KQgRr5e_0(float f, float f2, float f3, float f4) {
        float f5 = f3 - f;
        float f6 = f4 - f2;
        return (float) Math.sqrt((f5 * f5) + (f6 * f6));
    }
}
