what-the-bank/sources/o/C15730iBR.java

183 lines
5.8 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.view.View;
import android.view.animation.Interpolator;
import androidx.core.view.ViewCompat;
import androidx.core.view.ViewPropertyAnimatorCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
/* renamed from: o.iBR, reason: case insensitive filesystem */
/* loaded from: classes2.dex */
final class C15730iBR extends UeZ {
private static final InterfaceC15687hkl h = new InterfaceC15687hkl() { // from class: o.iBR.4
@Override // o.InterfaceC15687hkl
public final void b(View view) {
}
@Override // o.InterfaceC15687hkl
public final void e(View view) {
}
@Override // o.InterfaceC15687hkl
public final void d(View view) {
ViewCompat.b(view).b((InterfaceC15687hkl) null);
view.setTranslationX(BitmapDescriptorFactory.HUE_RED);
view.setTranslationY(BitmapDescriptorFactory.HUE_RED);
}
};
RecyclerView.zJl c;
int f;
Interpolator g;
private float i;
int j;
private boolean k;
private float l;
private C16549pIo m;
private final Rect n;
/* renamed from: o, reason: collision with root package name */
private final Rect f9169o;
private final Rect q;
private boolean t;
public C15730iBR(RecyclerView recyclerView, RecyclerView.zJl zjl, C16549pIo c16549pIo) {
super(recyclerView, zjl);
this.n = new Rect();
this.q = new Rect();
Rect rect = new Rect();
this.f9169o = rect;
this.m = c16549pIo;
RecyclerView.tOB tob = this.e.x;
BvX.Oe_(this.d.itemView, rect);
}
public final void a(RecyclerView.zJl zjl) {
RecyclerView.zJl zjl2 = this.c;
if (zjl2 == zjl) {
return;
}
if (zjl2 != null) {
ViewPropertyAnimatorCompat b = ViewCompat.b(zjl2.itemView);
b.d();
b.b(10L).e(BitmapDescriptorFactory.HUE_RED).j(BitmapDescriptorFactory.HUE_RED).b(h).c();
}
this.c = zjl;
if (zjl != null) {
ViewCompat.b(zjl.itemView).d();
}
this.t = true;
}
@Override // androidx.recyclerview.widget.RecyclerView.ZqN
public final void apA_(Canvas canvas, RecyclerView recyclerView) {
RecyclerView.zJl zjl = this.d;
RecyclerView.zJl zjl2 = this.c;
if (zjl == null || zjl2 == null || zjl.getItemId() != this.m.c) {
return;
}
View view = zjl2.itemView;
int layoutPosition = zjl.getLayoutPosition();
int layoutPosition2 = zjl2.getLayoutPosition();
RecyclerView.tOB tob = this.e.x;
BvX.Oe_(view, this.n);
BvX.Of_(view, this.q);
Rect rect = this.q;
Rect rect2 = this.n;
int height = view.getHeight() + rect.top + rect.bottom + rect2.top + rect2.bottom;
int width = view.getWidth() + rect.left + rect.right + rect2.left + rect2.right;
float left = width != 0 ? (zjl.itemView.getLeft() - this.f) / width : 0.0f;
float top = height != 0 ? (zjl.itemView.getTop() - this.j) / height : 0.0f;
int d = BvX.d(this.e.x);
if (d == 1) {
left = layoutPosition > layoutPosition2 ? top : top + 1.0f;
} else if (d != 0) {
left = 0.0f;
} else if (layoutPosition <= layoutPosition2) {
left += 1.0f;
}
float min = Math.min(Math.max(left, BitmapDescriptorFactory.HUE_RED), 1.0f);
this.l = min;
if (this.t) {
this.t = false;
} else {
float f = (this.i * 0.7f) + (0.3f * min);
if (Math.abs(f - min) >= 0.01f) {
min = f;
}
}
this.i = min;
b(zjl, zjl2, min);
}
private void b(RecyclerView.zJl zjl, RecyclerView.zJl zjl2, float f) {
View view = zjl2.itemView;
int layoutPosition = zjl.getLayoutPosition();
int layoutPosition2 = zjl2.getLayoutPosition();
Rect rect = this.m.j;
Rect rect2 = this.f9169o;
int i = this.m.d + rect.top + rect.bottom + rect2.top + rect2.bottom;
int i2 = this.m.f + rect.left + rect.right + rect2.left + rect2.right;
Interpolator interpolator = this.g;
if (interpolator != null) {
f = interpolator.getInterpolation(f);
}
int d = BvX.d(this.e.x);
if (d == 0) {
if (layoutPosition > layoutPosition2) {
view.setTranslationX(f * i2);
return;
} else {
view.setTranslationX((f - 1.0f) * i2);
return;
}
}
if (d == 1) {
if (layoutPosition > layoutPosition2) {
view.setTranslationY(f * i);
} else {
view.setTranslationY((f - 1.0f) * i);
}
}
}
public final void d() {
if (this.k) {
return;
}
this.e.d(this, 0);
this.k = true;
}
public final void a() {
if (this.k) {
this.e.e(this);
}
RecyclerView.jbe jbeVar = this.e.t;
if (jbeVar != null) {
jbeVar.endAnimations();
}
RecyclerView recyclerView = this.e;
if (recyclerView.O != 0) {
recyclerView.O = 0;
recyclerView.a();
recyclerView.c(0);
}
recyclerView.a();
if (this.c != null) {
b(this.d, this.c, this.i);
c(this.c.itemView, 1.0f, 1.0f, BitmapDescriptorFactory.HUE_RED, 1.0f);
this.c = null;
}
this.d = null;
this.f = 0;
this.j = 0;
this.i = BitmapDescriptorFactory.HUE_RED;
this.l = BitmapDescriptorFactory.HUE_RED;
this.k = false;
this.m = null;
}
}