261 lines
8.5 KiB
Java
261 lines
8.5 KiB
Java
package o;
|
|
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.Paint;
|
|
import android.graphics.Rect;
|
|
import android.graphics.drawable.NinePatchDrawable;
|
|
import android.view.View;
|
|
import android.view.animation.Interpolator;
|
|
import androidx.core.view.ViewCompat;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
|
|
/* renamed from: o.leI, reason: case insensitive filesystem */
|
|
/* loaded from: classes2.dex */
|
|
final class C16147leI extends UeZ {
|
|
private int A;
|
|
private Paint B;
|
|
private int C;
|
|
private float D;
|
|
private int E;
|
|
private JuK F;
|
|
private long G;
|
|
private boolean H;
|
|
private Rect I;
|
|
private int K;
|
|
Interpolator c;
|
|
Interpolator f;
|
|
NinePatchDrawable g;
|
|
boolean h;
|
|
C16549pIo i;
|
|
Interpolator j;
|
|
long k;
|
|
float l;
|
|
float m;
|
|
float n;
|
|
|
|
/* renamed from: o, reason: collision with root package name */
|
|
int f9205o;
|
|
int p;
|
|
int q;
|
|
int r;
|
|
int s;
|
|
int t;
|
|
private float u;
|
|
private float v;
|
|
private Bitmap w;
|
|
private float x;
|
|
private float y;
|
|
private float z;
|
|
|
|
public C16147leI(RecyclerView recyclerView, RecyclerView.zJl zjl, JuK juK) {
|
|
super(recyclerView, zjl);
|
|
this.I = new Rect();
|
|
this.k = 0L;
|
|
this.m = 1.0f;
|
|
this.l = BitmapDescriptorFactory.HUE_RED;
|
|
this.n = 1.0f;
|
|
this.j = null;
|
|
this.f = null;
|
|
this.c = null;
|
|
this.F = juK;
|
|
this.B = new Paint();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.ZqN
|
|
public final void NS_(Canvas canvas, RecyclerView recyclerView, RecyclerView.AcL acL) {
|
|
if (this.w == null) {
|
|
return;
|
|
}
|
|
int min = (int) Math.min(System.currentTimeMillis() - this.G, this.k);
|
|
long j = this.k;
|
|
float f = j > 0 ? min / ((float) j) : 1.0f;
|
|
Interpolator interpolator = this.j;
|
|
float interpolation = interpolator != null ? interpolator.getInterpolation(f) : f;
|
|
float f2 = this.m;
|
|
float f3 = this.u;
|
|
float f4 = ((f2 - f3) * interpolation) + f3;
|
|
float f5 = this.x;
|
|
float f6 = (interpolation * (f2 - f5)) + f5;
|
|
Interpolator interpolator2 = this.c;
|
|
float interpolation2 = ((interpolator2 != null ? interpolator2.getInterpolation(f) : f) * (this.n - 1.0f)) + 1.0f;
|
|
Interpolator interpolator3 = this.f;
|
|
float interpolation3 = (interpolator3 != null ? interpolator3.getInterpolation(f) : f) * this.l;
|
|
if (f4 > BitmapDescriptorFactory.HUE_RED && f6 > BitmapDescriptorFactory.HUE_RED && interpolation2 > BitmapDescriptorFactory.HUE_RED) {
|
|
this.B.setAlpha((int) (255.0f * interpolation2));
|
|
int save = canvas.save();
|
|
canvas.translate(this.s + this.i.a, this.q + this.i.e);
|
|
canvas.scale(f4, f6);
|
|
canvas.rotate(interpolation3);
|
|
canvas.translate(-(this.I.left + this.i.a), -(this.I.top + this.i.e));
|
|
canvas.drawBitmap(this.w, BitmapDescriptorFactory.HUE_RED, BitmapDescriptorFactory.HUE_RED, this.B);
|
|
canvas.restoreToCount(save);
|
|
}
|
|
if (f < 1.0f) {
|
|
ViewCompat.N(this.e);
|
|
}
|
|
this.z = f4;
|
|
this.D = f6;
|
|
this.v = interpolation3;
|
|
this.y = interpolation2;
|
|
}
|
|
|
|
public final void a(C16549pIo c16549pIo, int i, int i2) {
|
|
if (this.H) {
|
|
return;
|
|
}
|
|
View view = this.d.itemView;
|
|
this.i = c16549pIo;
|
|
this.w = NR_(view, null);
|
|
this.t = this.e.getPaddingLeft();
|
|
this.r = this.e.getPaddingTop();
|
|
this.C = BvX.d(this.e.x);
|
|
this.A = BvX.b(this.e.x);
|
|
this.u = view.getScaleX();
|
|
this.x = view.getScaleY();
|
|
this.z = 1.0f;
|
|
this.D = 1.0f;
|
|
this.v = BitmapDescriptorFactory.HUE_RED;
|
|
this.y = 1.0f;
|
|
view.setVisibility(4);
|
|
this.E = i;
|
|
this.K = i2;
|
|
c(true);
|
|
this.e.d(this, -1);
|
|
this.G = System.currentTimeMillis();
|
|
this.H = true;
|
|
}
|
|
|
|
public final void a(C16549pIo c16549pIo, RecyclerView.zJl zjl) {
|
|
if (this.H) {
|
|
if (this.d != zjl) {
|
|
d();
|
|
this.d = zjl;
|
|
}
|
|
this.w = NR_(zjl.itemView, this.g);
|
|
this.i = c16549pIo;
|
|
c(true);
|
|
}
|
|
}
|
|
|
|
public final void a() {
|
|
if (this.H) {
|
|
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();
|
|
b(this.s, this.q);
|
|
if (this.d != null) {
|
|
c(this.d.itemView, this.z, this.D, this.v, this.y);
|
|
}
|
|
if (this.d != null) {
|
|
this.d.itemView.setVisibility(0);
|
|
}
|
|
this.d = null;
|
|
Bitmap bitmap = this.w;
|
|
if (bitmap != null) {
|
|
bitmap.recycle();
|
|
this.w = null;
|
|
}
|
|
this.F = null;
|
|
this.s = 0;
|
|
this.q = 0;
|
|
this.t = 0;
|
|
this.p = 0;
|
|
this.r = 0;
|
|
this.f9205o = 0;
|
|
this.E = 0;
|
|
this.K = 0;
|
|
this.H = false;
|
|
}
|
|
|
|
public final boolean d(int i, int i2) {
|
|
this.E = i;
|
|
this.K = i2;
|
|
return c(false);
|
|
}
|
|
|
|
private Bitmap NR_(View view, NinePatchDrawable ninePatchDrawable) {
|
|
int top = view.getTop();
|
|
int left = view.getLeft();
|
|
int width = view.getWidth();
|
|
int height = view.getHeight();
|
|
int i = this.I.left + width + this.I.right;
|
|
int i2 = this.I.top + height + this.I.bottom;
|
|
view.measure(View.MeasureSpec.makeMeasureSpec(width, 1073741824), View.MeasureSpec.makeMeasureSpec(height, 1073741824));
|
|
view.layout(left, top, width + left, height + top);
|
|
Bitmap createBitmap = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
|
|
Canvas canvas = new Canvas(createBitmap);
|
|
if (ninePatchDrawable != null) {
|
|
ninePatchDrawable.setBounds(0, 0, i, i2);
|
|
ninePatchDrawable.draw(canvas);
|
|
}
|
|
int save = canvas.save();
|
|
canvas.clipRect(this.I.left, this.I.top, i - this.I.right, i2 - this.I.bottom);
|
|
canvas.translate(this.I.left, this.I.top);
|
|
view.draw(canvas);
|
|
canvas.restoreToCount(save);
|
|
return createBitmap;
|
|
}
|
|
|
|
private void b(float f, int i) {
|
|
if (this.d != null) {
|
|
RecyclerView recyclerView = this.e;
|
|
RecyclerView.zJl zjl = this.d;
|
|
float left = this.d.itemView.getLeft();
|
|
float top = i - this.d.itemView.getTop();
|
|
float f2 = f - left;
|
|
RecyclerView.jbe jbeVar = recyclerView.t;
|
|
if (jbeVar != null) {
|
|
jbeVar.endAnimation(zjl);
|
|
}
|
|
zjl.itemView.setTranslationX(f2);
|
|
zjl.itemView.setTranslationY(top);
|
|
}
|
|
}
|
|
|
|
public final void d() {
|
|
if (this.d != null) {
|
|
this.d.itemView.setTranslationX(BitmapDescriptorFactory.HUE_RED);
|
|
this.d.itemView.setTranslationY(BitmapDescriptorFactory.HUE_RED);
|
|
this.d.itemView.setVisibility(0);
|
|
}
|
|
this.d = null;
|
|
}
|
|
|
|
public final void a(RecyclerView.zJl zjl) {
|
|
if (this.d != null) {
|
|
throw new IllegalStateException("A new view holder is attempt to be assigned before invalidating the older one");
|
|
}
|
|
this.d = zjl;
|
|
zjl.itemView.setVisibility(4);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:19:0x00b4 */
|
|
/* JADX WARN: Removed duplicated region for block: B:34:0x00e1 */
|
|
/* JADX WARN: Removed duplicated region for block: B:51:0x0100 A[EDGE_INSN: B:51:0x0100->B:52:0x0100 BREAK A[LOOP:1: B:33:0x00df->B:46:0x00fd], SYNTHETIC] */
|
|
/* JADX WARN: Removed duplicated region for block: B:54:0x0104 */
|
|
/* JADX WARN: Removed duplicated region for block: B:59:0x012c */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final boolean c(boolean r17) {
|
|
/*
|
|
Method dump skipped, instructions count: 436
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: o.C16147leI.c(boolean):boolean");
|
|
}
|
|
}
|