mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
44 lines
3 KiB
Java
44 lines
3 KiB
Java
package androidx.compose.foundation.lazy.layout;
|
|
|
|
import androidx.compose.ui.layout.SubcomposeSlotReusePolicy;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import kotlin.Metadata;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* compiled from: LazyLayout.kt */
|
|
@Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010%\n\u0002\u0010\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u001c\u0010\t\u001a\u00020\n2\b\u0010\u000b\u001a\u0004\u0018\u00010\u00072\b\u0010\f\u001a\u0004\u0018\u00010\u0007H\u0016J\u0010\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u0010H\u0016R\u001c\u0010\u0005\u001a\u0010\u0012\u0006\u0012\u0004\u0018\u00010\u0007\u0012\u0004\u0012\u00020\b0\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0011"}, d2 = {"Landroidx/compose/foundation/lazy/layout/LazyLayoutItemReusePolicy;", "Landroidx/compose/ui/layout/SubcomposeSlotReusePolicy;", "factory", "Landroidx/compose/foundation/lazy/layout/LazyLayoutItemContentFactory;", "(Landroidx/compose/foundation/lazy/layout/LazyLayoutItemContentFactory;)V", "countPerType", "", "", "", "areCompatible", "", "slotId", "reusableSlotId", "getSlotsToRetain", "", "slotIds", "Landroidx/compose/ui/layout/SubcomposeSlotReusePolicy$SlotIdsSet;", "foundation_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
/* loaded from: classes.dex */
|
|
final class LazyLayoutItemReusePolicy implements SubcomposeSlotReusePolicy {
|
|
private final Map<Object, Integer> countPerType;
|
|
private final LazyLayoutItemContentFactory factory;
|
|
|
|
public LazyLayoutItemReusePolicy(LazyLayoutItemContentFactory factory) {
|
|
Intrinsics.checkNotNullParameter(factory, "factory");
|
|
this.factory = factory;
|
|
this.countPerType = new LinkedHashMap();
|
|
}
|
|
|
|
@Override // androidx.compose.ui.layout.SubcomposeSlotReusePolicy
|
|
public void getSlotsToRetain(SubcomposeSlotReusePolicy.SlotIdsSet slotIds) {
|
|
Intrinsics.checkNotNullParameter(slotIds, "slotIds");
|
|
this.countPerType.clear();
|
|
Iterator<Object> it = slotIds.iterator();
|
|
while (it.hasNext()) {
|
|
Object contentType = this.factory.getContentType(it.next());
|
|
Integer num = this.countPerType.get(contentType);
|
|
int intValue = num != null ? num.intValue() : 0;
|
|
if (intValue == 7) {
|
|
it.remove();
|
|
} else {
|
|
this.countPerType.put(contentType, Integer.valueOf(intValue + 1));
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // androidx.compose.ui.layout.SubcomposeSlotReusePolicy
|
|
public boolean areCompatible(Object slotId, Object reusableSlotId) {
|
|
return Intrinsics.areEqual(this.factory.getContentType(slotId), this.factory.getContentType(reusableSlotId));
|
|
}
|
|
}
|