alexandroid/decompiled/jadx/sources/androidx/compose/foundation/gestures/TouchSlopDetector.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

76 lines
5.2 KiB
Java

package androidx.compose.foundation.gestures;
import androidx.compose.ui.geometry.Offset;
import androidx.compose.ui.geometry.OffsetKt;
import androidx.compose.ui.input.pointer.PointerInputChange;
import com.mapbox.maps.plugin.locationcomponent.ModelSourceWrapper;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0006\b\u0002\u0018\u00002\u00020\u0001B\u0011\u0012\n\b\u0002\u0010\u0002\u001a\u0004\u0018\u00010\u0003¢\u0006\u0002\u0010\u0004J#\u0010\n\u001a\u0004\u0018\u00010\b2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000eø\u0001\u0001ø\u0001\u0000¢\u0006\u0002\b\u000fJ\u001d\u0010\u0010\u001a\u00020\b2\u0006\u0010\r\u001a\u00020\u000eH\u0002ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b\u0011\u0010\u0012J\u0006\u0010\u0013\u001a\u00020\u0014J\u0014\u0010\u0015\u001a\u00020\u000e*\u00020\bø\u0001\u0000¢\u0006\u0004\b\u0016\u0010\u0017J\u0014\u0010\u0018\u001a\u00020\u000e*\u00020\bø\u0001\u0000¢\u0006\u0004\b\u0019\u0010\u0017R\u0013\u0010\u0002\u001a\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006R\u0016\u0010\u0007\u001a\u00020\bX\u0082\u000eø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\n\u0002\u0010\t\u0082\u0002\u000b\n\u0005\b¡\u001e0\u0001\n\u0002\b!¨\u0006\u001a"}, d2 = {"Landroidx/compose/foundation/gestures/TouchSlopDetector;", "", ModelSourceWrapper.ORIENTATION, "Landroidx/compose/foundation/gestures/Orientation;", "(Landroidx/compose/foundation/gestures/Orientation;)V", "getOrientation", "()Landroidx/compose/foundation/gestures/Orientation;", "totalPositionChange", "Landroidx/compose/ui/geometry/Offset;", "J", "addPointerInputChange", "dragEvent", "Landroidx/compose/ui/input/pointer/PointerInputChange;", "touchSlop", "", "addPointerInputChange-GcwITfU", "calculatePostSlopOffset", "calculatePostSlopOffset-tuRUvjQ", "(F)J", "reset", "", "crossAxis", "crossAxis-k-4lQ0M", "(J)F", "mainAxis", "mainAxis-k-4lQ0M", "foundation_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
final class TouchSlopDetector {
@Nullable
private final Orientation orientation;
private long totalPositionChange;
public TouchSlopDetector(@Nullable Orientation orientation) {
this.orientation = orientation;
this.totalPositionChange = Offset.INSTANCE.m4416getZeroF1C5BW0();
}
/* renamed from: calculatePostSlopOffset-tuRUvjQ, reason: not valid java name */
private final long m687calculatePostSlopOffsettuRUvjQ(float touchSlop) {
Orientation orientation = this.orientation;
long j = this.totalPositionChange;
if (orientation == null) {
return Offset.m4404minusMKHz9U(this.totalPositionChange, Offset.m4407timestuRUvjQ(Offset.m4395divtuRUvjQ(j, Offset.m4398getDistanceimpl(j)), touchSlop));
}
float m690mainAxisk4lQ0M = m690mainAxisk4lQ0M(j) - (Math.signum(m690mainAxisk4lQ0M(this.totalPositionChange)) * touchSlop);
float m689crossAxisk4lQ0M = m689crossAxisk4lQ0M(this.totalPositionChange);
return this.orientation == Orientation.Horizontal ? OffsetKt.Offset(m690mainAxisk4lQ0M, m689crossAxisk4lQ0M) : OffsetKt.Offset(m689crossAxisk4lQ0M, m690mainAxisk4lQ0M);
}
@Nullable
/* renamed from: addPointerInputChange-GcwITfU, reason: not valid java name */
public final Offset m688addPointerInputChangeGcwITfU(@NotNull PointerInputChange dragEvent, float touchSlop) {
long m4405plusMKHz9U = Offset.m4405plusMKHz9U(this.totalPositionChange, Offset.m4404minusMKHz9U(dragEvent.getPosition(), dragEvent.getPreviousPosition()));
this.totalPositionChange = m4405plusMKHz9U;
if ((this.orientation == null ? Offset.m4398getDistanceimpl(m4405plusMKHz9U) : Math.abs(m690mainAxisk4lQ0M(m4405plusMKHz9U))) >= touchSlop) {
return Offset.m4389boximpl(m687calculatePostSlopOffsettuRUvjQ(touchSlop));
}
return null;
}
/* renamed from: crossAxis-k-4lQ0M, reason: not valid java name */
public final float m689crossAxisk4lQ0M(long j) {
return this.orientation == Orientation.Horizontal ? Offset.m4401getYimpl(j) : Offset.m4400getXimpl(j);
}
@Nullable
public final Orientation getOrientation() {
return this.orientation;
}
/* renamed from: mainAxis-k-4lQ0M, reason: not valid java name */
public final float m690mainAxisk4lQ0M(long j) {
return this.orientation == Orientation.Horizontal ? Offset.m4400getXimpl(j) : Offset.m4401getYimpl(j);
}
public final void reset() {
this.totalPositionChange = Offset.INSTANCE.m4416getZeroF1C5BW0();
}
/* JADX WARN: Multi-variable type inference failed */
public TouchSlopDetector() {
this(null, 1, 0 == true ? 1 : 0);
}
public /* synthetic */ TouchSlopDetector(Orientation orientation, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? null : orientation);
}
}