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

371 lines
26 KiB
Java

package androidx.compose.foundation.layout;
import android.view.View;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.DisposableEffectResult;
import androidx.compose.runtime.DisposableEffectScope;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.ProvidableCompositionLocal;
import androidx.compose.runtime.snapshots.Snapshot;
import androidx.compose.ui.platform.AndroidCompositionLocals_androidKt;
import androidx.core.graphics.Insets;
import androidx.core.view.DisplayCutoutCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import io.sentry.protocol.SentryThread;
import java.util.WeakHashMap;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: WindowInsets.android.kt */
@Metadata(d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0017\n\u0002\u0010\u0002\n\u0002\b\b\b\u0000\u0018\u0000 E2\u00020\u0001:\u0001EB\u0019\b\u0002\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u000e\u0010=\u001a\u00020>2\u0006\u0010\u0004\u001a\u00020\u0005J\u000e\u0010?\u001a\u00020>2\u0006\u0010\u0004\u001a\u00020\u0005J\u0018\u0010@\u001a\u00020>2\u0006\u0010A\u001a\u00020\u00032\b\b\u0002\u0010B\u001a\u00020\bJ\u000e\u0010C\u001a\u00020>2\u0006\u0010A\u001a\u00020\u0003J\u000e\u0010D\u001a\u00020>2\u0006\u0010A\u001a\u00020\u0003R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0011\u0010\t\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\fR\u0011\u0010\r\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u0010R\u0011\u0010\u0011\u001a\u00020\u0012¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\u0014R\u0011\u0010\u0015\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b\u0016\u0010\fR\u0011\u0010\u0017\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b\u0018\u0010\fR\u0011\u0010\u0019\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u001a\u0010\u0010R\u0011\u0010\u001b\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u001c\u0010\u0010R\u000e\u0010\u001d\u001a\u00020\u001eX\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u001f\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b \u0010\fR\u0011\u0010!\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b\"\u0010\fR\u0011\u0010#\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b$\u0010\u0010R\u0011\u0010%\u001a\u00020&¢\u0006\b\n\u0000\u001a\u0004\b'\u0010(R\u0011\u0010)\u001a\u00020&¢\u0006\b\n\u0000\u001a\u0004\b*\u0010(R\u0011\u0010+\u001a\u00020&¢\u0006\b\n\u0000\u001a\u0004\b,\u0010(R\u0011\u0010-\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b.\u0010\fR\u0011\u0010/\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b0\u0010\u0010R\u0011\u00101\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b2\u0010\fR\u0011\u00103\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b4\u0010\u0010R\u0011\u00105\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b6\u0010\fR\u0011\u00107\u001a\u00020\\u0006\b\n\u0000\u001a\u0004\b8\u0010\fR\u0011\u00109\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b:\u0010\u0010R\u0011\u0010;\u001a\u00020\u000e¢\u0006\b\n\u0000\u001a\u0004\b<\u0010\u0010¨\u0006F"}, d2 = {"Landroidx/compose/foundation/layout/WindowInsetsHolder;", "", "insets", "Landroidx/core/view/WindowInsetsCompat;", "view", "Landroid/view/View;", "(Landroidx/core/view/WindowInsetsCompat;Landroid/view/View;)V", "accessCount", "", "captionBar", "Landroidx/compose/foundation/layout/AndroidWindowInsets;", "getCaptionBar", "()Landroidx/compose/foundation/layout/AndroidWindowInsets;", "captionBarIgnoringVisibility", "Landroidx/compose/foundation/layout/ValueInsets;", "getCaptionBarIgnoringVisibility", "()Landroidx/compose/foundation/layout/ValueInsets;", "consumes", "", "getConsumes", "()Z", "displayCutout", "getDisplayCutout", "ime", "getIme", "imeAnimationSource", "getImeAnimationSource", "imeAnimationTarget", "getImeAnimationTarget", "insetsListener", "Landroidx/compose/foundation/layout/InsetsListener;", "mandatorySystemGestures", "getMandatorySystemGestures", "navigationBars", "getNavigationBars", "navigationBarsIgnoringVisibility", "getNavigationBarsIgnoringVisibility", "safeContent", "Landroidx/compose/foundation/layout/WindowInsets;", "getSafeContent", "()Landroidx/compose/foundation/layout/WindowInsets;", "safeDrawing", "getSafeDrawing", "safeGestures", "getSafeGestures", "statusBars", "getStatusBars", "statusBarsIgnoringVisibility", "getStatusBarsIgnoringVisibility", "systemBars", "getSystemBars", "systemBarsIgnoringVisibility", "getSystemBarsIgnoringVisibility", "systemGestures", "getSystemGestures", "tappableElement", "getTappableElement", "tappableElementIgnoringVisibility", "getTappableElementIgnoringVisibility", "waterfall", "getWaterfall", "decrementAccessors", "", "incrementAccessors", "update", "windowInsets", "types", "updateImeAnimationSource", "updateImeAnimationTarget", "Companion", "foundation-layout_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class WindowInsetsHolder {
private static boolean testInsets;
private int accessCount;
private final AndroidWindowInsets captionBar;
private final ValueInsets captionBarIgnoringVisibility;
private final boolean consumes;
private final AndroidWindowInsets displayCutout;
private final AndroidWindowInsets ime;
private final ValueInsets imeAnimationSource;
private final ValueInsets imeAnimationTarget;
private final InsetsListener insetsListener;
private final AndroidWindowInsets mandatorySystemGestures;
private final AndroidWindowInsets navigationBars;
private final ValueInsets navigationBarsIgnoringVisibility;
private final WindowInsets safeContent;
private final WindowInsets safeDrawing;
private final WindowInsets safeGestures;
private final AndroidWindowInsets statusBars;
private final ValueInsets statusBarsIgnoringVisibility;
private final AndroidWindowInsets systemBars;
private final ValueInsets systemBarsIgnoringVisibility;
private final AndroidWindowInsets systemGestures;
private final AndroidWindowInsets tappableElement;
private final ValueInsets tappableElementIgnoringVisibility;
private final ValueInsets waterfall;
/* renamed from: Companion, reason: from kotlin metadata */
public static final Companion INSTANCE = new Companion(null);
private static final WeakHashMap<View, WindowInsetsHolder> viewMap = new WeakHashMap<>();
public /* synthetic */ WindowInsetsHolder(WindowInsetsCompat windowInsetsCompat, View view, DefaultConstructorMarker defaultConstructorMarker) {
this(windowInsetsCompat, view);
}
public final AndroidWindowInsets getCaptionBar() {
return this.captionBar;
}
public final ValueInsets getCaptionBarIgnoringVisibility() {
return this.captionBarIgnoringVisibility;
}
public final boolean getConsumes() {
return this.consumes;
}
public final AndroidWindowInsets getDisplayCutout() {
return this.displayCutout;
}
public final AndroidWindowInsets getIme() {
return this.ime;
}
public final ValueInsets getImeAnimationSource() {
return this.imeAnimationSource;
}
public final ValueInsets getImeAnimationTarget() {
return this.imeAnimationTarget;
}
public final AndroidWindowInsets getMandatorySystemGestures() {
return this.mandatorySystemGestures;
}
public final AndroidWindowInsets getNavigationBars() {
return this.navigationBars;
}
public final ValueInsets getNavigationBarsIgnoringVisibility() {
return this.navigationBarsIgnoringVisibility;
}
public final WindowInsets getSafeContent() {
return this.safeContent;
}
public final WindowInsets getSafeDrawing() {
return this.safeDrawing;
}
public final WindowInsets getSafeGestures() {
return this.safeGestures;
}
public final AndroidWindowInsets getStatusBars() {
return this.statusBars;
}
public final ValueInsets getStatusBarsIgnoringVisibility() {
return this.statusBarsIgnoringVisibility;
}
public final AndroidWindowInsets getSystemBars() {
return this.systemBars;
}
public final ValueInsets getSystemBarsIgnoringVisibility() {
return this.systemBarsIgnoringVisibility;
}
public final AndroidWindowInsets getSystemGestures() {
return this.systemGestures;
}
public final AndroidWindowInsets getTappableElement() {
return this.tappableElement;
}
public final ValueInsets getTappableElementIgnoringVisibility() {
return this.tappableElementIgnoringVisibility;
}
public final ValueInsets getWaterfall() {
return this.waterfall;
}
private WindowInsetsHolder(WindowInsetsCompat windowInsetsCompat, View view) {
DisplayCutoutCompat displayCutout;
Companion companion = INSTANCE;
this.captionBar = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.captionBar(), "captionBar");
AndroidWindowInsets systemInsets = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.displayCutout(), "displayCutout");
this.displayCutout = systemInsets;
AndroidWindowInsets systemInsets2 = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.ime(), "ime");
this.ime = systemInsets2;
AndroidWindowInsets systemInsets3 = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.mandatorySystemGestures(), "mandatorySystemGestures");
this.mandatorySystemGestures = systemInsets3;
this.navigationBars = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.navigationBars(), "navigationBars");
this.statusBars = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.statusBars(), "statusBars");
AndroidWindowInsets systemInsets4 = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.systemBars(), "systemBars");
this.systemBars = systemInsets4;
AndroidWindowInsets systemInsets5 = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.systemGestures(), "systemGestures");
this.systemGestures = systemInsets5;
AndroidWindowInsets systemInsets6 = companion.systemInsets(windowInsetsCompat, WindowInsetsCompat.Type.tappableElement(), "tappableElement");
this.tappableElement = systemInsets6;
Insets insets = (windowInsetsCompat == null || (displayCutout = windowInsetsCompat.getDisplayCutout()) == null || (insets = displayCutout.getWaterfallInsets()) == null) ? Insets.NONE : insets;
Intrinsics.checkNotNullExpressionValue(insets, "insets?.displayCutout?.w…ts ?: AndroidXInsets.NONE");
ValueInsets ValueInsets = WindowInsets_androidKt.ValueInsets(insets, "waterfall");
this.waterfall = ValueInsets;
WindowInsets union = WindowInsetsKt.union(WindowInsetsKt.union(systemInsets4, systemInsets2), systemInsets);
this.safeDrawing = union;
WindowInsets union2 = WindowInsetsKt.union(WindowInsetsKt.union(WindowInsetsKt.union(systemInsets6, systemInsets3), systemInsets5), ValueInsets);
this.safeGestures = union2;
this.safeContent = WindowInsetsKt.union(union, union2);
this.captionBarIgnoringVisibility = companion.valueInsetsIgnoringVisibility(windowInsetsCompat, WindowInsetsCompat.Type.captionBar(), "captionBarIgnoringVisibility");
this.navigationBarsIgnoringVisibility = companion.valueInsetsIgnoringVisibility(windowInsetsCompat, WindowInsetsCompat.Type.navigationBars(), "navigationBarsIgnoringVisibility");
this.statusBarsIgnoringVisibility = companion.valueInsetsIgnoringVisibility(windowInsetsCompat, WindowInsetsCompat.Type.statusBars(), "statusBarsIgnoringVisibility");
this.systemBarsIgnoringVisibility = companion.valueInsetsIgnoringVisibility(windowInsetsCompat, WindowInsetsCompat.Type.systemBars(), "systemBarsIgnoringVisibility");
this.tappableElementIgnoringVisibility = companion.valueInsetsIgnoringVisibility(windowInsetsCompat, WindowInsetsCompat.Type.tappableElement(), "tappableElementIgnoringVisibility");
this.imeAnimationTarget = companion.valueInsetsIgnoringVisibility(windowInsetsCompat, WindowInsetsCompat.Type.ime(), "imeAnimationTarget");
this.imeAnimationSource = companion.valueInsetsIgnoringVisibility(windowInsetsCompat, WindowInsetsCompat.Type.ime(), "imeAnimationSource");
Object parent = view.getParent();
View view2 = parent instanceof View ? (View) parent : null;
Object tag = view2 != null ? view2.getTag(androidx.compose.ui.R.id.consume_window_insets_tag) : null;
Boolean bool = tag instanceof Boolean ? (Boolean) tag : null;
this.consumes = bool != null ? bool.booleanValue() : true;
this.insetsListener = new InsetsListener(this);
}
public final void incrementAccessors(View view) {
Intrinsics.checkNotNullParameter(view, "view");
if (this.accessCount == 0) {
ViewCompat.setOnApplyWindowInsetsListener(view, this.insetsListener);
if (view.isAttachedToWindow()) {
view.requestApplyInsets();
}
view.addOnAttachStateChangeListener(this.insetsListener);
ViewCompat.setWindowInsetsAnimationCallback(view, this.insetsListener);
}
this.accessCount++;
}
public final void decrementAccessors(View view) {
Intrinsics.checkNotNullParameter(view, "view");
int i = this.accessCount - 1;
this.accessCount = i;
if (i == 0) {
ViewCompat.setOnApplyWindowInsetsListener(view, null);
ViewCompat.setWindowInsetsAnimationCallback(view, null);
view.removeOnAttachStateChangeListener(this.insetsListener);
}
}
public static /* synthetic */ void update$default(WindowInsetsHolder windowInsetsHolder, WindowInsetsCompat windowInsetsCompat, int i, int i2, Object obj) {
if ((i2 & 2) != 0) {
i = 0;
}
windowInsetsHolder.update(windowInsetsCompat, i);
}
public final void update(WindowInsetsCompat windowInsets, int types) {
Intrinsics.checkNotNullParameter(windowInsets, "windowInsets");
if (testInsets) {
android.view.WindowInsets windowInsets2 = windowInsets.toWindowInsets();
Intrinsics.checkNotNull(windowInsets2);
windowInsets = WindowInsetsCompat.toWindowInsetsCompat(windowInsets2);
}
Intrinsics.checkNotNullExpressionValue(windowInsets, "if (testInsets) {\n … windowInsets\n }");
this.captionBar.update$foundation_layout_release(windowInsets, types);
this.ime.update$foundation_layout_release(windowInsets, types);
this.displayCutout.update$foundation_layout_release(windowInsets, types);
this.navigationBars.update$foundation_layout_release(windowInsets, types);
this.statusBars.update$foundation_layout_release(windowInsets, types);
this.systemBars.update$foundation_layout_release(windowInsets, types);
this.systemGestures.update$foundation_layout_release(windowInsets, types);
this.tappableElement.update$foundation_layout_release(windowInsets, types);
this.mandatorySystemGestures.update$foundation_layout_release(windowInsets, types);
if (types == 0) {
ValueInsets valueInsets = this.captionBarIgnoringVisibility;
Insets insetsIgnoringVisibility = windowInsets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.captionBar());
Intrinsics.checkNotNullExpressionValue(insetsIgnoringVisibility, "insets.getInsetsIgnoring…aptionBar()\n )");
valueInsets.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(insetsIgnoringVisibility));
ValueInsets valueInsets2 = this.navigationBarsIgnoringVisibility;
Insets insetsIgnoringVisibility2 = windowInsets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.navigationBars());
Intrinsics.checkNotNullExpressionValue(insetsIgnoringVisibility2, "insets.getInsetsIgnoring…ationBars()\n )");
valueInsets2.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(insetsIgnoringVisibility2));
ValueInsets valueInsets3 = this.statusBarsIgnoringVisibility;
Insets insetsIgnoringVisibility3 = windowInsets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.statusBars());
Intrinsics.checkNotNullExpressionValue(insetsIgnoringVisibility3, "insets.getInsetsIgnoring…tatusBars()\n )");
valueInsets3.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(insetsIgnoringVisibility3));
ValueInsets valueInsets4 = this.systemBarsIgnoringVisibility;
Insets insetsIgnoringVisibility4 = windowInsets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.systemBars());
Intrinsics.checkNotNullExpressionValue(insetsIgnoringVisibility4, "insets.getInsetsIgnoring…ystemBars()\n )");
valueInsets4.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(insetsIgnoringVisibility4));
ValueInsets valueInsets5 = this.tappableElementIgnoringVisibility;
Insets insetsIgnoringVisibility5 = windowInsets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.tappableElement());
Intrinsics.checkNotNullExpressionValue(insetsIgnoringVisibility5, "insets.getInsetsIgnoring…leElement()\n )");
valueInsets5.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(insetsIgnoringVisibility5));
DisplayCutoutCompat displayCutout = windowInsets.getDisplayCutout();
if (displayCutout != null) {
Insets waterfallInsets = displayCutout.getWaterfallInsets();
Intrinsics.checkNotNullExpressionValue(waterfallInsets, "cutout.waterfallInsets");
this.waterfall.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(waterfallInsets));
}
}
Snapshot.INSTANCE.sendApplyNotifications();
}
public final void updateImeAnimationSource(WindowInsetsCompat windowInsets) {
Intrinsics.checkNotNullParameter(windowInsets, "windowInsets");
ValueInsets valueInsets = this.imeAnimationSource;
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.ime());
Intrinsics.checkNotNullExpressionValue(insets, "windowInsets.getInsets(W…wInsetsCompat.Type.ime())");
valueInsets.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(insets));
}
public final void updateImeAnimationTarget(WindowInsetsCompat windowInsets) {
Intrinsics.checkNotNullParameter(windowInsets, "windowInsets");
ValueInsets valueInsets = this.imeAnimationTarget;
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.ime());
Intrinsics.checkNotNullExpressionValue(insets, "windowInsets.getInsets(W…wInsetsCompat.Type.ime())");
valueInsets.setValue$foundation_layout_release(WindowInsets_androidKt.toInsetsValues(insets));
}
/* compiled from: WindowInsets.android.kt */
@Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\r\u0010\t\u001a\u00020\bH\u0007¢\u0006\u0002\u0010\nJ\u0010\u0010\u000b\u001a\u00020\b2\u0006\u0010\f\u001a\u00020\u0007H\u0002J\u000e\u0010\r\u001a\u00020\u000e2\u0006\u0010\u0003\u001a\u00020\u0004J\"\u0010\u000f\u001a\u00020\u00102\b\u0010\u0011\u001a\u0004\u0018\u00010\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0016H\u0002J\"\u0010\u0017\u001a\u00020\u00182\b\u0010\u0011\u001a\u0004\u0018\u00010\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0016H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u001a\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\b0\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0019"}, d2 = {"Landroidx/compose/foundation/layout/WindowInsetsHolder$Companion;", "", "()V", "testInsets", "", "viewMap", "Ljava/util/WeakHashMap;", "Landroid/view/View;", "Landroidx/compose/foundation/layout/WindowInsetsHolder;", SentryThread.JsonKeys.CURRENT, "(Landroidx/compose/runtime/Composer;I)Landroidx/compose/foundation/layout/WindowInsetsHolder;", "getOrCreateFor", "view", "setUseTestInsets", "", "systemInsets", "Landroidx/compose/foundation/layout/AndroidWindowInsets;", "windowInsets", "Landroidx/core/view/WindowInsetsCompat;", "type", "", "name", "", "valueInsetsIgnoringVisibility", "Landroidx/compose/foundation/layout/ValueInsets;", "foundation-layout_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final void setUseTestInsets(boolean testInsets) {
WindowInsetsHolder.testInsets = testInsets;
}
public final WindowInsetsHolder current(Composer composer, int i) {
composer.startReplaceableGroup(-1366542614);
ComposerKt.sourceInformation(composer, "C(current)609@22004L7,612@22071L186:WindowInsets.android.kt#2w3rfo");
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-1366542614, i, -1, "androidx.compose.foundation.layout.WindowInsetsHolder.Companion.current (WindowInsets.android.kt:608)");
}
ProvidableCompositionLocal<View> localView = AndroidCompositionLocals_androidKt.getLocalView();
ComposerKt.sourceInformationMarkerStart(composer, 2023513938, "CC:CompositionLocal.kt#9igjgp");
Object consume = composer.consume(localView);
ComposerKt.sourceInformationMarkerEnd(composer);
final View view = (View) consume;
final WindowInsetsHolder orCreateFor = getOrCreateFor(view);
EffectsKt.DisposableEffect(orCreateFor, new Function1<DisposableEffectScope, DisposableEffectResult>() { // from class: androidx.compose.foundation.layout.WindowInsetsHolder$Companion$current$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 final DisposableEffectResult invoke(DisposableEffectScope DisposableEffect) {
Intrinsics.checkNotNullParameter(DisposableEffect, "$this$DisposableEffect");
WindowInsetsHolder.this.incrementAccessors(view);
final WindowInsetsHolder windowInsetsHolder = WindowInsetsHolder.this;
final View view2 = view;
return new DisposableEffectResult() { // from class: androidx.compose.foundation.layout.WindowInsetsHolder$Companion$current$1$invoke$$inlined$onDispose$1
@Override // androidx.compose.runtime.DisposableEffectResult
public void dispose() {
WindowInsetsHolder.this.decrementAccessors(view2);
}
};
}
}, composer, 8);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
return orCreateFor;
}
private final WindowInsetsHolder getOrCreateFor(View view) {
WindowInsetsHolder windowInsetsHolder;
synchronized (WindowInsetsHolder.viewMap) {
WeakHashMap weakHashMap = WindowInsetsHolder.viewMap;
Object obj = weakHashMap.get(view);
Object obj2 = obj;
if (obj == null) {
WindowInsetsHolder windowInsetsHolder2 = new WindowInsetsHolder(null, view, false ? 1 : 0);
weakHashMap.put(view, windowInsetsHolder2);
obj2 = windowInsetsHolder2;
}
windowInsetsHolder = (WindowInsetsHolder) obj2;
}
return windowInsetsHolder;
}
/* JADX INFO: Access modifiers changed from: private */
public final AndroidWindowInsets systemInsets(WindowInsetsCompat windowInsets, int type, String name) {
AndroidWindowInsets androidWindowInsets = new AndroidWindowInsets(type, name);
if (windowInsets != null) {
androidWindowInsets.update$foundation_layout_release(windowInsets, type);
}
return androidWindowInsets;
}
/* JADX INFO: Access modifiers changed from: private */
public final ValueInsets valueInsetsIgnoringVisibility(WindowInsetsCompat windowInsets, int type, String name) {
Insets insets;
if (windowInsets == null || (insets = windowInsets.getInsetsIgnoringVisibility(type)) == null) {
insets = Insets.NONE;
}
Intrinsics.checkNotNullExpressionValue(insets, "windowInsets?.getInsetsI…e) ?: AndroidXInsets.NONE");
return WindowInsets_androidKt.ValueInsets(insets, name);
}
}
}