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

119 lines
7.4 KiB
Java

package androidx.compose.material3;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.saveable.ListSaverKt;
import androidx.compose.runtime.saveable.Saver;
import androidx.compose.runtime.saveable.SaverScope;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.ranges.RangesKt;
/* compiled from: AppBar.kt */
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0016\b\u0007\u0018\u0000 \u001d2\u00020\u0001:\u0001\u001dB\u001d\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\u0006\u0010\u0005\u001a\u00020\u0003¢\u0006\u0002\u0010\u0006R\u0014\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\u00030\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0011\u0010\t\u001a\u00020\u00038F¢\u0006\u0006\u001a\u0004\b\n\u0010\u000bR+\u0010\r\u001a\u00020\u00032\u0006\u0010\f\u001a\u00020\u00038F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b\u0011\u0010\u0012\u001a\u0004\b\u000e\u0010\u000b\"\u0004\b\u000f\u0010\u0010R$\u0010\u0014\u001a\u00020\u00032\u0006\u0010\u0013\u001a\u00020\u00038F@FX\u0086\u000e¢\u0006\f\u001a\u0004\b\u0015\u0010\u000b\"\u0004\b\u0016\u0010\u0010R+\u0010\u0017\u001a\u00020\u00032\u0006\u0010\f\u001a\u00020\u00038F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b\u001a\u0010\u0012\u001a\u0004\b\u0018\u0010\u000b\"\u0004\b\u0019\u0010\u0010R\u0011\u0010\u001b\u001a\u00020\u00038F¢\u0006\u0006\u001a\u0004\b\u001c\u0010\u000b¨\u0006\u001e"}, d2 = {"Landroidx/compose/material3/TopAppBarState;", "", "initialHeightOffsetLimit", "", "initialHeightOffset", "initialContentOffset", "(FFF)V", "_heightOffset", "Landroidx/compose/runtime/MutableState;", "collapsedFraction", "getCollapsedFraction", "()F", "<set-?>", "contentOffset", "getContentOffset", "setContentOffset", "(F)V", "contentOffset$delegate", "Landroidx/compose/runtime/MutableState;", "newOffset", "heightOffset", "getHeightOffset", "setHeightOffset", "heightOffsetLimit", "getHeightOffsetLimit", "setHeightOffsetLimit", "heightOffsetLimit$delegate", "overlappedFraction", "getOverlappedFraction", "Companion", "material3_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class TopAppBarState {
public static final int $stable = 0;
/* renamed from: Companion, reason: from kotlin metadata */
public static final Companion INSTANCE = new Companion(null);
private static final Saver<TopAppBarState, ?> Saver = ListSaverKt.listSaver(new Function2<SaverScope, TopAppBarState, List<? extends Float>>() { // from class: androidx.compose.material3.TopAppBarState$Companion$Saver$1
@Override // kotlin.jvm.functions.Function2
public final List<Float> invoke(SaverScope listSaver, TopAppBarState it) {
Intrinsics.checkNotNullParameter(listSaver, "$this$listSaver");
Intrinsics.checkNotNullParameter(it, "it");
return CollectionsKt.listOf((Object[]) new Float[]{Float.valueOf(it.getHeightOffsetLimit()), Float.valueOf(it.getHeightOffset()), Float.valueOf(it.getContentOffset())});
}
}, new Function1<List<? extends Float>, TopAppBarState>() { // from class: androidx.compose.material3.TopAppBarState$Companion$Saver$2
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ TopAppBarState invoke(List<? extends Float> list) {
return invoke2((List<Float>) list);
}
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final TopAppBarState invoke2(List<Float> it) {
Intrinsics.checkNotNullParameter(it, "it");
return new TopAppBarState(it.get(0).floatValue(), it.get(1).floatValue(), it.get(2).floatValue());
}
});
private MutableState<Float> _heightOffset;
/* renamed from: contentOffset$delegate, reason: from kotlin metadata */
private final MutableState contentOffset;
/* renamed from: heightOffsetLimit$delegate, reason: from kotlin metadata */
private final MutableState heightOffsetLimit;
public TopAppBarState(float f, float f2, float f3) {
MutableState mutableStateOf$default;
MutableState mutableStateOf$default2;
MutableState<Float> mutableStateOf$default3;
mutableStateOf$default = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(Float.valueOf(f), null, 2, null);
this.heightOffsetLimit = mutableStateOf$default;
mutableStateOf$default2 = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(Float.valueOf(f3), null, 2, null);
this.contentOffset = mutableStateOf$default2;
mutableStateOf$default3 = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(Float.valueOf(f2), null, 2, null);
this._heightOffset = mutableStateOf$default3;
}
/* JADX WARN: Multi-variable type inference failed */
public final float getHeightOffsetLimit() {
return ((Number) this.heightOffsetLimit.getValue()).floatValue();
}
public final void setHeightOffsetLimit(float f) {
this.heightOffsetLimit.setValue(Float.valueOf(f));
}
public final float getHeightOffset() {
return this._heightOffset.getValue().floatValue();
}
public final void setHeightOffset(float f) {
this._heightOffset.setValue(Float.valueOf(RangesKt.coerceIn(f, getHeightOffsetLimit(), 0.0f)));
}
/* JADX WARN: Multi-variable type inference failed */
public final float getContentOffset() {
return ((Number) this.contentOffset.getValue()).floatValue();
}
public final void setContentOffset(float f) {
this.contentOffset.setValue(Float.valueOf(f));
}
public final float getCollapsedFraction() {
if (getHeightOffsetLimit() == 0.0f) {
return 0.0f;
}
return getHeightOffset() / getHeightOffsetLimit();
}
public final float getOverlappedFraction() {
if (getHeightOffsetLimit() == 0.0f) {
return 0.0f;
}
return 1 - (RangesKt.coerceIn(getHeightOffsetLimit() - getContentOffset(), getHeightOffsetLimit(), 0.0f) / getHeightOffsetLimit());
}
/* compiled from: AppBar.kt */
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u001b\u0010\u0003\u001a\f\u0012\u0004\u0012\u00020\u0005\u0012\u0002\b\u00030\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007¨\u0006\b"}, d2 = {"Landroidx/compose/material3/TopAppBarState$Companion;", "", "()V", "Saver", "Landroidx/compose/runtime/saveable/Saver;", "Landroidx/compose/material3/TopAppBarState;", "getSaver", "()Landroidx/compose/runtime/saveable/Saver;", "material3_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final Saver<TopAppBarState, ?> getSaver() {
return TopAppBarState.Saver;
}
}
}