Rabbit-R1/switch port/java/sources/androidx/compose/foundation/IndicationKt.java
2024-05-21 17:08:36 -04:00

99 lines
5.9 KiB
Java

package androidx.compose.foundation;
import androidx.compose.foundation.interaction.InteractionSource;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.CompositionLocalKt;
import androidx.compose.runtime.ProvidableCompositionLocal;
import androidx.compose.ui.ComposedModifierKt;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.platform.InspectableValueKt;
import androidx.compose.ui.platform.InspectorInfo;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Indication.kt */
@Metadata(d1 = {"\u0000\u001a\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u001c\u0010\u0005\u001a\u00020\u0006*\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\b\u0010\u0005\u001a\u0004\u0018\u00010\u0002\"\u0017\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004¨\u0006\t"}, d2 = {"LocalIndication", "Landroidx/compose/runtime/ProvidableCompositionLocal;", "Landroidx/compose/foundation/Indication;", "getLocalIndication", "()Landroidx/compose/runtime/ProvidableCompositionLocal;", "indication", "Landroidx/compose/ui/Modifier;", "interactionSource", "Landroidx/compose/foundation/interaction/InteractionSource;", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class IndicationKt {
private static final ProvidableCompositionLocal<Indication> LocalIndication = CompositionLocalKt.staticCompositionLocalOf(new Function0<Indication>() { // from class: androidx.compose.foundation.IndicationKt$LocalIndication$1
/* JADX WARN: Can't rename method to resolve collision */
@Override // kotlin.jvm.functions.Function0
public final Indication invoke() {
return DefaultDebugIndication.INSTANCE;
}
});
public static final ProvidableCompositionLocal<Indication> getLocalIndication() {
return LocalIndication;
}
public static final Modifier indication(Modifier modifier, final InteractionSource interactionSource, final Indication indication) {
Intrinsics.checkNotNullParameter(modifier, "<this>");
Intrinsics.checkNotNullParameter(interactionSource, "interactionSource");
return ComposedModifierKt.composed(modifier, InspectableValueKt.isDebugInspectorInfoEnabled() ? new Function1<InspectorInfo, Unit>() { // from class: androidx.compose.foundation.IndicationKt$indication$$inlined$debugInspectorInfo$1
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(InspectorInfo inspectorInfo) {
invoke2(inspectorInfo);
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(InspectorInfo inspectorInfo) {
Intrinsics.checkNotNullParameter(inspectorInfo, "$this$null");
inspectorInfo.setName("indication");
inspectorInfo.getProperties().set("indication", Indication.this);
inspectorInfo.getProperties().set("interactionSource", interactionSource);
}
} : InspectableValueKt.getNoInspectorInfo(), new Function3<Modifier, Composer, Integer, Modifier>() { // from class: androidx.compose.foundation.IndicationKt$indication$2
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(3);
}
@Override // kotlin.jvm.functions.Function3
public /* bridge */ /* synthetic */ Modifier invoke(Modifier modifier2, Composer composer, Integer num) {
return invoke(modifier2, composer, num.intValue());
}
public final Modifier invoke(Modifier composed, Composer composer, int i) {
Intrinsics.checkNotNullParameter(composed, "$this$composed");
composer.startReplaceableGroup(-353972293);
ComposerKt.sourceInformation(composer, "C109@4825L42,110@4876L71:Indication.kt#71ulvw");
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-353972293, i, -1, "androidx.compose.foundation.indication.<anonymous> (Indication.kt:107)");
}
NoIndication noIndication = Indication.this;
if (noIndication == null) {
noIndication = NoIndication.INSTANCE;
}
IndicationInstance rememberUpdatedInstance = noIndication.rememberUpdatedInstance(interactionSource, composer, 0);
composer.startReplaceableGroup(1157296644);
ComposerKt.sourceInformation(composer, "CC(remember)P(1):Composables.kt#9igjgp");
boolean changed = composer.changed(rememberUpdatedInstance);
Object rememberedValue = composer.rememberedValue();
if (changed || rememberedValue == Composer.INSTANCE.getEmpty()) {
rememberedValue = new IndicationModifier(rememberUpdatedInstance);
composer.updateRememberedValue(rememberedValue);
}
composer.endReplaceableGroup();
IndicationModifier indicationModifier = (IndicationModifier) rememberedValue;
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
return indicationModifier;
}
});
}
}