- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
48 lines
2.2 KiB
Java
48 lines
2.2 KiB
Java
package androidx.savedstate;
|
|
|
|
import android.view.View;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.sequences.Sequence;
|
|
import kotlin.sequences.SequencesKt__SequencesKt;
|
|
import kotlin.sequences.SequencesKt___SequencesKt;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class ViewTreeSavedStateRegistryOwner {
|
|
public static final void set(View view, SavedStateRegistryOwner savedStateRegistryOwner) {
|
|
Intrinsics.checkNotNullParameter(view, "<this>");
|
|
view.setTag(R.id.view_tree_saved_state_registry_owner, savedStateRegistryOwner);
|
|
}
|
|
|
|
public static final SavedStateRegistryOwner get(View view) {
|
|
Sequence generateSequence;
|
|
Sequence mapNotNull;
|
|
Object firstOrNull;
|
|
Intrinsics.checkNotNullParameter(view, "<this>");
|
|
generateSequence = SequencesKt__SequencesKt.generateSequence(view, new Function1() { // from class: androidx.savedstate.ViewTreeSavedStateRegistryOwner$findViewTreeSavedStateRegistryOwner$1
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public final View invoke(View view2) {
|
|
Intrinsics.checkNotNullParameter(view2, "view");
|
|
Object parent = view2.getParent();
|
|
if (parent instanceof View) {
|
|
return (View) parent;
|
|
}
|
|
return null;
|
|
}
|
|
});
|
|
mapNotNull = SequencesKt___SequencesKt.mapNotNull(generateSequence, new Function1() { // from class: androidx.savedstate.ViewTreeSavedStateRegistryOwner$findViewTreeSavedStateRegistryOwner$2
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public final SavedStateRegistryOwner invoke(View view2) {
|
|
Intrinsics.checkNotNullParameter(view2, "view");
|
|
Object tag = view2.getTag(R.id.view_tree_saved_state_registry_owner);
|
|
if (tag instanceof SavedStateRegistryOwner) {
|
|
return (SavedStateRegistryOwner) tag;
|
|
}
|
|
return null;
|
|
}
|
|
});
|
|
firstOrNull = SequencesKt___SequencesKt.firstOrNull(mapNotNull);
|
|
return (SavedStateRegistryOwner) firstOrNull;
|
|
}
|
|
}
|