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

171 lines
11 KiB
Java

package androidx.compose.foundation.selection;
import androidx.compose.foundation.ClickableKt;
import androidx.compose.foundation.Indication;
import androidx.compose.foundation.IndicationKt;
import androidx.compose.foundation.interaction.InteractionSourceKt;
import androidx.compose.foundation.interaction.MutableInteractionSource;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
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 androidx.compose.ui.semantics.Role;
import androidx.compose.ui.semantics.SemanticsModifierKt;
import androidx.compose.ui.semantics.SemanticsPropertiesKt;
import androidx.compose.ui.semantics.SemanticsPropertyReceiver;
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: Selectable.kt */
@Metadata(d1 = {"\u0000.\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u001aS\u0010\u0000\u001a\u00020\u0001*\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\b\u0010\u0006\u001a\u0004\u0018\u00010\u00072\b\b\u0002\u0010\b\u001a\u00020\u00032\n\b\u0002\u0010\t\u001a\u0004\u0018\u00010\n2\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\r0\\u0001\u0000ø\u0001\u0001¢\u0006\u0002\b\u000e\u001aA\u0010\u0000\u001a\u00020\u0001*\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\b\u001a\u00020\u00032\n\b\u0002\u0010\t\u001a\u0004\u0018\u00010\n2\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\r0\\u0001\u0000ø\u0001\u0001¢\u0006\u0002\b\u000f\u0082\u0002\u000b\n\u0005\\u001e0\u0001\n\u0002\b\u0019¨\u0006\u0010"}, d2 = {"selectable", "Landroidx/compose/ui/Modifier;", "selected", "", "interactionSource", "Landroidx/compose/foundation/interaction/MutableInteractionSource;", "indication", "Landroidx/compose/foundation/Indication;", "enabled", "role", "Landroidx/compose/ui/semantics/Role;", "onClick", "Lkotlin/Function0;", "", "selectable-O2vRcR0", "selectable-XHw0xAI", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class SelectableKt {
/* renamed from: selectable-XHw0xAI$default, reason: not valid java name */
public static /* synthetic */ Modifier m717selectableXHw0xAI$default(Modifier modifier, boolean z, boolean z2, Role role, Function0 function0, int i, Object obj) {
if ((i & 2) != 0) {
z2 = true;
}
if ((i & 4) != 0) {
role = null;
}
return m716selectableXHw0xAI(modifier, z, z2, role, function0);
}
/* renamed from: selectable-O2vRcR0$default, reason: not valid java name */
public static /* synthetic */ Modifier m715selectableO2vRcR0$default(Modifier modifier, boolean z, MutableInteractionSource mutableInteractionSource, Indication indication, boolean z2, Role role, Function0 function0, int i, Object obj) {
if ((i & 8) != 0) {
z2 = true;
}
boolean z3 = z2;
if ((i & 16) != 0) {
role = null;
}
return m714selectableO2vRcR0(modifier, z, mutableInteractionSource, indication, z3, role, function0);
}
/* renamed from: selectable-XHw0xAI, reason: not valid java name */
public static final Modifier m716selectableXHw0xAI(Modifier selectable, final boolean z, final boolean z2, final Role role, final Function0<Unit> onClick) {
Intrinsics.checkNotNullParameter(selectable, "$this$selectable");
Intrinsics.checkNotNullParameter(onClick, "onClick");
return ComposedModifierKt.composed(selectable, InspectableValueKt.isDebugInspectorInfoEnabled() ? new Function1<InspectorInfo, Unit>() { // from class: androidx.compose.foundation.selection.SelectableKt$selectable-XHw0xAI$$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("selectable");
inspectorInfo.getProperties().set("selected", Boolean.valueOf(z));
inspectorInfo.getProperties().set("enabled", Boolean.valueOf(z2));
inspectorInfo.getProperties().set("role", role);
inspectorInfo.getProperties().set("onClick", onClick);
}
} : InspectableValueKt.getNoInspectorInfo(), new Function3<Modifier, Composer, Integer, Modifier>() { // from class: androidx.compose.foundation.selection.SelectableKt$selectable$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 modifier, Composer composer, Integer num) {
return invoke(modifier, composer, num.intValue());
}
public final Modifier invoke(Modifier composed, Composer composer, int i) {
Intrinsics.checkNotNullParameter(composed, "$this$composed");
composer.startReplaceableGroup(-2124609672);
ComposerKt.sourceInformation(composer, "C72@2940L39,73@3018L7:Selectable.kt#gro6r2");
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-2124609672, i, -1, "androidx.compose.foundation.selection.selectable.<anonymous> (Selectable.kt:67)");
}
Modifier.Companion companion = Modifier.INSTANCE;
composer.startReplaceableGroup(-492369756);
ComposerKt.sourceInformation(composer, "CC(remember):Composables.kt#9igjgp");
Object rememberedValue = composer.rememberedValue();
if (rememberedValue == Composer.INSTANCE.getEmpty()) {
rememberedValue = InteractionSourceKt.MutableInteractionSource();
composer.updateRememberedValue(rememberedValue);
}
composer.endReplaceableGroup();
MutableInteractionSource mutableInteractionSource = (MutableInteractionSource) rememberedValue;
ProvidableCompositionLocal<Indication> localIndication = IndicationKt.getLocalIndication();
ComposerKt.sourceInformationMarkerStart(composer, 2023513938, "CC:CompositionLocal.kt#9igjgp");
Object consume = composer.consume(localIndication);
ComposerKt.sourceInformationMarkerEnd(composer);
Modifier m714selectableO2vRcR0 = SelectableKt.m714selectableO2vRcR0(companion, z, mutableInteractionSource, (Indication) consume, z2, role, onClick);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
return m714selectableO2vRcR0;
}
});
}
/* renamed from: selectable-O2vRcR0, reason: not valid java name */
public static final Modifier m714selectableO2vRcR0(Modifier selectable, final boolean z, final MutableInteractionSource interactionSource, final Indication indication, final boolean z2, final Role role, final Function0<Unit> onClick) {
Intrinsics.checkNotNullParameter(selectable, "$this$selectable");
Intrinsics.checkNotNullParameter(interactionSource, "interactionSource");
Intrinsics.checkNotNullParameter(onClick, "onClick");
Function1<InspectorInfo, Unit> noInspectorInfo = InspectableValueKt.isDebugInspectorInfoEnabled() ? new Function1<InspectorInfo, Unit>() { // from class: androidx.compose.foundation.selection.SelectableKt$selectable-O2vRcR0$$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("selectable");
inspectorInfo.getProperties().set("selected", Boolean.valueOf(z));
inspectorInfo.getProperties().set("interactionSource", interactionSource);
inspectorInfo.getProperties().set("indication", indication);
inspectorInfo.getProperties().set("enabled", Boolean.valueOf(z2));
inspectorInfo.getProperties().set("role", role);
inspectorInfo.getProperties().set("onClick", onClick);
}
} : InspectableValueKt.getNoInspectorInfo();
Modifier.Companion companion = Modifier.INSTANCE;
return InspectableValueKt.inspectableWrapper(selectable, noInspectorInfo, SemanticsModifierKt.semantics$default(ClickableKt.m200clickableO2vRcR0$default(Modifier.INSTANCE, interactionSource, indication, z2, null, role, onClick, 8, null), false, new Function1<SemanticsPropertyReceiver, Unit>() { // from class: androidx.compose.foundation.selection.SelectableKt$selectable$4$1
/* JADX INFO: Access modifiers changed from: package-private */
/* 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(SemanticsPropertyReceiver semanticsPropertyReceiver) {
invoke2(semanticsPropertyReceiver);
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(SemanticsPropertyReceiver semantics) {
Intrinsics.checkNotNullParameter(semantics, "$this$semantics");
SemanticsPropertiesKt.setSelected(semantics, z);
}
}, 1, null));
}
}