Rabbit-R1/original r1/java/sources/androidx/compose/material3/DragGestureDetectorCopyKt.java
2024-05-21 17:08:36 -04:00

176 lines
12 KiB
Java

package androidx.compose.material3;
import androidx.compose.ui.geometry.Offset;
import androidx.compose.ui.input.pointer.AwaitPointerEventScope;
import androidx.compose.ui.input.pointer.PointerEvent;
import androidx.compose.ui.input.pointer.PointerEventKt;
import androidx.compose.ui.input.pointer.PointerEventPass;
import androidx.compose.ui.input.pointer.PointerId;
import androidx.compose.ui.input.pointer.PointerInputChange;
import androidx.compose.ui.input.pointer.PointerType;
import androidx.compose.ui.platform.ViewConfiguration;
import androidx.compose.ui.unit.Dp;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
/* compiled from: DragGestureDetectorCopy.kt */
@Metadata(d1 = {"\u0000Z\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0007\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\u001ag\u0010\u0006\u001a\u0004\u0018\u00010\u0007*\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f26\u0010\r\u001a2\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\u000f\u0012\b\b\u0010\u0012\u0004\b\b(\u0011\u0012\u0013\u0012\u00110\u0005¢\u0006\f\b\u000f\u0012\b\b\u0010\u0012\u0004\b\b(\u0012\u0012\u0004\u0012\u00020\u00130\u000eH\u0080@ø\u0001\u0001ø\u0001\u0000ø\u0001\u0000¢\u0006\u0004\b\u0014\u0010\u0015\u001a]\u0010\u0016\u001a\u0004\u0018\u00010\u0007*\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\u0018\u0010\r\u001a\u0014\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00130\u000e2\u0012\u0010\u0017\u001a\u000e\u0012\u0004\u0012\u00020\u0019\u0012\u0004\u0012\u00020\u00050\u0018H\u0082Hø\u0001\u0001ø\u0001\u0000ø\u0001\u0000¢\u0006\u0004\b\u001a\u0010\u001b\u001a!\u0010\u001c\u001a\u00020\u001d*\u00020\u001e2\u0006\u0010\t\u001a\u00020\nH\u0002ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b\u001f\u0010 \u001a!\u0010!\u001a\u00020\u0005*\u00020\"2\u0006\u0010\u000b\u001a\u00020\fH\u0000ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b#\u0010$\"\u0013\u0010\u0000\u001a\u00020\u0001X\u0082\u0004ø\u0001\u0000¢\u0006\u0004\n\u0002\u0010\u0002\"\u0013\u0010\u0003\u001a\u00020\u0001X\u0082\u0004ø\u0001\u0000¢\u0006\u0004\n\u0002\u0010\u0002\"\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0002\u000b\n\u0002\b\u0019\n\u0005\\u001e0\u0001¨\u0006%"}, d2 = {"defaultTouchSlop", "Landroidx/compose/ui/unit/Dp;", "F", "mouseSlop", "mouseToTouchSlopRatio", "", "awaitHorizontalPointerSlopOrCancellation", "Landroidx/compose/ui/input/pointer/PointerInputChange;", "Landroidx/compose/ui/input/pointer/AwaitPointerEventScope;", "pointerId", "Landroidx/compose/ui/input/pointer/PointerId;", "pointerType", "Landroidx/compose/ui/input/pointer/PointerType;", "onPointerSlopReached", "Lkotlin/Function2;", "Lkotlin/ParameterName;", "name", "change", "overSlop", "", "awaitHorizontalPointerSlopOrCancellation-gDDlDlE", "(Landroidx/compose/ui/input/pointer/AwaitPointerEventScope;JILkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "awaitPointerSlopOrCancellation", "getDragDirectionValue", "Lkotlin/Function1;", "Landroidx/compose/ui/geometry/Offset;", "awaitPointerSlopOrCancellation-pn7EDYM", "(Landroidx/compose/ui/input/pointer/AwaitPointerEventScope;JILkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "isPointerUp", "", "Landroidx/compose/ui/input/pointer/PointerEvent;", "isPointerUp-DmW0f2w", "(Landroidx/compose/ui/input/pointer/PointerEvent;J)Z", "pointerSlop", "Landroidx/compose/ui/platform/ViewConfiguration;", "pointerSlop-E8SPZFQ", "(Landroidx/compose/ui/platform/ViewConfiguration;I)F", "material3_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class DragGestureDetectorCopyKt {
private static final float defaultTouchSlop;
private static final float mouseSlop;
private static final float mouseToTouchSlopRatio;
/* JADX WARN: Removed duplicated region for block: B:15:0x0166 */
/* JADX WARN: Removed duplicated region for block: B:19:0x00b1 A[RETURN] */
/* JADX WARN: Removed duplicated region for block: B:20:0x00b2 */
/* JADX WARN: Removed duplicated region for block: B:23:0x00c9 */
/* JADX WARN: Removed duplicated region for block: B:29:0x00f5 */
/* JADX WARN: Removed duplicated region for block: B:53:0x00e4 A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:58:0x0074 */
/* JADX WARN: Removed duplicated region for block: B:8:0x002a */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:38:0x011c -> B:17:0x0168). Please report as a decompilation issue!!! */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:45:0x015b -> B:11:0x015e). Please report as a decompilation issue!!! */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:49:0x0182 -> B:17:0x0168). Please report as a decompilation issue!!! */
/* renamed from: awaitHorizontalPointerSlopOrCancellation-gDDlDlE, reason: not valid java name */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final java.lang.Object m1187awaitHorizontalPointerSlopOrCancellationgDDlDlE(androidx.compose.ui.input.pointer.AwaitPointerEventScope r19, long r20, int r22, kotlin.jvm.functions.Function2<? super androidx.compose.ui.input.pointer.PointerInputChange, ? super java.lang.Float, kotlin.Unit> r23, kotlin.coroutines.Continuation<? super androidx.compose.ui.input.pointer.PointerInputChange> r24) {
/*
Method dump skipped, instructions count: 392
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.compose.material3.DragGestureDetectorCopyKt.m1187awaitHorizontalPointerSlopOrCancellationgDDlDlE(androidx.compose.ui.input.pointer.AwaitPointerEventScope, long, int, kotlin.jvm.functions.Function2, kotlin.coroutines.Continuation):java.lang.Object");
}
/* renamed from: awaitPointerSlopOrCancellation-pn7EDYM, reason: not valid java name */
private static final Object m1188awaitPointerSlopOrCancellationpn7EDYM(AwaitPointerEventScope awaitPointerEventScope, long j, int i, Function2<? super PointerInputChange, ? super Float, Unit> function2, Function1<? super Offset, Float> function1, Continuation<? super PointerInputChange> continuation) {
float f;
PointerInputChange pointerInputChange;
PointerInputChange pointerInputChange2;
if (m1189isPointerUpDmW0f2w(awaitPointerEventScope.getCurrentEvent(), j)) {
return null;
}
float m1190pointerSlopE8SPZFQ = m1190pointerSlopE8SPZFQ(awaitPointerEventScope.getViewConfiguration(), i);
Ref.LongRef longRef = new Ref.LongRef();
longRef.element = j;
float f2 = 0.0f;
while (true) {
InlineMarker.mark(0);
Object awaitPointerEvent$default = AwaitPointerEventScope.awaitPointerEvent$default(awaitPointerEventScope, null, continuation, 1, null);
InlineMarker.mark(1);
PointerEvent pointerEvent = (PointerEvent) awaitPointerEvent$default;
List<PointerInputChange> changes = pointerEvent.getChanges();
int size = changes.size();
int i2 = 0;
while (true) {
if (i2 >= size) {
f = f2;
pointerInputChange = null;
break;
}
pointerInputChange = changes.get(i2);
f = f2;
if (Boolean.valueOf(PointerId.m3741equalsimpl0(pointerInputChange.getId(), longRef.element)).booleanValue()) {
break;
}
i2++;
f2 = f;
}
Intrinsics.checkNotNull(pointerInputChange);
PointerInputChange pointerInputChange3 = pointerInputChange;
if (pointerInputChange3.isConsumed()) {
return null;
}
if (PointerEventKt.changedToUpIgnoreConsumed(pointerInputChange3)) {
List<PointerInputChange> changes2 = pointerEvent.getChanges();
int size2 = changes2.size();
int i3 = 0;
while (true) {
if (i3 >= size2) {
pointerInputChange2 = null;
break;
}
pointerInputChange2 = changes2.get(i3);
if (Boolean.valueOf(pointerInputChange2.getPressed()).booleanValue()) {
break;
}
i3++;
}
PointerInputChange pointerInputChange4 = pointerInputChange2;
if (pointerInputChange4 == null) {
return null;
}
longRef.element = pointerInputChange4.getId();
} else {
float floatValue = f + (function1.invoke(Offset.m2389boximpl(pointerInputChange3.getPosition())).floatValue() - function1.invoke(Offset.m2389boximpl(pointerInputChange3.getPreviousPosition())).floatValue());
if (Math.abs(floatValue) < m1190pointerSlopE8SPZFQ) {
PointerEventPass pointerEventPass = PointerEventPass.Final;
InlineMarker.mark(0);
awaitPointerEventScope.awaitPointerEvent(pointerEventPass, continuation);
InlineMarker.mark(1);
if (pointerInputChange3.isConsumed()) {
return null;
}
f = floatValue;
} else {
function2.invoke(pointerInputChange3, Float.valueOf(floatValue - (Math.signum(floatValue) * m1190pointerSlopE8SPZFQ)));
if (pointerInputChange3.isConsumed()) {
return pointerInputChange3;
}
f = 0.0f;
f2 = f;
}
}
f2 = f;
}
}
/* renamed from: isPointerUp-DmW0f2w, reason: not valid java name */
private static final boolean m1189isPointerUpDmW0f2w(PointerEvent pointerEvent, long j) {
PointerInputChange pointerInputChange;
List<PointerInputChange> changes = pointerEvent.getChanges();
int size = changes.size();
boolean z = false;
int i = 0;
while (true) {
if (i >= size) {
pointerInputChange = null;
break;
}
pointerInputChange = changes.get(i);
if (PointerId.m3741equalsimpl0(pointerInputChange.getId(), j)) {
break;
}
i++;
}
PointerInputChange pointerInputChange2 = pointerInputChange;
if (pointerInputChange2 != null && pointerInputChange2.getPressed()) {
z = true;
}
return true ^ z;
}
/* renamed from: pointerSlop-E8SPZFQ, reason: not valid java name */
public static final float m1190pointerSlopE8SPZFQ(ViewConfiguration pointerSlop, int i) {
Intrinsics.checkNotNullParameter(pointerSlop, "$this$pointerSlop");
return PointerType.m3829equalsimpl0(i, PointerType.INSTANCE.m3834getMouseT8wyACA()) ? pointerSlop.getTouchSlop() * mouseToTouchSlopRatio : pointerSlop.getTouchSlop();
}
static {
float m4883constructorimpl = Dp.m4883constructorimpl((float) 0.125d);
mouseSlop = m4883constructorimpl;
float m4883constructorimpl2 = Dp.m4883constructorimpl(18);
defaultTouchSlop = m4883constructorimpl2;
mouseToTouchSlopRatio = m4883constructorimpl / m4883constructorimpl2;
}
}