mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-14 01:47:17 +01:00
38 lines
2 KiB
Java
38 lines
2 KiB
Java
package androidx.lifecycle;
|
|
|
|
import android.view.View;
|
|
import androidx.core.viewtree.ViewTree;
|
|
import androidx.lifecycle.runtime.R;
|
|
import com.dee.app.metrics.MetricsConstants;
|
|
import kotlin.Metadata;
|
|
import kotlin.jvm.JvmName;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u001a\u001b\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004H\u0007¢\u0006\u0002\b\u0005\u001a\u0013\u0010\u0006\u001a\u0004\u0018\u00010\u0004*\u00020\u0002H\u0007¢\u0006\u0002\b\u0007¨\u0006\b"}, d2 = {"setViewTreeLifecycleOwner", "", "Landroid/view/View;", "lifecycleOwner", "Landroidx/lifecycle/LifecycleOwner;", "set", "findViewTreeLifecycleOwner", MetricsConstants.Method.CACHE_GET, "lifecycle-runtime"}, k = 2, mv = {2, 0, 0}, xi = 48)
|
|
@JvmName(name = "ViewTreeLifecycleOwner")
|
|
/* loaded from: classes14.dex */
|
|
public final class ViewTreeLifecycleOwner {
|
|
@JvmName(name = MetricsConstants.Method.CACHE_GET)
|
|
@Nullable
|
|
public static final LifecycleOwner get(@NotNull View view) {
|
|
view.getClass();
|
|
while (view != null) {
|
|
Object tag = view.getTag(R.id.view_tree_lifecycle_owner);
|
|
LifecycleOwner lifecycleOwner = tag instanceof LifecycleOwner ? (LifecycleOwner) tag : null;
|
|
if (lifecycleOwner != null) {
|
|
return lifecycleOwner;
|
|
}
|
|
Object parentOrViewTreeDisjointParent = ViewTree.getParentOrViewTreeDisjointParent(view);
|
|
view = parentOrViewTreeDisjointParent instanceof View ? (View) parentOrViewTreeDisjointParent : null;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@JvmName(name = "set")
|
|
public static final void set(@NotNull View view, @Nullable LifecycleOwner lifecycleOwner) {
|
|
view.getClass();
|
|
view.setTag(R.id.view_tree_lifecycle_owner, lifecycleOwner);
|
|
}
|
|
}
|