mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-15 10:27:17 +01:00
134 lines
7.6 KiB
Java
134 lines
7.6 KiB
Java
package androidx.compose.ui.scrollcapture;
|
|
|
|
import com.amazon.mobile.heremapsexplore.Constants.ReactProperties;
|
|
import defpackage.a$$ExternalSyntheticOutline0;
|
|
import io.ktor.util.PathKt$$ExternalSyntheticBUOutline0;
|
|
import kotlin.Metadata;
|
|
import kotlin.Unit;
|
|
import kotlin.coroutines.Continuation;
|
|
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import kotlin.math.MathKt;
|
|
import kotlin.ranges.RangesKt;
|
|
import okio.Path$$ExternalSyntheticBUOutline0;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0007\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\u0002\n\u0002\b\n\b\u0002\u0018\u00002\u00020\u0001B3\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\"\u0010\u0004\u001a\u001e\b\u0001\u0012\u0004\u0012\u00020\u0006\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u0007\u0012\u0006\u0012\u0004\u0018\u00010\u00010\u0005¢\u0006\u0004\b\b\u0010\tJ\u0006\u0010\u000f\u001a\u00020\u0010J\u001e\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u0012\u001a\u00020\u00032\u0006\u0010\u0013\u001a\u00020\u0003H\u0086@¢\u0006\u0002\u0010\u0014J\u000e\u0010\u0015\u001a\u00020\u00032\u0006\u0010\u0016\u001a\u00020\u0003J\u0016\u0010\u0017\u001a\u00020\u00102\u0006\u0010\u0016\u001a\u00020\u0006H\u0086@¢\u0006\u0002\u0010\u0018J\u0016\u0010\u0004\u001a\u00020\u00102\u0006\u0010\u0019\u001a\u00020\u0006H\u0082@¢\u0006\u0002\u0010\u0018R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R,\u0010\u0004\u001a\u001e\b\u0001\u0012\u0004\u0012\u00020\u0006\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u0007\u0012\u0006\u0012\u0004\u0018\u00010\u00010\u0005X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\nR\u001e\u0010\f\u001a\u00020\u00062\u0006\u0010\u000b\u001a\u00020\u0006@BX\u0086\u000e¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\u000e¨\u0006\u001a"}, d2 = {"Landroidx/compose/ui/scrollcapture/RelativeScroller;", "", "viewportSize", "", "scrollBy", "Lkotlin/Function2;", "", "Lkotlin/coroutines/Continuation;", "<init>", "(ILkotlin/jvm/functions/Function2;)V", "Lkotlin/jvm/functions/Function2;", "value", "scrollAmount", "getScrollAmount", "()F", "reset", "", "scrollRangeIntoView", ReactProperties.GEOFENCE_MINIMUM_RANGE, ReactProperties.GEOFENCE_MAXIMUM_RANGE, "(IILkotlin/coroutines/Continuation;)Ljava/lang/Object;", "mapOffsetToViewport", "offset", "scrollTo", "(FLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "delta", "ui_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nComposeScrollCaptureCallback.android.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ComposeScrollCaptureCallback.android.kt\nandroidx/compose/ui/scrollcapture/RelativeScroller\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,307:1\n1#2:308\n*E\n"})
|
|
/* loaded from: classes13.dex */
|
|
final class RelativeScroller {
|
|
private float scrollAmount;
|
|
|
|
@NotNull
|
|
private final Function2<Float, Continuation<? super Float>, Object> scrollBy;
|
|
private final int viewportSize;
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public RelativeScroller(int i, @NotNull Function2<? super Float, ? super Continuation<? super Float>, ? extends Object> function2) {
|
|
this.viewportSize = i;
|
|
this.scrollBy = function2;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* JADX WARN: Removed duplicated region for block: B:15:0x0030 */
|
|
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final java.lang.Object scrollBy(float r5, kotlin.coroutines.Continuation<? super kotlin.Unit> r6) {
|
|
/*
|
|
r4 = this;
|
|
boolean r0 = r6 instanceof androidx.compose.ui.scrollcapture.RelativeScroller$scrollBy$1
|
|
if (r0 == 0) goto L13
|
|
r0 = r6
|
|
androidx.compose.ui.scrollcapture.RelativeScroller$scrollBy$1 r0 = (androidx.compose.ui.scrollcapture.RelativeScroller$scrollBy$1) r0
|
|
int r1 = r0.label
|
|
r2 = -2147483648(0xffffffff80000000, float:-0.0)
|
|
r3 = r1 & r2
|
|
if (r3 == 0) goto L13
|
|
int r1 = r1 - r2
|
|
r0.label = r1
|
|
goto L18
|
|
L13:
|
|
androidx.compose.ui.scrollcapture.RelativeScroller$scrollBy$1 r0 = new androidx.compose.ui.scrollcapture.RelativeScroller$scrollBy$1
|
|
r0.<init>(r4, r6)
|
|
L18:
|
|
java.lang.Object r6 = r0.result
|
|
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
|
|
int r2 = r0.label
|
|
r3 = 1
|
|
if (r2 == 0) goto L30
|
|
if (r2 != r3) goto L29
|
|
kotlin.ResultKt.throwOnFailure(r6)
|
|
goto L42
|
|
L29:
|
|
java.lang.String r4 = "call to 'resume' before 'invoke' with coroutine"
|
|
rx.Single$$ExternalSyntheticBUOutline0.m$2(r4)
|
|
r4 = 0
|
|
return r4
|
|
L30:
|
|
kotlin.ResultKt.throwOnFailure(r6)
|
|
kotlin.jvm.functions.Function2<java.lang.Float, kotlin.coroutines.Continuation<? super java.lang.Float>, java.lang.Object> r6 = r4.scrollBy
|
|
java.lang.Float r5 = kotlin.coroutines.jvm.internal.Boxing.boxFloat(r5)
|
|
r0.label = r3
|
|
java.lang.Object r6 = r6.invoke(r5, r0)
|
|
if (r6 != r1) goto L42
|
|
return r1
|
|
L42:
|
|
java.lang.Number r6 = (java.lang.Number) r6
|
|
float r5 = r6.floatValue()
|
|
float r6 = r4.scrollAmount
|
|
float r6 = r6 + r5
|
|
r4.scrollAmount = r6
|
|
kotlin.Unit r4 = kotlin.Unit.INSTANCE
|
|
return r4
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.compose.ui.scrollcapture.RelativeScroller.scrollBy(float, kotlin.coroutines.Continuation):java.lang.Object");
|
|
}
|
|
|
|
public final float getScrollAmount() {
|
|
return this.scrollAmount;
|
|
}
|
|
|
|
public final int mapOffsetToViewport(int offset) {
|
|
return RangesKt.coerceIn(offset - MathKt.roundToInt(this.scrollAmount), 0, this.viewportSize);
|
|
}
|
|
|
|
public final void reset() {
|
|
this.scrollAmount = 0.0f;
|
|
}
|
|
|
|
@Nullable
|
|
public final Object scrollRangeIntoView(int i, int i2, @NotNull Continuation<? super Unit> continuation) {
|
|
if (i > i2) {
|
|
Path$$ExternalSyntheticBUOutline0.m((Object) a$$ExternalSyntheticOutline0.m("Expected min=", i, " ≤ max=", i2));
|
|
return null;
|
|
}
|
|
int i3 = i2 - i;
|
|
int i4 = this.viewportSize;
|
|
if (i3 > i4) {
|
|
PathKt$$ExternalSyntheticBUOutline0.m(this.viewportSize, a$$ExternalSyntheticOutline0.m0m(i3, "Expected range (", ") to be ≤ viewportSize="));
|
|
return null;
|
|
}
|
|
float f = i;
|
|
float f2 = this.scrollAmount;
|
|
if (f >= f2 && i2 <= i4 + f2) {
|
|
return Unit.INSTANCE;
|
|
}
|
|
if (f >= f2) {
|
|
i = i2 - i4;
|
|
}
|
|
Object scrollTo = scrollTo(i, continuation);
|
|
return scrollTo == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? scrollTo : Unit.INSTANCE;
|
|
}
|
|
|
|
@Nullable
|
|
public final Object scrollTo(float f, @NotNull Continuation<? super Unit> continuation) {
|
|
Object scrollBy = scrollBy(f - this.scrollAmount, continuation);
|
|
return scrollBy == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? scrollBy : Unit.INSTANCE;
|
|
}
|
|
}
|