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

162 lines
9.8 KiB
Java

package androidx.compose.foundation.layout;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.internal.ComposableLambdaKt;
import androidx.compose.ui.Alignment;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.layout.MeasurePolicy;
import androidx.compose.ui.layout.MeasureResult;
import androidx.compose.ui.layout.SubcomposeLayoutKt;
import androidx.compose.ui.layout.SubcomposeMeasureScope;
import androidx.compose.ui.unit.Constraints;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: BoxWithConstraints.kt */
@Metadata(d1 = {"\u00002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001aN\u0010\u0000\u001a\u00020\u00012\b\b\u0002\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072!\u0010\b\u001a\u001d\u0012\u0004\u0012\u00020\n\u0012\u0004\u0012\u00020\u00010\\u0006\u0002\b\u000b¢\u0006\u0002\b\\u0006\u0002\b\rH\u0007¢\u0006\u0002\u0010\u000e¨\u0006\u000f"}, d2 = {"BoxWithConstraints", "", "modifier", "Landroidx/compose/ui/Modifier;", "contentAlignment", "Landroidx/compose/ui/Alignment;", "propagateMinConstraints", "", "content", "Lkotlin/Function1;", "Landroidx/compose/foundation/layout/BoxWithConstraintsScope;", "Landroidx/compose/runtime/Composable;", "Landroidx/compose/ui/UiComposable;", "Lkotlin/ExtensionFunctionType;", "(Landroidx/compose/ui/Modifier;Landroidx/compose/ui/Alignment;ZLkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V", "foundation-layout_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class BoxWithConstraintsKt {
public static final void BoxWithConstraints(Modifier modifier, Alignment alignment, boolean z, final Function3<? super BoxWithConstraintsScope, ? super Composer, ? super Integer, Unit> content, Composer composer, final int i, final int i2) {
final int i3;
Intrinsics.checkNotNullParameter(content, "content");
Composer startRestartGroup = composer.startRestartGroup(1781813501);
ComposerKt.sourceInformation(startRestartGroup, "C(BoxWithConstraints)P(2,1,3)65@3186L67,66@3285L218,66@3258L245:BoxWithConstraints.kt#2w3rfo");
int i4 = i2 & 1;
if (i4 != 0) {
i3 = i | 6;
} else if ((i & 14) == 0) {
i3 = (startRestartGroup.changed(modifier) ? 4 : 2) | i;
} else {
i3 = i;
}
int i5 = i2 & 2;
if (i5 != 0) {
i3 |= 48;
} else if ((i & 112) == 0) {
i3 |= startRestartGroup.changed(alignment) ? 32 : 16;
}
int i6 = i2 & 4;
if (i6 != 0) {
i3 |= 384;
} else if ((i & 896) == 0) {
i3 |= startRestartGroup.changed(z) ? 256 : 128;
}
if ((i2 & 8) != 0) {
i3 |= 3072;
} else if ((i & 7168) == 0) {
i3 |= startRestartGroup.changedInstance(content) ? 2048 : 1024;
}
if ((i3 & 5851) != 1170 || !startRestartGroup.getSkipping()) {
if (i4 != 0) {
modifier = Modifier.INSTANCE;
}
if (i5 != 0) {
alignment = Alignment.INSTANCE.getTopStart();
}
if (i6 != 0) {
z = false;
}
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(1781813501, i3, -1, "androidx.compose.foundation.layout.BoxWithConstraints (BoxWithConstraints.kt:58)");
}
int i7 = i3 >> 3;
final MeasurePolicy rememberBoxMeasurePolicy = BoxKt.rememberBoxMeasurePolicy(alignment, z, startRestartGroup, (i7 & 112) | (i7 & 14));
startRestartGroup.startReplaceableGroup(511388516);
ComposerKt.sourceInformation(startRestartGroup, "CC(remember)P(1,2):Composables.kt#9igjgp");
boolean changed = startRestartGroup.changed(content) | startRestartGroup.changed(rememberBoxMeasurePolicy);
Object rememberedValue = startRestartGroup.rememberedValue();
if (changed || rememberedValue == Composer.INSTANCE.getEmpty()) {
rememberedValue = (Function2) new Function2<SubcomposeMeasureScope, Constraints, MeasureResult>() { // from class: androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$1$1
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(2);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ MeasureResult invoke(SubcomposeMeasureScope subcomposeMeasureScope, Constraints constraints) {
return m427invoke0kLqBqw(subcomposeMeasureScope, constraints.getValue());
}
/* renamed from: invoke-0kLqBqw, reason: not valid java name */
public final MeasureResult m427invoke0kLqBqw(SubcomposeMeasureScope SubcomposeLayout, long j) {
Intrinsics.checkNotNullParameter(SubcomposeLayout, "$this$SubcomposeLayout");
final BoxWithConstraintsScopeImpl boxWithConstraintsScopeImpl = new BoxWithConstraintsScopeImpl(SubcomposeLayout, j, null);
Unit unit = Unit.INSTANCE;
final Function3<BoxWithConstraintsScope, Composer, Integer, Unit> function3 = content;
final int i8 = i3;
return MeasurePolicy.this.mo21measure3p2s80s(SubcomposeLayout, SubcomposeLayout.subcompose(unit, ComposableLambdaKt.composableLambdaInstance(-1945019079, true, new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$1$1$measurables$1
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(2);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Unit invoke(Composer composer2, Integer num) {
invoke(composer2, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(Composer composer2, int i9) {
ComposerKt.sourceInformation(composer2, "C68@3420L9:BoxWithConstraints.kt#2w3rfo");
if ((i9 & 11) == 2 && composer2.getSkipping()) {
composer2.skipToGroupEnd();
return;
}
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-1945019079, i9, -1, "androidx.compose.foundation.layout.BoxWithConstraints.<anonymous>.<anonymous>.<anonymous> (BoxWithConstraints.kt:68)");
}
function3.invoke(boxWithConstraintsScopeImpl, composer2, Integer.valueOf((i8 >> 6) & 112));
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
}
})), j);
}
};
startRestartGroup.updateRememberedValue(rememberedValue);
}
startRestartGroup.endReplaceableGroup();
SubcomposeLayoutKt.SubcomposeLayout(modifier, (Function2) rememberedValue, startRestartGroup, i3 & 14, 0);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
} else {
startRestartGroup.skipToGroupEnd();
}
final Modifier modifier2 = modifier;
final Alignment alignment2 = alignment;
final boolean z2 = z;
ScopeUpdateScope endRestartGroup = startRestartGroup.endRestartGroup();
if (endRestartGroup == null) {
return;
}
endRestartGroup.updateScope(new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$2
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(2);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Unit invoke(Composer composer2, Integer num) {
invoke(composer2, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(Composer composer2, int i8) {
BoxWithConstraintsKt.BoxWithConstraints(Modifier.this, alignment2, z2, content, composer2, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
}
});
}
}