Rabbit-R1/android (non root)/java/sources/androidx/compose/foundation/text/selection/SimpleLayoutKt.java

169 lines
9.8 KiB
Java
Raw Normal View History

2024-05-21 21:08:36 +00:00
package androidx.compose.foundation.text.selection;
import androidx.compose.runtime.Applier;
import androidx.compose.runtime.ComposablesKt;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.CompositionLocalMap;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.SkippableUpdater;
import androidx.compose.runtime.Updater;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.layout.LayoutKt;
import androidx.compose.ui.layout.Measurable;
import androidx.compose.ui.layout.MeasurePolicy;
import androidx.compose.ui.layout.MeasureResult;
import androidx.compose.ui.layout.MeasureScope;
import androidx.compose.ui.layout.Placeable;
import androidx.compose.ui.node.ComposeUiNode;
import java.util.ArrayList;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: SimpleLayout.kt */
@Metadata(d1 = {"\u0000\u001a\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a*\u0010\u0000\u001a\u00020\u00012\b\b\u0002\u0010\u0002\u001a\u00020\u00032\u0011\u0010\u0004\u001a\r\u0012\u0004\u0012\u00020\u00010\u0005¢\u0006\u0002\b\u0006H\u0001¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"SimpleLayout", "", "modifier", "Landroidx/compose/ui/Modifier;", "content", "Lkotlin/Function0;", "Landroidx/compose/runtime/Composable;", "(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class SimpleLayoutKt {
public static final void SimpleLayout(final Modifier modifier, final Function2<? super Composer, ? super Integer, Unit> content, Composer composer, final int i, final int i2) {
int i3;
Intrinsics.checkNotNullParameter(content, "content");
Composer startRestartGroup = composer.startRestartGroup(-2105228848);
ComposerKt.sourceInformation(startRestartGroup, "C(SimpleLayout)P(1)32@1172L592:SimpleLayout.kt#eksfi3");
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;
}
if ((i2 & 2) != 0) {
i3 |= 48;
} else if ((i & 112) == 0) {
i3 |= startRestartGroup.changedInstance(content) ? 32 : 16;
}
if ((i3 & 91) != 18 || !startRestartGroup.getSkipping()) {
if (i4 != 0) {
modifier = Modifier.INSTANCE;
}
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-2105228848, i3, -1, "androidx.compose.foundation.text.selection.SimpleLayout (SimpleLayout.kt:31)");
}
SimpleLayoutKt$SimpleLayout$1 simpleLayoutKt$SimpleLayout$1 = new MeasurePolicy() { // from class: androidx.compose.foundation.text.selection.SimpleLayoutKt$SimpleLayout$1
@Override // androidx.compose.ui.layout.MeasurePolicy
/* renamed from: measure-3p2s80s */
public final MeasureResult mo21measure3p2s80s(MeasureScope Layout, List<? extends Measurable> measurables, long j) {
Intrinsics.checkNotNullParameter(Layout, "$this$Layout");
Intrinsics.checkNotNullParameter(measurables, "measurables");
ArrayList arrayList = new ArrayList(measurables.size());
int size = measurables.size();
int i5 = 0;
for (int i6 = 0; i6 < size; i6++) {
arrayList.add(measurables.get(i6).mo3876measureBRTryo0(j));
}
final ArrayList arrayList2 = arrayList;
int size2 = arrayList2.size();
Integer num = 0;
for (int i7 = 0; i7 < size2; i7++) {
num = Integer.valueOf(Math.max(num.intValue(), ((Placeable) arrayList2.get(i7)).getWidth()));
}
int intValue = num.intValue();
int size3 = arrayList2.size();
for (int i8 = 0; i8 < size3; i8++) {
i5 = Integer.valueOf(Math.max(i5.intValue(), ((Placeable) arrayList2.get(i8)).getHeight()));
}
return MeasureScope.layout$default(Layout, intValue, i5.intValue(), null, new Function1<Placeable.PlacementScope, Unit>() { // from class: androidx.compose.foundation.text.selection.SimpleLayoutKt$SimpleLayout$1$measure$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(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Placeable.PlacementScope placementScope) {
invoke2(placementScope);
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Placeable.PlacementScope layout) {
Intrinsics.checkNotNullParameter(layout, "$this$layout");
List<Placeable> list = arrayList2;
int size4 = list.size();
for (int i9 = 0; i9 < size4; i9++) {
Placeable.PlacementScope.place$default(layout, list.get(i9), 0, 0, 0.0f, 4, null);
}
}
}, 4, null);
}
};
int i5 = ((i3 >> 3) & 14) | ((i3 << 3) & 112);
startRestartGroup.startReplaceableGroup(-1323940314);
ComposerKt.sourceInformation(startRestartGroup, "CC(Layout)P(!1,2)77@3132L23,79@3222L420:Layout.kt#80mrfh");
int currentCompositeKeyHash = ComposablesKt.getCurrentCompositeKeyHash(startRestartGroup, 0);
CompositionLocalMap currentCompositionLocalMap = startRestartGroup.getCurrentCompositionLocalMap();
Function0<ComposeUiNode> constructor = ComposeUiNode.INSTANCE.getConstructor();
Function3<SkippableUpdater<ComposeUiNode>, Composer, Integer, Unit> modifierMaterializerOf = LayoutKt.modifierMaterializerOf(modifier);
int i6 = ((i5 << 9) & 7168) | 6;
if (!(startRestartGroup.getApplier() instanceof Applier)) {
ComposablesKt.invalidApplier();
}
startRestartGroup.startReusableNode();
if (startRestartGroup.getInserting()) {
startRestartGroup.createNode(constructor);
} else {
startRestartGroup.useNode();
}
Composer m2273constructorimpl = Updater.m2273constructorimpl(startRestartGroup);
Updater.m2280setimpl(m2273constructorimpl, simpleLayoutKt$SimpleLayout$1, ComposeUiNode.INSTANCE.getSetMeasurePolicy());
Updater.m2280setimpl(m2273constructorimpl, currentCompositionLocalMap, ComposeUiNode.INSTANCE.getSetResolvedCompositionLocals());
Function2<ComposeUiNode, Integer, Unit> setCompositeKeyHash = ComposeUiNode.INSTANCE.getSetCompositeKeyHash();
if (m2273constructorimpl.getInserting() || !Intrinsics.areEqual(m2273constructorimpl.rememberedValue(), Integer.valueOf(currentCompositeKeyHash))) {
m2273constructorimpl.updateRememberedValue(Integer.valueOf(currentCompositeKeyHash));
m2273constructorimpl.apply(Integer.valueOf(currentCompositeKeyHash), setCompositeKeyHash);
}
modifierMaterializerOf.invoke(SkippableUpdater.m2264boximpl(SkippableUpdater.m2265constructorimpl(startRestartGroup)), startRestartGroup, Integer.valueOf((i6 >> 3) & 112));
startRestartGroup.startReplaceableGroup(2058660585);
content.invoke(startRestartGroup, Integer.valueOf((i6 >> 9) & 14));
startRestartGroup.endReplaceableGroup();
startRestartGroup.endNode();
startRestartGroup.endReplaceableGroup();
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
} else {
startRestartGroup.skipToGroupEnd();
}
ScopeUpdateScope endRestartGroup = startRestartGroup.endRestartGroup();
if (endRestartGroup == null) {
return;
}
endRestartGroup.updateScope(new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.text.selection.SimpleLayoutKt$SimpleLayout$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 i7) {
SimpleLayoutKt.SimpleLayout(Modifier.this, content, composer2, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
}
});
}
}