package X6FRs_4.JZJr_16;

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

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public int f573KQgRr5e_0 = 80;

    public void KQgRr5e_0(int i) {
        this.f573KQgRr5e_0 = i;
    }

    @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 i2;
        int i3;
        H5YG8fq_22 h5YG8fq_223 = h5YG8fq_22;
        if (h5YG8fq_223 == null && h5YG8fq_222 == null) {
            return 0L;
        }
        Rect epicenter = transition.getEpicenter();
        if (h5YG8fq_222 == null || KQgRr5e_0(h5YG8fq_223) == 0) {
            i = -1;
        } else {
            h5YG8fq_223 = h5YG8fq_222;
            i = 1;
        }
        int QxJ9d_1 = QxJ9d_1(h5YG8fq_223);
        int PGPF6hQ_2 = PGPF6hQ_2(h5YG8fq_223);
        int[] iArr = new int[2];
        viewGroup.getLocationOnScreen(iArr);
        int round = iArr[0] + Math.round(viewGroup.getTranslationX());
        int round2 = iArr[1] + Math.round(viewGroup.getTranslationY());
        int width = round + viewGroup.getWidth();
        int height = round2 + viewGroup.getHeight();
        if (epicenter != null) {
            i2 = epicenter.centerX();
            i3 = epicenter.centerY();
        } else {
            i2 = (round + width) / 2;
            i3 = (round2 + height) / 2;
        }
        float KQgRr5e_0 = KQgRr5e_0(viewGroup, QxJ9d_1, PGPF6hQ_2, i2, i3, round, round2, width, height) / KQgRr5e_0(viewGroup);
        long duration = transition.getDuration();
        if (duration < 0) {
            duration = 300;
        }
        return Math.round((((float) (duration * i)) / this.KQgRr5e_0) * KQgRr5e_0);
    }

    /* JADX WARN: Code restructure failed: missing block: B:10:0x0017, code lost:
        r0 = 3;
     */
    /* JADX WARN: Code restructure failed: missing block: B:17:0x0026, code lost:
        if ((X6FRs_4.IMuAHx_6.EuDEkJe_12.ZzDuCHW_20.Mqv2r_3(r7) == 1) != false) goto L24;
     */
    /* JADX WARN: Code restructure failed: missing block: B:8:0x0013, code lost:
        if ((X6FRs_4.IMuAHx_6.EuDEkJe_12.ZzDuCHW_20.Mqv2r_3(r7) == 1) != false) goto L7;
     */
    /* JADX WARN: Code restructure failed: missing block: B:9:0x0015, code lost:
        r0 = 5;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int KQgRr5e_0(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
        int i9 = this.f573KQgRr5e_0;
        if (i9 != 8388611) {
            if (i9 == 8388613) {
            }
        }
        if (i9 != 3) {
            if (i9 != 5) {
                if (i9 != 48) {
                    if (i9 != 80) {
                        return 0;
                    }
                    return (i2 - i6) + Math.abs(i3 - i);
                }
                return (i8 - i2) + Math.abs(i3 - i);
            }
            return (i - i5) + Math.abs(i4 - i2);
        }
        return (i7 - i) + Math.abs(i4 - i2);
    }

    public final int KQgRr5e_0(ViewGroup viewGroup) {
        int i = this.f573KQgRr5e_0;
        if (i != 3 && i != 5 && i != 8388611 && i != 8388613) {
            return viewGroup.getHeight();
        }
        return viewGroup.getWidth();
    }
}
