package ῲ.ᕣ.K;

import android.graphics.Rect;
import java.util.Comparator;
import ῲ.ᕣ.K.AbstractC1703;

/* renamed from: ῲ.ᕣ.K.㸾  reason: contains not printable characters */
/* compiled from: FocusStrategy */
public class C1707<T> implements Comparator<T> {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final Rect f5995 = new Rect();

    /* renamed from: ඓ  reason: contains not printable characters */
    public final AbstractC1702<T> f5996;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Rect f5997 = new Rect();

    /* renamed from: 㸾  reason: contains not printable characters */
    public final boolean f5998;

    public C1707(boolean z, AbstractC1702<T> r3) {
        this.f5998 = z;
        this.f5996 = r3;
    }

    @Override // java.util.Comparator
    public int compare(T t, T t2) {
        Rect rect = this.f5997;
        Rect rect2 = this.f5995;
        ((AbstractC1703.C1706) this.f5996).m4377(t, rect);
        ((AbstractC1703.C1706) this.f5996).m4377(t2, rect2);
        int i = rect.top;
        int i2 = rect2.top;
        if (i < i2) {
            return -1;
        }
        if (i > i2) {
            return 1;
        }
        int i3 = rect.left;
        int i4 = rect2.left;
        if (i3 < i4) {
            if (this.f5998) {
                return 1;
            }
            return -1;
        } else if (i3 <= i4) {
            int i5 = rect.bottom;
            int i6 = rect2.bottom;
            if (i5 < i6) {
                return -1;
            }
            if (i5 > i6) {
                return 1;
            }
            int i7 = rect.right;
            int i8 = rect2.right;
            if (i7 < i8) {
                if (this.f5998) {
                    return 1;
                }
                return -1;
            } else if (i7 <= i8) {
                return 0;
            } else {
                if (this.f5998) {
                    return -1;
                }
                return 1;
            }
        } else if (this.f5998) {
            return -1;
        } else {
            return 1;
        }
    }
}
