Rabbit-R1/original r1/java/sources/androidx/compose/foundation/pager/PagerLazyLayoutItemProvider.java
2024-05-21 17:08:36 -04:00

141 lines
9.2 KiB
Java

package androidx.compose.foundation.pager;
import androidx.compose.foundation.lazy.layout.IntervalList;
import androidx.compose.foundation.lazy.layout.LazyLayoutIntervalContent;
import androidx.compose.foundation.lazy.layout.LazyLayoutItemProvider;
import androidx.compose.foundation.lazy.layout.LazyLayoutKeyIndexMap;
import androidx.compose.foundation.lazy.layout.LazyLayoutPinnableItemKt;
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 io.sentry.protocol.SentryThread;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function4;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: LazyLayoutPager.kt */
@Metadata(d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0005\b\u0001\u0018\u00002\u00020\u0001B#\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005\u0012\u0006\u0010\u0007\u001a\u00020\\u0006\u0002\u0010\tJ\u001d\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u000b2\u0006\u0010\u0013\u001a\u00020\u0014H\u0017¢\u0006\u0002\u0010\u0015J\u0013\u0010\u0016\u001a\u00020\u00172\b\u0010\u0018\u001a\u0004\u0018\u00010\u0014H\u0096\u0002J\u0010\u0010\u0019\u001a\u00020\u000b2\u0006\u0010\u0013\u001a\u00020\u0014H\u0016J\u0010\u0010\u001a\u001a\u00020\u00142\u0006\u0010\u0012\u001a\u00020\u000bH\u0016J\b\u0010\u001b\u001a\u00020\u000bH\u0016R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\n\u001a\u00020\u000b8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\f\u0010\rR\u000e\u0010\u0007\u001a\u00020\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001c"}, d2 = {"Landroidx/compose/foundation/pager/PagerLazyLayoutItemProvider;", "Landroidx/compose/foundation/lazy/layout/LazyLayoutItemProvider;", SentryThread.JsonKeys.STATE, "Landroidx/compose/foundation/pager/PagerState;", "intervalContent", "Landroidx/compose/foundation/lazy/layout/LazyLayoutIntervalContent;", "Landroidx/compose/foundation/pager/PagerIntervalContent;", "keyIndexMap", "Landroidx/compose/foundation/lazy/layout/LazyLayoutKeyIndexMap;", "(Landroidx/compose/foundation/pager/PagerState;Landroidx/compose/foundation/lazy/layout/LazyLayoutIntervalContent;Landroidx/compose/foundation/lazy/layout/LazyLayoutKeyIndexMap;)V", "itemCount", "", "getItemCount", "()I", "pagerScopeImpl", "Landroidx/compose/foundation/pager/PagerScopeImpl;", "Item", "", "index", "key", "", "(ILjava/lang/Object;Landroidx/compose/runtime/Composer;I)V", "equals", "", "other", "getIndex", "getKey", "hashCode", "foundation_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class PagerLazyLayoutItemProvider implements LazyLayoutItemProvider {
private final LazyLayoutIntervalContent<PagerIntervalContent> intervalContent;
private final LazyLayoutKeyIndexMap keyIndexMap;
private final PagerScopeImpl pagerScopeImpl;
private final PagerState state;
public PagerLazyLayoutItemProvider(PagerState state, LazyLayoutIntervalContent<PagerIntervalContent> intervalContent, LazyLayoutKeyIndexMap keyIndexMap) {
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(intervalContent, "intervalContent");
Intrinsics.checkNotNullParameter(keyIndexMap, "keyIndexMap");
this.state = state;
this.intervalContent = intervalContent;
this.keyIndexMap = keyIndexMap;
this.pagerScopeImpl = PagerScopeImpl.INSTANCE;
}
@Override // androidx.compose.foundation.lazy.layout.LazyLayoutItemProvider
public int getItemCount() {
return this.intervalContent.getItemCount();
}
@Override // androidx.compose.foundation.lazy.layout.LazyLayoutItemProvider
public void Item(final int i, final Object key, Composer composer, final int i2) {
Intrinsics.checkNotNullParameter(key, "key");
Composer startRestartGroup = composer.startRestartGroup(-1201380429);
ComposerKt.sourceInformation(startRestartGroup, "C(Item)188@7566L209:LazyLayoutPager.kt#g6yjnt");
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-1201380429, i2, -1, "androidx.compose.foundation.pager.PagerLazyLayoutItemProvider.Item (LazyLayoutPager.kt:187)");
}
LazyLayoutPinnableItemKt.LazyLayoutPinnableItem(key, i, this.state.getPinnedPages(), ComposableLambdaKt.composableLambda(startRestartGroup, 1142237095, true, new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.pager.PagerLazyLayoutItemProvider$Item$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(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 i3) {
LazyLayoutIntervalContent lazyLayoutIntervalContent;
PagerScopeImpl pagerScopeImpl;
ComposerKt.sourceInformation(composer2, "C*190@7719L32:LazyLayoutPager.kt#g6yjnt");
if ((i3 & 11) != 2 || !composer2.getSkipping()) {
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(1142237095, i3, -1, "androidx.compose.foundation.pager.PagerLazyLayoutItemProvider.Item.<anonymous> (LazyLayoutPager.kt:188)");
}
lazyLayoutIntervalContent = PagerLazyLayoutItemProvider.this.intervalContent;
int i4 = i;
PagerLazyLayoutItemProvider pagerLazyLayoutItemProvider = PagerLazyLayoutItemProvider.this;
IntervalList.Interval interval = lazyLayoutIntervalContent.getIntervals().get(i4);
int startIndex = i4 - interval.getStartIndex();
Function4<PagerScope, Integer, Composer, Integer, Unit> item = ((PagerIntervalContent) interval.getValue()).getItem();
pagerScopeImpl = pagerLazyLayoutItemProvider.pagerScopeImpl;
item.invoke(pagerScopeImpl, Integer.valueOf(startIndex), composer2, 0);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
return;
}
return;
}
composer2.skipToGroupEnd();
}
}), startRestartGroup, ((i2 << 3) & 112) | 3592);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
ScopeUpdateScope endRestartGroup = startRestartGroup.endRestartGroup();
if (endRestartGroup == null) {
return;
}
endRestartGroup.updateScope(new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.pager.PagerLazyLayoutItemProvider$Item$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(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 i3) {
PagerLazyLayoutItemProvider.this.Item(i, key, composer2, RecomposeScopeImplKt.updateChangedFlags(i2 | 1));
}
});
}
@Override // androidx.compose.foundation.lazy.layout.LazyLayoutItemProvider
public Object getKey(int index) {
Object key = this.keyIndexMap.getKey(index);
return key == null ? this.intervalContent.getKey(index) : key;
}
@Override // androidx.compose.foundation.lazy.layout.LazyLayoutItemProvider
public int getIndex(Object key) {
Intrinsics.checkNotNullParameter(key, "key");
return this.keyIndexMap.getIndex(key);
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other instanceof PagerLazyLayoutItemProvider) {
return Intrinsics.areEqual(this.intervalContent, ((PagerLazyLayoutItemProvider) other).intervalContent);
}
return false;
}
public int hashCode() {
return this.intervalContent.hashCode();
}
}