- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
260 lines
9.2 KiB
Java
260 lines
9.2 KiB
Java
package androidx.recyclerview.widget;
|
|
|
|
import androidx.recyclerview.widget.AdapterHelper;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
class OpReorderer {
|
|
final Callback mCallback;
|
|
|
|
public interface Callback {
|
|
AdapterHelper.UpdateOp obtainUpdateOp(int i, int i2, int i3, Object obj);
|
|
|
|
void recycleUpdateOp(AdapterHelper.UpdateOp updateOp);
|
|
}
|
|
|
|
public OpReorderer(Callback callback) {
|
|
this.mCallback = callback;
|
|
}
|
|
|
|
public void reorderOps(List<AdapterHelper.UpdateOp> list) {
|
|
while (true) {
|
|
int lastMoveOutOfOrder = getLastMoveOutOfOrder(list);
|
|
if (lastMoveOutOfOrder == -1) {
|
|
return;
|
|
} else {
|
|
swapMoveOp(list, lastMoveOutOfOrder, lastMoveOutOfOrder + 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void swapMoveOp(List<AdapterHelper.UpdateOp> list, int i, int i2) {
|
|
AdapterHelper.UpdateOp updateOp = list.get(i);
|
|
AdapterHelper.UpdateOp updateOp2 = list.get(i2);
|
|
int i3 = updateOp2.cmd;
|
|
if (i3 == 1) {
|
|
swapMoveAdd(list, i, updateOp, i2, updateOp2);
|
|
} else if (i3 == 2) {
|
|
swapMoveRemove(list, i, updateOp, i2, updateOp2);
|
|
} else {
|
|
if (i3 != 4) {
|
|
return;
|
|
}
|
|
swapMoveUpdate(list, i, updateOp, i2, updateOp2);
|
|
}
|
|
}
|
|
|
|
public void swapMoveRemove(List<AdapterHelper.UpdateOp> list, int i, AdapterHelper.UpdateOp updateOp, int i2, AdapterHelper.UpdateOp updateOp2) {
|
|
boolean z;
|
|
int i3 = updateOp.positionStart;
|
|
int i4 = updateOp.itemCount;
|
|
boolean z2 = false;
|
|
if (i3 < i4) {
|
|
if (updateOp2.positionStart == i3 && updateOp2.itemCount == i4 - i3) {
|
|
z = false;
|
|
z2 = true;
|
|
} else {
|
|
z = false;
|
|
}
|
|
} else if (updateOp2.positionStart == i4 + 1 && updateOp2.itemCount == i3 - i4) {
|
|
z = true;
|
|
z2 = true;
|
|
} else {
|
|
z = true;
|
|
}
|
|
int i5 = updateOp2.positionStart;
|
|
if (i4 < i5) {
|
|
updateOp2.positionStart = i5 - 1;
|
|
} else {
|
|
int i6 = updateOp2.itemCount;
|
|
if (i4 < i5 + i6) {
|
|
updateOp2.itemCount = i6 - 1;
|
|
updateOp.cmd = 2;
|
|
updateOp.itemCount = 1;
|
|
if (updateOp2.itemCount == 0) {
|
|
list.remove(i2);
|
|
this.mCallback.recycleUpdateOp(updateOp2);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
int i7 = updateOp.positionStart;
|
|
int i8 = updateOp2.positionStart;
|
|
AdapterHelper.UpdateOp updateOp3 = null;
|
|
if (i7 <= i8) {
|
|
updateOp2.positionStart = i8 + 1;
|
|
} else {
|
|
int i9 = updateOp2.itemCount;
|
|
if (i7 < i8 + i9) {
|
|
updateOp3 = this.mCallback.obtainUpdateOp(2, i7 + 1, (i8 + i9) - i7, null);
|
|
updateOp2.itemCount = updateOp.positionStart - updateOp2.positionStart;
|
|
}
|
|
}
|
|
if (z2) {
|
|
list.set(i, updateOp2);
|
|
list.remove(i2);
|
|
this.mCallback.recycleUpdateOp(updateOp);
|
|
return;
|
|
}
|
|
if (z) {
|
|
if (updateOp3 != null) {
|
|
int i10 = updateOp.positionStart;
|
|
if (i10 > updateOp3.positionStart) {
|
|
updateOp.positionStart = i10 - updateOp3.itemCount;
|
|
}
|
|
int i11 = updateOp.itemCount;
|
|
if (i11 > updateOp3.positionStart) {
|
|
updateOp.itemCount = i11 - updateOp3.itemCount;
|
|
}
|
|
}
|
|
int i12 = updateOp.positionStart;
|
|
if (i12 > updateOp2.positionStart) {
|
|
updateOp.positionStart = i12 - updateOp2.itemCount;
|
|
}
|
|
int i13 = updateOp.itemCount;
|
|
if (i13 > updateOp2.positionStart) {
|
|
updateOp.itemCount = i13 - updateOp2.itemCount;
|
|
}
|
|
} else {
|
|
if (updateOp3 != null) {
|
|
int i14 = updateOp.positionStart;
|
|
if (i14 >= updateOp3.positionStart) {
|
|
updateOp.positionStart = i14 - updateOp3.itemCount;
|
|
}
|
|
int i15 = updateOp.itemCount;
|
|
if (i15 >= updateOp3.positionStart) {
|
|
updateOp.itemCount = i15 - updateOp3.itemCount;
|
|
}
|
|
}
|
|
int i16 = updateOp.positionStart;
|
|
if (i16 >= updateOp2.positionStart) {
|
|
updateOp.positionStart = i16 - updateOp2.itemCount;
|
|
}
|
|
int i17 = updateOp.itemCount;
|
|
if (i17 >= updateOp2.positionStart) {
|
|
updateOp.itemCount = i17 - updateOp2.itemCount;
|
|
}
|
|
}
|
|
list.set(i, updateOp2);
|
|
if (updateOp.positionStart != updateOp.itemCount) {
|
|
list.set(i2, updateOp);
|
|
} else {
|
|
list.remove(i2);
|
|
}
|
|
if (updateOp3 != null) {
|
|
list.add(i, updateOp3);
|
|
}
|
|
}
|
|
|
|
private void swapMoveAdd(List<AdapterHelper.UpdateOp> list, int i, AdapterHelper.UpdateOp updateOp, int i2, AdapterHelper.UpdateOp updateOp2) {
|
|
int i3 = updateOp.itemCount;
|
|
int i4 = updateOp2.positionStart;
|
|
int i5 = i3 < i4 ? -1 : 0;
|
|
int i6 = updateOp.positionStart;
|
|
if (i6 < i4) {
|
|
i5++;
|
|
}
|
|
if (i4 <= i6) {
|
|
updateOp.positionStart = i6 + updateOp2.itemCount;
|
|
}
|
|
int i7 = updateOp2.positionStart;
|
|
if (i7 <= i3) {
|
|
updateOp.itemCount = i3 + updateOp2.itemCount;
|
|
}
|
|
updateOp2.positionStart = i7 + i5;
|
|
list.set(i, updateOp2);
|
|
list.set(i2, updateOp);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:10:0x0048 */
|
|
/* JADX WARN: Removed duplicated region for block: B:12:0x0056 */
|
|
/* JADX WARN: Removed duplicated region for block: B:14:0x005b */
|
|
/* JADX WARN: Removed duplicated region for block: B:17:? A[RETURN, SYNTHETIC] */
|
|
/* JADX WARN: Removed duplicated region for block: B:18:0x004c */
|
|
/* JADX WARN: Removed duplicated region for block: B:19:0x002b */
|
|
/* JADX WARN: Removed duplicated region for block: B:7:0x0027 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public void swapMoveUpdate(java.util.List<androidx.recyclerview.widget.AdapterHelper.UpdateOp> r9, int r10, androidx.recyclerview.widget.AdapterHelper.UpdateOp r11, int r12, androidx.recyclerview.widget.AdapterHelper.UpdateOp r13) {
|
|
/*
|
|
r8 = this;
|
|
int r0 = r11.itemCount
|
|
int r1 = r13.positionStart
|
|
r2 = 4
|
|
r3 = 1
|
|
r4 = 0
|
|
if (r0 >= r1) goto Ld
|
|
int r1 = r1 - r3
|
|
r13.positionStart = r1
|
|
goto L20
|
|
Ld:
|
|
int r5 = r13.itemCount
|
|
int r1 = r1 + r5
|
|
if (r0 >= r1) goto L20
|
|
int r5 = r5 - r3
|
|
r13.itemCount = r5
|
|
androidx.recyclerview.widget.OpReorderer$Callback r0 = r8.mCallback
|
|
int r1 = r11.positionStart
|
|
java.lang.Object r5 = r13.payload
|
|
androidx.recyclerview.widget.AdapterHelper$UpdateOp r0 = r0.obtainUpdateOp(r2, r1, r3, r5)
|
|
goto L21
|
|
L20:
|
|
r0 = r4
|
|
L21:
|
|
int r1 = r11.positionStart
|
|
int r5 = r13.positionStart
|
|
if (r1 > r5) goto L2b
|
|
int r5 = r5 + r3
|
|
r13.positionStart = r5
|
|
goto L41
|
|
L2b:
|
|
int r6 = r13.itemCount
|
|
int r7 = r5 + r6
|
|
if (r1 >= r7) goto L41
|
|
int r5 = r5 + r6
|
|
int r5 = r5 - r1
|
|
androidx.recyclerview.widget.OpReorderer$Callback r4 = r8.mCallback
|
|
int r1 = r1 + r3
|
|
java.lang.Object r3 = r13.payload
|
|
androidx.recyclerview.widget.AdapterHelper$UpdateOp r4 = r4.obtainUpdateOp(r2, r1, r5, r3)
|
|
int r1 = r13.itemCount
|
|
int r1 = r1 - r5
|
|
r13.itemCount = r1
|
|
L41:
|
|
r9.set(r12, r11)
|
|
int r11 = r13.itemCount
|
|
if (r11 <= 0) goto L4c
|
|
r9.set(r10, r13)
|
|
goto L54
|
|
L4c:
|
|
r9.remove(r10)
|
|
androidx.recyclerview.widget.OpReorderer$Callback r11 = r8.mCallback
|
|
r11.recycleUpdateOp(r13)
|
|
L54:
|
|
if (r0 == 0) goto L59
|
|
r9.add(r10, r0)
|
|
L59:
|
|
if (r4 == 0) goto L5e
|
|
r9.add(r10, r4)
|
|
L5e:
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.OpReorderer.swapMoveUpdate(java.util.List, int, androidx.recyclerview.widget.AdapterHelper$UpdateOp, int, androidx.recyclerview.widget.AdapterHelper$UpdateOp):void");
|
|
}
|
|
|
|
private int getLastMoveOutOfOrder(List<AdapterHelper.UpdateOp> list) {
|
|
boolean z = false;
|
|
for (int size = list.size() - 1; size >= 0; size--) {
|
|
if (list.get(size).cmd != 8) {
|
|
z = true;
|
|
} else if (z) {
|
|
return size;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
}
|