113 lines
2.4 KiB
Java
113 lines
2.4 KiB
Java
package androidx.recyclerview.widget;
|
|
|
|
import android.view.View;
|
|
|
|
/* loaded from: classes.dex */
|
|
class ViewBoundsCheck {
|
|
final Callback a;
|
|
BoundFlags b = new BoundFlags();
|
|
|
|
interface Callback {
|
|
int a();
|
|
|
|
int a(View view);
|
|
|
|
View a(int i);
|
|
|
|
int b();
|
|
|
|
int b(View view);
|
|
}
|
|
|
|
ViewBoundsCheck(Callback callback) {
|
|
this.a = callback;
|
|
}
|
|
|
|
View a(int i, int i2, int i3, int i4) {
|
|
int a = this.a.a();
|
|
int b = this.a.b();
|
|
int i5 = i2 > i ? 1 : -1;
|
|
View view = null;
|
|
while (i != i2) {
|
|
View a2 = this.a.a(i);
|
|
this.b.a(a, b, this.a.a(a2), this.a.b(a2));
|
|
if (i3 != 0) {
|
|
this.b.b();
|
|
this.b.a(i3);
|
|
if (this.b.a()) {
|
|
return a2;
|
|
}
|
|
}
|
|
if (i4 != 0) {
|
|
this.b.b();
|
|
this.b.a(i4);
|
|
if (this.b.a()) {
|
|
view = a2;
|
|
}
|
|
}
|
|
i += i5;
|
|
}
|
|
return view;
|
|
}
|
|
|
|
static class BoundFlags {
|
|
int a = 0;
|
|
int b;
|
|
int c;
|
|
int d;
|
|
int e;
|
|
|
|
BoundFlags() {
|
|
}
|
|
|
|
int a(int i, int i2) {
|
|
if (i > i2) {
|
|
return 1;
|
|
}
|
|
return i == i2 ? 2 : 4;
|
|
}
|
|
|
|
void a(int i, int i2, int i3, int i4) {
|
|
this.b = i;
|
|
this.c = i2;
|
|
this.d = i3;
|
|
this.e = i4;
|
|
}
|
|
|
|
void b() {
|
|
this.a = 0;
|
|
}
|
|
|
|
void a(int i) {
|
|
this.a = i | this.a;
|
|
}
|
|
|
|
boolean a() {
|
|
int i = this.a;
|
|
if ((i & 7) != 0 && (i & (a(this.d, this.b) << 0)) == 0) {
|
|
return false;
|
|
}
|
|
int i2 = this.a;
|
|
if ((i2 & 112) != 0 && (i2 & (a(this.d, this.c) << 4)) == 0) {
|
|
return false;
|
|
}
|
|
int i3 = this.a;
|
|
if ((i3 & 1792) != 0 && (i3 & (a(this.e, this.b) << 8)) == 0) {
|
|
return false;
|
|
}
|
|
int i4 = this.a;
|
|
return (i4 & 28672) == 0 || (i4 & (a(this.e, this.c) << 12)) != 0;
|
|
}
|
|
}
|
|
|
|
boolean a(View view, int i) {
|
|
this.b.a(this.a.a(), this.a.b(), this.a.a(view), this.a.b(view));
|
|
if (i == 0) {
|
|
return false;
|
|
}
|
|
this.b.b();
|
|
this.b.a(i);
|
|
return this.b.a();
|
|
}
|
|
}
|