Rabbit-R1/original r1/java/sources/androidx/compose/material3/ButtonElevation.java

161 lines
11 KiB
Java
Raw Normal View History

2024-05-21 16:08:36 -05:00
package androidx.compose.material3;
import androidx.compose.animation.core.Animatable;
import androidx.compose.animation.core.VectorConvertersKt;
import androidx.compose.foundation.interaction.FocusInteraction;
import androidx.compose.foundation.interaction.HoverInteraction;
import androidx.compose.foundation.interaction.Interaction;
import androidx.compose.foundation.interaction.InteractionSource;
import androidx.compose.foundation.interaction.PressInteraction;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.SnapshotStateKt;
import androidx.compose.runtime.State;
import androidx.compose.runtime.snapshots.SnapshotStateList;
import androidx.compose.ui.unit.Dp;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;
/* compiled from: Button.kt */
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001B2\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\u0006\u0010\u0005\u001a\u00020\u0003\u0012\u0006\u0010\u0006\u001a\u00020\u0003\u0012\u0006\u0010\u0007\u001a\u00020\u0003ø\u0001\u0000¢\u0006\u0002\u0010\bJ&\u0010\n\u001a\b\u0012\u0004\u0012\u00020\u00030\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000fH\u0003ø\u0001\u0000¢\u0006\u0002\u0010\u0010J\u0013\u0010\u0011\u001a\u00020\r2\b\u0010\u0012\u001a\u0004\u0018\u00010\u0001H\u0096\u0002J\b\u0010\u0013\u001a\u00020\u0014H\u0016J(\u0010\u0015\u001a\b\u0012\u0004\u0012\u00020\u00030\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000fH\u0001ø\u0001\u0000¢\u0006\u0004\b\u0016\u0010\u0010J(\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00030\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000fH\u0001ø\u0001\u0000¢\u0006\u0004\b\u0018\u0010\u0010R\u0019\u0010\u0002\u001a\u00020\u0003X\u0082\u0004ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\n\u0002\u0010\tR\u0019\u0010\u0007\u001a\u00020\u0003X\u0082\u0004ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\n\u0002\u0010\tR\u0019\u0010\u0005\u001a\u00020\u0003X\u0082\u0004ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\n\u0002\u0010\tR\u0019\u0010\u0006\u001a\u00020\u0003X\u0082\u0004ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\n\u0002\u0010\tR\u0019\u0010\u0004\u001a\u00020\u0003X\u0082\u0004ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\n\u0002\u0010\t\u0082\u0002\u000f\n\u0002\b\u0019\n\u0005\\u001e0\u0001\n\u0002\b!¨\u0006\u0019"}, d2 = {"Landroidx/compose/material3/ButtonElevation;", "", "defaultElevation", "Landroidx/compose/ui/unit/Dp;", "pressedElevation", "focusedElevation", "hoveredElevation", "disabledElevation", "(FFFFFLkotlin/jvm/internal/DefaultConstructorMarker;)V", "F", "animateElevation", "Landroidx/compose/runtime/State;", "enabled", "", "interactionSource", "Landroidx/compose/foundation/interaction/InteractionSource;", "(ZLandroidx/compose/foundation/interaction/InteractionSource;Landroidx/compose/runtime/Composer;I)Landroidx/compose/runtime/State;", "equals", "other", "hashCode", "", "shadowElevation", "shadowElevation$material3_release", "tonalElevation", "tonalElevation$material3_release", "material3_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class ButtonElevation {
public static final int $stable = 0;
private final float defaultElevation;
private final float disabledElevation;
private final float focusedElevation;
private final float hoveredElevation;
private final float pressedElevation;
public /* synthetic */ ButtonElevation(float f, float f2, float f3, float f4, float f5, DefaultConstructorMarker defaultConstructorMarker) {
this(f, f2, f3, f4, f5);
}
private ButtonElevation(float f, float f2, float f3, float f4, float f5) {
this.defaultElevation = f;
this.pressedElevation = f2;
this.focusedElevation = f3;
this.hoveredElevation = f4;
this.disabledElevation = f5;
}
public final State<Dp> tonalElevation$material3_release(boolean z, InteractionSource interactionSource, Composer composer, int i) {
Intrinsics.checkNotNullParameter(interactionSource, "interactionSource");
composer.startReplaceableGroup(-423890235);
ComposerKt.sourceInformation(composer, "C(tonalElevation)785@38071L74:Button.kt#uh7d8r");
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-423890235, i, -1, "androidx.compose.material3.ButtonElevation.tonalElevation (Button.kt:784)");
}
State<Dp> animateElevation = animateElevation(z, interactionSource, composer, (i & 896) | (i & 14) | (i & 112));
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
return animateElevation;
}
public final State<Dp> shadowElevation$material3_release(boolean z, InteractionSource interactionSource, Composer composer, int i) {
Intrinsics.checkNotNullParameter(interactionSource, "interactionSource");
composer.startReplaceableGroup(-2045116089);
ComposerKt.sourceInformation(composer, "C(shadowElevation)804@38844L74:Button.kt#uh7d8r");
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-2045116089, i, -1, "androidx.compose.material3.ButtonElevation.shadowElevation (Button.kt:800)");
}
State<Dp> animateElevation = animateElevation(z, interactionSource, composer, (i & 896) | (i & 14) | (i & 112));
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
return animateElevation;
}
private final State<Dp> animateElevation(boolean z, InteractionSource interactionSource, Composer composer, int i) {
float f;
composer.startReplaceableGroup(-1312510462);
ComposerKt.sourceInformation(composer, "C(animateElevation)812@39093L46,813@39182L1077,813@39148L1111,855@40756L51:Button.kt#uh7d8r");
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-1312510462, i, -1, "androidx.compose.material3.ButtonElevation.animateElevation (Button.kt:808)");
}
composer.startReplaceableGroup(-492369756);
ComposerKt.sourceInformation(composer, "CC(remember):Composables.kt#9igjgp");
Object rememberedValue = composer.rememberedValue();
if (rememberedValue == Composer.INSTANCE.getEmpty()) {
rememberedValue = SnapshotStateKt.mutableStateListOf();
composer.updateRememberedValue(rememberedValue);
}
composer.endReplaceableGroup();
SnapshotStateList snapshotStateList = (SnapshotStateList) rememberedValue;
int i2 = (i >> 3) & 14;
composer.startReplaceableGroup(511388516);
ComposerKt.sourceInformation(composer, "CC(remember)P(1,2):Composables.kt#9igjgp");
boolean changed = composer.changed(interactionSource) | composer.changed(snapshotStateList);
Object rememberedValue2 = composer.rememberedValue();
if (changed || rememberedValue2 == Composer.INSTANCE.getEmpty()) {
rememberedValue2 = (Function2) new ButtonElevation$animateElevation$1$1(interactionSource, snapshotStateList, null);
composer.updateRememberedValue(rememberedValue2);
}
composer.endReplaceableGroup();
EffectsKt.LaunchedEffect(interactionSource, (Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object>) rememberedValue2, composer, i2 | 64);
Interaction interaction = (Interaction) CollectionsKt.lastOrNull((List) snapshotStateList);
if (!z) {
f = this.disabledElevation;
} else if (interaction instanceof PressInteraction.Press) {
f = this.pressedElevation;
} else if (interaction instanceof HoverInteraction.Enter) {
f = this.hoveredElevation;
} else {
f = interaction instanceof FocusInteraction.Focus ? this.focusedElevation : this.defaultElevation;
}
float f2 = f;
composer.startReplaceableGroup(-492369756);
ComposerKt.sourceInformation(composer, "CC(remember):Composables.kt#9igjgp");
Object rememberedValue3 = composer.rememberedValue();
if (rememberedValue3 == Composer.INSTANCE.getEmpty()) {
rememberedValue3 = new Animatable(Dp.m4881boximpl(f2), VectorConvertersKt.getVectorConverter(Dp.INSTANCE), null, null, 12, null);
composer.updateRememberedValue(rememberedValue3);
}
composer.endReplaceableGroup();
Animatable animatable = (Animatable) rememberedValue3;
if (!z) {
composer.startReplaceableGroup(-719930083);
ComposerKt.sourceInformation(composer, "859@40906L52");
EffectsKt.LaunchedEffect(Dp.m4881boximpl(f2), new ButtonElevation$animateElevation$2(animatable, f2, null), composer, 64);
composer.endReplaceableGroup();
} else {
composer.startReplaceableGroup(-719929940);
ComposerKt.sourceInformation(composer, "861@40988L546");
EffectsKt.LaunchedEffect(Dp.m4881boximpl(f2), new ButtonElevation$animateElevation$3(animatable, this, f2, interaction, null), composer, 64);
composer.endReplaceableGroup();
}
State<Dp> asState = animatable.asState();
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
return asState;
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || !(other instanceof ButtonElevation)) {
return false;
}
ButtonElevation buttonElevation = (ButtonElevation) other;
return Dp.m4888equalsimpl0(this.defaultElevation, buttonElevation.defaultElevation) && Dp.m4888equalsimpl0(this.pressedElevation, buttonElevation.pressedElevation) && Dp.m4888equalsimpl0(this.focusedElevation, buttonElevation.focusedElevation) && Dp.m4888equalsimpl0(this.hoveredElevation, buttonElevation.hoveredElevation) && Dp.m4888equalsimpl0(this.disabledElevation, buttonElevation.disabledElevation);
}
public int hashCode() {
return (((((((Dp.m4889hashCodeimpl(this.defaultElevation) * 31) + Dp.m4889hashCodeimpl(this.pressedElevation)) * 31) + Dp.m4889hashCodeimpl(this.focusedElevation)) * 31) + Dp.m4889hashCodeimpl(this.hoveredElevation)) * 31) + Dp.m4889hashCodeimpl(this.disabledElevation);
}
}