package androidx.core.view;

import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.ContentInfo;
import android.view.Display;
import android.view.KeyEvent;
import android.view.OnReceiveContentListener;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeProvider;
import androidx.core.view.a;
import androidx.core.view.accessibility.d;
import androidx.core.view.j0;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: compiled from: ViewCompat.java */
/* JADX INFO: loaded from: classes.dex */
@SuppressLint({"PrivateConstructorForUtilityClass"})
public class y {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private static Field f1949b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private static boolean f1950c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private static Field f1951d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private static boolean f1952e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private static WeakHashMap<View, String> f1953f;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private static Field f1955h;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private static ThreadLocal<Rect> f1957j;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static final AtomicInteger f1948a = new AtomicInteger(1);

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private static WeakHashMap<View, e0> f1954g = null;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private static boolean f1956i = false;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private static final int[] f1958k = {r.b.f5791b, r.b.f5792c, r.b.f5803n, r.b.f5814y, r.b.B, r.b.C, r.b.D, r.b.E, r.b.F, r.b.G, r.b.f5793d, r.b.f5794e, r.b.f5795f, r.b.f5796g, r.b.f5797h, r.b.f5798i, r.b.f5799j, r.b.f5800k, r.b.f5801l, r.b.f5802m, r.b.f5804o, r.b.f5805p, r.b.f5806q, r.b.f5807r, r.b.f5808s, r.b.f5809t, r.b.f5810u, r.b.f5811v, r.b.f5812w, r.b.f5813x, r.b.f5815z, r.b.A};

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private static final androidx.core.view.u f1959l = new androidx.core.view.u() { // from class: androidx.core.view.x
        @Override // androidx.core.view.u
        public final c a(c cVar) {
            return y.Z(cVar);
        }
    };

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private static final e f1960m = new e();

    /* JADX INFO: compiled from: ViewCompat.java */
    class a extends f<Boolean> {
        a(int i3, Class cls, int i4) {
            super(i3, cls, i4);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: i, reason: merged with bridge method [inline-methods] */
        public Boolean d(View view) {
            return Boolean.valueOf(p.d(view));
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: j, reason: merged with bridge method [inline-methods] */
        public void e(View view, Boolean bool) {
            p.i(view, bool.booleanValue());
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: k, reason: merged with bridge method [inline-methods] */
        public boolean h(Boolean bool, Boolean bool2) {
            return !a(bool, bool2);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    class b extends f<CharSequence> {
        b(int i3, Class cls, int i4, int i5) {
            super(i3, cls, i4, i5);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: i, reason: merged with bridge method [inline-methods] */
        public CharSequence d(View view) {
            return p.b(view);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: j, reason: merged with bridge method [inline-methods] */
        public void e(View view, CharSequence charSequence) {
            p.h(view, charSequence);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: k, reason: merged with bridge method [inline-methods] */
        public boolean h(CharSequence charSequence, CharSequence charSequence2) {
            return !TextUtils.equals(charSequence, charSequence2);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    class c extends f<CharSequence> {
        c(int i3, Class cls, int i4, int i5) {
            super(i3, cls, i4, i5);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: i, reason: merged with bridge method [inline-methods] */
        public CharSequence d(View view) {
            return r.a(view);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: j, reason: merged with bridge method [inline-methods] */
        public void e(View view, CharSequence charSequence) {
            r.b(view, charSequence);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: k, reason: merged with bridge method [inline-methods] */
        public boolean h(CharSequence charSequence, CharSequence charSequence2) {
            return !TextUtils.equals(charSequence, charSequence2);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    class d extends f<Boolean> {
        d(int i3, Class cls, int i4) {
            super(i3, cls, i4);
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: i, reason: merged with bridge method [inline-methods] */
        public Boolean d(View view) {
            return Boolean.valueOf(p.c(view));
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: j, reason: merged with bridge method [inline-methods] */
        public void e(View view, Boolean bool) {
            p.g(view, bool.booleanValue());
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        @Override // androidx.core.view.y.f
        /* JADX INFO: renamed from: k, reason: merged with bridge method [inline-methods] */
        public boolean h(Boolean bool, Boolean bool2) {
            return !a(bool, bool2);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class e implements ViewTreeObserver.OnGlobalLayoutListener, View.OnAttachStateChangeListener {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private final WeakHashMap<View, Boolean> f1961e = new WeakHashMap<>();

        e() {
        }

        private void b(View view, boolean z2) {
            boolean z3 = view.isShown() && view.getWindowVisibility() == 0;
            if (z2 != z3) {
                y.a0(view, z3 ? 16 : 32);
                this.f1961e.put(view, Boolean.valueOf(z3));
            }
        }

        private void c(View view) {
            view.getViewTreeObserver().addOnGlobalLayoutListener(this);
        }

        private void e(View view) {
            h.o(view.getViewTreeObserver(), this);
        }

        void a(View view) {
            this.f1961e.put(view, Boolean.valueOf(view.isShown() && view.getWindowVisibility() == 0));
            view.addOnAttachStateChangeListener(this);
            if (k.b(view)) {
                c(view);
            }
        }

        void d(View view) {
            this.f1961e.remove(view);
            view.removeOnAttachStateChangeListener(this);
            e(view);
        }

        @Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
        public void onGlobalLayout() {
            if (Build.VERSION.SDK_INT < 28) {
                for (Map.Entry<View, Boolean> entry : this.f1961e.entrySet()) {
                    b(entry.getKey(), entry.getValue().booleanValue());
                }
            }
        }

        @Override // android.view.View.OnAttachStateChangeListener
        public void onViewAttachedToWindow(View view) {
            c(view);
        }

        @Override // android.view.View.OnAttachStateChangeListener
        public void onViewDetachedFromWindow(View view) {
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static abstract class f<T> {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final int f1962a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private final Class<T> f1963b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private final int f1964c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private final int f1965d;

        f(int i3, Class<T> cls, int i4) {
            this(i3, cls, 0, i4);
        }

        private boolean b() {
            return Build.VERSION.SDK_INT >= 19;
        }

        private boolean c() {
            return Build.VERSION.SDK_INT >= this.f1964c;
        }

        boolean a(Boolean bool, Boolean bool2) {
            return (bool != null && bool.booleanValue()) == (bool2 != null && bool2.booleanValue());
        }

        abstract T d(View view);

        abstract void e(View view, T t2);

        T f(View view) {
            if (c()) {
                return d(view);
            }
            if (!b()) {
                return null;
            }
            T t2 = (T) view.getTag(this.f1962a);
            if (this.f1963b.isInstance(t2)) {
                return t2;
            }
            return null;
        }

        void g(View view, T t2) {
            if (c()) {
                e(view, t2);
            } else if (b() && h(f(view), t2)) {
                y.l(view);
                view.setTag(this.f1962a, t2);
                y.a0(view, this.f1965d);
            }
        }

        abstract boolean h(T t2, T t3);

        f(int i3, Class<T> cls, int i4, int i5) {
            this.f1962a = i3;
            this.f1963b = cls;
            this.f1965d = i4;
            this.f1964c = i5;
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class g {
        static boolean a(View view) {
            return view.hasOnClickListeners();
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class h {
        static AccessibilityNodeProvider a(View view) {
            return view.getAccessibilityNodeProvider();
        }

        static boolean b(View view) {
            return view.getFitsSystemWindows();
        }

        static int c(View view) {
            return view.getImportantForAccessibility();
        }

        static int d(View view) {
            return view.getMinimumHeight();
        }

        static int e(View view) {
            return view.getMinimumWidth();
        }

        static ViewParent f(View view) {
            return view.getParentForAccessibility();
        }

        static int g(View view) {
            return view.getWindowSystemUiVisibility();
        }

        static boolean h(View view) {
            return view.hasOverlappingRendering();
        }

        static boolean i(View view) {
            return view.hasTransientState();
        }

        static boolean j(View view, int i3, Bundle bundle) {
            return view.performAccessibilityAction(i3, bundle);
        }

        static void k(View view) {
            view.postInvalidateOnAnimation();
        }

        static void l(View view, int i3, int i4, int i5, int i6) {
            view.postInvalidateOnAnimation(i3, i4, i5, i6);
        }

        static void m(View view, Runnable runnable) {
            view.postOnAnimation(runnable);
        }

        static void n(View view, Runnable runnable, long j3) {
            view.postOnAnimationDelayed(runnable, j3);
        }

        static void o(ViewTreeObserver viewTreeObserver, ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener) {
            viewTreeObserver.removeOnGlobalLayoutListener(onGlobalLayoutListener);
        }

        static void p(View view) {
            view.requestFitSystemWindows();
        }

        static void q(View view, Drawable drawable) {
            view.setBackground(drawable);
        }

        static void r(View view, boolean z2) {
            view.setHasTransientState(z2);
        }

        static void s(View view, int i3) {
            view.setImportantForAccessibility(i3);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class i {
        static int a() {
            return View.generateViewId();
        }

        static Display b(View view) {
            return view.getDisplay();
        }

        static int c(View view) {
            return view.getLabelFor();
        }

        static int d(View view) {
            return view.getLayoutDirection();
        }

        static int e(View view) {
            return view.getPaddingEnd();
        }

        static int f(View view) {
            return view.getPaddingStart();
        }

        static boolean g(View view) {
            return view.isPaddingRelative();
        }

        static void h(View view, int i3) {
            view.setLabelFor(i3);
        }

        static void i(View view, Paint paint) {
            view.setLayerPaint(paint);
        }

        static void j(View view, int i3) {
            view.setLayoutDirection(i3);
        }

        static void k(View view, int i3, int i4, int i5, int i6) {
            view.setPaddingRelative(i3, i4, i5, i6);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class j {
        static Rect a(View view) {
            return view.getClipBounds();
        }

        static boolean b(View view) {
            return view.isInLayout();
        }

        static void c(View view, Rect rect) {
            view.setClipBounds(rect);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class k {
        static int a(View view) {
            return view.getAccessibilityLiveRegion();
        }

        static boolean b(View view) {
            return view.isAttachedToWindow();
        }

        static boolean c(View view) {
            return view.isLaidOut();
        }

        static boolean d(View view) {
            return view.isLayoutDirectionResolved();
        }

        static void e(ViewParent viewParent, View view, View view2, int i3) {
            viewParent.notifySubtreeAccessibilityStateChanged(view, view2, i3);
        }

        static void f(View view, int i3) {
            view.setAccessibilityLiveRegion(i3);
        }

        static void g(AccessibilityEvent accessibilityEvent, int i3) {
            accessibilityEvent.setContentChangeTypes(i3);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class l {
        static WindowInsets a(View view, WindowInsets windowInsets) {
            return view.dispatchApplyWindowInsets(windowInsets);
        }

        static WindowInsets b(View view, WindowInsets windowInsets) {
            return view.onApplyWindowInsets(windowInsets);
        }

        static void c(View view) {
            view.requestApplyInsets();
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    private static class m {

        /* JADX INFO: compiled from: ViewCompat.java */
        class a implements View.OnApplyWindowInsetsListener {

            /* JADX INFO: renamed from: a, reason: collision with root package name */
            j0 f1966a = null;

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            final /* synthetic */ View f1967b;

            /* JADX INFO: renamed from: c, reason: collision with root package name */
            final /* synthetic */ androidx.core.view.s f1968c;

            a(View view, androidx.core.view.s sVar) {
                this.f1967b = view;
                this.f1968c = sVar;
            }

            @Override // android.view.View.OnApplyWindowInsetsListener
            public WindowInsets onApplyWindowInsets(View view, WindowInsets windowInsets) {
                j0 j0VarV = j0.v(windowInsets, view);
                int i3 = Build.VERSION.SDK_INT;
                if (i3 < 30) {
                    m.a(windowInsets, this.f1967b);
                    if (j0VarV.equals(this.f1966a)) {
                        return this.f1968c.a(view, j0VarV).t();
                    }
                }
                this.f1966a = j0VarV;
                j0 j0VarA = this.f1968c.a(view, j0VarV);
                if (i3 >= 30) {
                    return j0VarA.t();
                }
                y.o0(view);
                return j0VarA.t();
            }
        }

        static void a(WindowInsets windowInsets, View view) {
            View.OnApplyWindowInsetsListener onApplyWindowInsetsListener = (View.OnApplyWindowInsetsListener) view.getTag(r.b.T);
            if (onApplyWindowInsetsListener != null) {
                onApplyWindowInsetsListener.onApplyWindowInsets(view, windowInsets);
            }
        }

        static j0 b(View view, j0 j0Var, Rect rect) {
            WindowInsets windowInsetsT = j0Var.t();
            if (windowInsetsT != null) {
                return j0.v(view.computeSystemWindowInsets(windowInsetsT, rect), view);
            }
            rect.setEmpty();
            return j0Var;
        }

        static boolean c(View view, float f3, float f4, boolean z2) {
            return view.dispatchNestedFling(f3, f4, z2);
        }

        static boolean d(View view, float f3, float f4) {
            return view.dispatchNestedPreFling(f3, f4);
        }

        static boolean e(View view, int i3, int i4, int[] iArr, int[] iArr2) {
            return view.dispatchNestedPreScroll(i3, i4, iArr, iArr2);
        }

        static boolean f(View view, int i3, int i4, int i5, int i6, int[] iArr) {
            return view.dispatchNestedScroll(i3, i4, i5, i6, iArr);
        }

        static ColorStateList g(View view) {
            return view.getBackgroundTintList();
        }

        static PorterDuff.Mode h(View view) {
            return view.getBackgroundTintMode();
        }

        static float i(View view) {
            return view.getElevation();
        }

        public static j0 j(View view) {
            return j0.a.a(view);
        }

        static String k(View view) {
            return view.getTransitionName();
        }

        static float l(View view) {
            return view.getTranslationZ();
        }

        static float m(View view) {
            return view.getZ();
        }

        static boolean n(View view) {
            return view.hasNestedScrollingParent();
        }

        static boolean o(View view) {
            return view.isImportantForAccessibility();
        }

        static boolean p(View view) {
            return view.isNestedScrollingEnabled();
        }

        static void q(View view, ColorStateList colorStateList) {
            view.setBackgroundTintList(colorStateList);
        }

        static void r(View view, PorterDuff.Mode mode) {
            view.setBackgroundTintMode(mode);
        }

        static void s(View view, float f3) {
            view.setElevation(f3);
        }

        static void t(View view, boolean z2) {
            view.setNestedScrollingEnabled(z2);
        }

        static void u(View view, androidx.core.view.s sVar) {
            if (Build.VERSION.SDK_INT < 30) {
                view.setTag(r.b.L, sVar);
            }
            if (sVar == null) {
                view.setOnApplyWindowInsetsListener((View.OnApplyWindowInsetsListener) view.getTag(r.b.T));
            } else {
                view.setOnApplyWindowInsetsListener(new a(view, sVar));
            }
        }

        static void v(View view, String str) {
            view.setTransitionName(str);
        }

        static void w(View view, float f3) {
            view.setTranslationZ(f3);
        }

        static void x(View view, float f3) {
            view.setZ(f3);
        }

        static boolean y(View view, int i3) {
            return view.startNestedScroll(i3);
        }

        static void z(View view) {
            view.stopNestedScroll();
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    private static class n {
        public static j0 a(View view) {
            WindowInsets rootWindowInsets = view.getRootWindowInsets();
            if (rootWindowInsets == null) {
                return null;
            }
            j0 j0VarU = j0.u(rootWindowInsets);
            j0VarU.r(j0VarU);
            j0VarU.d(view.getRootView());
            return j0VarU;
        }

        static int b(View view) {
            return view.getScrollIndicators();
        }

        static void c(View view, int i3) {
            view.setScrollIndicators(i3);
        }

        static void d(View view, int i3, int i4) {
            view.setScrollIndicators(i3, i4);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class o {
        static void a(View view, Collection<View> collection, int i3) {
            view.addKeyboardNavigationClusters(collection, i3);
        }

        static int b(View view) {
            return view.getImportantForAutofill();
        }

        static int c(View view) {
            return view.getNextClusterForwardId();
        }

        static boolean d(View view) {
            return view.hasExplicitFocusable();
        }

        static boolean e(View view) {
            return view.isFocusedByDefault();
        }

        static boolean f(View view) {
            return view.isImportantForAutofill();
        }

        static boolean g(View view) {
            return view.isKeyboardNavigationCluster();
        }

        static View h(View view, View view2, int i3) {
            return view.keyboardNavigationClusterSearch(view2, i3);
        }

        static boolean i(View view) {
            return view.restoreDefaultFocus();
        }

        static void j(View view, String... strArr) {
            view.setAutofillHints(strArr);
        }

        static void k(View view, boolean z2) {
            view.setFocusedByDefault(z2);
        }

        static void l(View view, int i3) {
            view.setImportantForAutofill(i3);
        }

        static void m(View view, boolean z2) {
            view.setKeyboardNavigationCluster(z2);
        }

        static void n(View view, int i3) {
            view.setNextClusterForwardId(i3);
        }

        static void o(View view, CharSequence charSequence) {
            view.setTooltipText(charSequence);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class p {
        static void a(View view, final u uVar) {
            int i3 = r.b.S;
            j.g gVar = (j.g) view.getTag(i3);
            if (gVar == null) {
                gVar = new j.g();
                view.setTag(i3, gVar);
            }
            Objects.requireNonNull(uVar);
            View.OnUnhandledKeyEventListener onUnhandledKeyEventListener = new View.OnUnhandledKeyEventListener() { // from class: androidx.core.view.z
                @Override // android.view.View.OnUnhandledKeyEventListener
                public final boolean onUnhandledKeyEvent(View view2, KeyEvent keyEvent) {
                    return uVar.onUnhandledKeyEvent(view2, keyEvent);
                }
            };
            gVar.put(uVar, onUnhandledKeyEventListener);
            view.addOnUnhandledKeyEventListener(onUnhandledKeyEventListener);
        }

        static CharSequence b(View view) {
            return view.getAccessibilityPaneTitle();
        }

        static boolean c(View view) {
            return view.isAccessibilityHeading();
        }

        static boolean d(View view) {
            return view.isScreenReaderFocusable();
        }

        static void e(View view, u uVar) {
            View.OnUnhandledKeyEventListener onUnhandledKeyEventListener;
            j.g gVar = (j.g) view.getTag(r.b.S);
            if (gVar == null || (onUnhandledKeyEventListener = (View.OnUnhandledKeyEventListener) gVar.get(uVar)) == null) {
                return;
            }
            view.removeOnUnhandledKeyEventListener(onUnhandledKeyEventListener);
        }

        static <T> T f(View view, int i3) {
            return (T) view.requireViewById(i3);
        }

        static void g(View view, boolean z2) {
            view.setAccessibilityHeading(z2);
        }

        static void h(View view, CharSequence charSequence) {
            view.setAccessibilityPaneTitle(charSequence);
        }

        static void i(View view, boolean z2) {
            view.setScreenReaderFocusable(z2);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    private static class q {
        static View.AccessibilityDelegate a(View view) {
            return view.getAccessibilityDelegate();
        }

        static List<Rect> b(View view) {
            return view.getSystemGestureExclusionRects();
        }

        static void c(View view, Context context, int[] iArr, AttributeSet attributeSet, TypedArray typedArray, int i3, int i4) {
            view.saveAttributeDataForStyleable(context, iArr, attributeSet, typedArray, i3, i4);
        }

        static void d(View view, List<Rect> list) {
            view.setSystemGestureExclusionRects(list);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    private static class r {
        static CharSequence a(View view) {
            return view.getStateDescription();
        }

        static void b(View view, CharSequence charSequence) {
            view.setStateDescription(charSequence);
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    private static final class s {
        public static String[] a(View view) {
            return view.getReceiveContentMimeTypes();
        }

        public static androidx.core.view.c b(View view, androidx.core.view.c cVar) {
            ContentInfo contentInfoF = cVar.f();
            ContentInfo contentInfoPerformReceiveContent = view.performReceiveContent(contentInfoF);
            if (contentInfoPerformReceiveContent == null) {
                return null;
            }
            return contentInfoPerformReceiveContent == contentInfoF ? cVar : androidx.core.view.c.g(contentInfoPerformReceiveContent);
        }

        public static void c(View view, String[] strArr, androidx.core.view.t tVar) {
            if (tVar == null) {
                view.setOnReceiveContentListener(strArr, null);
            } else {
                view.setOnReceiveContentListener(strArr, new t(tVar));
            }
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    private static final class t implements OnReceiveContentListener {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final androidx.core.view.t f1969a;

        t(androidx.core.view.t tVar) {
            this.f1969a = tVar;
        }

        @Override // android.view.OnReceiveContentListener
        public ContentInfo onReceiveContent(View view, ContentInfo contentInfo) {
            androidx.core.view.c cVarG = androidx.core.view.c.g(contentInfo);
            androidx.core.view.c cVarA = this.f1969a.a(view, cVarG);
            if (cVarA == null) {
                return null;
            }
            return cVarA == cVarG ? contentInfo : cVarA.f();
        }
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    public interface u {
        boolean onUnhandledKeyEvent(View view, KeyEvent keyEvent);
    }

    /* JADX INFO: compiled from: ViewCompat.java */
    static class v {

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private static final ArrayList<WeakReference<View>> f1970d = new ArrayList<>();

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private WeakHashMap<View, Boolean> f1971a = null;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private SparseArray<WeakReference<View>> f1972b = null;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private WeakReference<KeyEvent> f1973c = null;

        v() {
        }

        static v a(View view) {
            int i3 = r.b.R;
            v vVar = (v) view.getTag(i3);
            if (vVar != null) {
                return vVar;
            }
            v vVar2 = new v();
            view.setTag(i3, vVar2);
            return vVar2;
        }

        private View c(View view, KeyEvent keyEvent) {
            WeakHashMap<View, Boolean> weakHashMap = this.f1971a;
            if (weakHashMap != null && weakHashMap.containsKey(view)) {
                if (view instanceof ViewGroup) {
                    ViewGroup viewGroup = (ViewGroup) view;
                    for (int childCount = viewGroup.getChildCount() - 1; childCount >= 0; childCount--) {
                        View viewC = c(viewGroup.getChildAt(childCount), keyEvent);
                        if (viewC != null) {
                            return viewC;
                        }
                    }
                }
                if (e(view, keyEvent)) {
                    return view;
                }
            }
            return null;
        }

        private SparseArray<WeakReference<View>> d() {
            if (this.f1972b == null) {
                this.f1972b = new SparseArray<>();
            }
            return this.f1972b;
        }

        private boolean e(View view, KeyEvent keyEvent) {
            ArrayList arrayList = (ArrayList) view.getTag(r.b.S);
            if (arrayList == null) {
                return false;
            }
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                if (((u) arrayList.get(size)).onUnhandledKeyEvent(view, keyEvent)) {
                    return true;
                }
            }
            return false;
        }

        private void g() {
            WeakHashMap<View, Boolean> weakHashMap = this.f1971a;
            if (weakHashMap != null) {
                weakHashMap.clear();
            }
            ArrayList<WeakReference<View>> arrayList = f1970d;
            if (arrayList.isEmpty()) {
                return;
            }
            synchronized (arrayList) {
                if (this.f1971a == null) {
                    this.f1971a = new WeakHashMap<>();
                }
                for (int size = arrayList.size() - 1; size >= 0; size--) {
                    ArrayList<WeakReference<View>> arrayList2 = f1970d;
                    View view = arrayList2.get(size).get();
                    if (view == null) {
                        arrayList2.remove(size);
                    } else {
                        this.f1971a.put(view, Boolean.TRUE);
                        for (ViewParent parent = view.getParent(); parent instanceof View; parent = parent.getParent()) {
                            this.f1971a.put((View) parent, Boolean.TRUE);
                        }
                    }
                }
            }
        }

        boolean b(View view, KeyEvent keyEvent) {
            if (keyEvent.getAction() == 0) {
                g();
            }
            View viewC = c(view, keyEvent);
            if (keyEvent.getAction() == 0) {
                int keyCode = keyEvent.getKeyCode();
                if (viewC != null && !KeyEvent.isModifierKey(keyCode)) {
                    d().put(keyCode, new WeakReference<>(viewC));
                }
            }
            return viewC != null;
        }

        boolean f(KeyEvent keyEvent) {
            int iIndexOfKey;
            WeakReference<KeyEvent> weakReference = this.f1973c;
            if (weakReference != null && weakReference.get() == keyEvent) {
                return false;
            }
            this.f1973c = new WeakReference<>(keyEvent);
            WeakReference<View> weakReferenceValueAt = null;
            SparseArray<WeakReference<View>> sparseArrayD = d();
            if (keyEvent.getAction() == 1 && (iIndexOfKey = sparseArrayD.indexOfKey(keyEvent.getKeyCode())) >= 0) {
                weakReferenceValueAt = sparseArrayD.valueAt(iIndexOfKey);
                sparseArrayD.removeAt(iIndexOfKey);
            }
            if (weakReferenceValueAt == null) {
                weakReferenceValueAt = sparseArrayD.get(keyEvent.getKeyCode());
            }
            if (weakReferenceValueAt == null) {
                return false;
            }
            View view = weakReferenceValueAt.get();
            if (view != null && y.U(view)) {
                e(view, keyEvent);
            }
            return true;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    private static androidx.core.view.u A(View view) {
        return view instanceof androidx.core.view.u ? (androidx.core.view.u) view : f1959l;
    }

    public static void A0(View view, boolean z2) {
        if (Build.VERSION.SDK_INT >= 16) {
            h.r(view, z2);
        }
    }

    public static boolean B(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.b(view);
        }
        return false;
    }

    public static void B0(View view, int i3) {
        int i4 = Build.VERSION.SDK_INT;
        if (i4 >= 19) {
            h.s(view, i3);
        } else if (i4 >= 16) {
            if (i3 == 4) {
                i3 = 2;
            }
            h.s(view, i3);
        }
    }

    public static int C(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.c(view);
        }
        return 0;
    }

    public static void C0(View view, int i3) {
        if (Build.VERSION.SDK_INT >= 26) {
            o.l(view, i3);
        }
    }

    @SuppressLint({"InlinedApi"})
    public static int D(View view) {
        if (Build.VERSION.SDK_INT >= 26) {
            return o.b(view);
        }
        return 0;
    }

    public static void D0(View view, androidx.core.view.s sVar) {
        if (Build.VERSION.SDK_INT >= 21) {
            m.u(view, sVar);
        }
    }

    public static int E(View view) {
        if (Build.VERSION.SDK_INT >= 17) {
            return i.d(view);
        }
        return 0;
    }

    public static void E0(View view, int i3, int i4, int i5, int i6) {
        if (Build.VERSION.SDK_INT >= 17) {
            i.k(view, i3, i4, i5, i6);
        } else {
            view.setPadding(i3, i4, i5, i6);
        }
    }

    public static int F(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.d(view);
        }
        if (!f1952e) {
            try {
                Field declaredField = View.class.getDeclaredField("mMinHeight");
                f1951d = declaredField;
                declaredField.setAccessible(true);
            } catch (NoSuchFieldException unused) {
            }
            f1952e = true;
        }
        Field field = f1951d;
        if (field == null) {
            return 0;
        }
        try {
            return ((Integer) field.get(view)).intValue();
        } catch (Exception unused2) {
            return 0;
        }
    }

    public static void F0(View view, boolean z2) {
        q0().g(view, Boolean.valueOf(z2));
    }

    public static int G(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.e(view);
        }
        if (!f1950c) {
            try {
                Field declaredField = View.class.getDeclaredField("mMinWidth");
                f1949b = declaredField;
                declaredField.setAccessible(true);
            } catch (NoSuchFieldException unused) {
            }
            f1950c = true;
        }
        Field field = f1949b;
        if (field == null) {
            return 0;
        }
        try {
            return ((Integer) field.get(view)).intValue();
        } catch (Exception unused2) {
            return 0;
        }
    }

    public static void G0(View view, int i3, int i4) {
        if (Build.VERSION.SDK_INT >= 23) {
            n.d(view, i3, i4);
        }
    }

    public static String[] H(View view) {
        return Build.VERSION.SDK_INT >= 31 ? s.a(view) : (String[]) view.getTag(r.b.N);
    }

    public static void H0(View view, String str) {
        if (Build.VERSION.SDK_INT >= 21) {
            m.v(view, str);
            return;
        }
        if (f1953f == null) {
            f1953f = new WeakHashMap<>();
        }
        f1953f.put(view, str);
    }

    public static int I(View view) {
        return Build.VERSION.SDK_INT >= 17 ? i.e(view) : view.getPaddingRight();
    }

    private static void I0(View view) {
        if (C(view) == 0) {
            B0(view, 1);
        }
        for (ViewParent parent = view.getParent(); parent instanceof View; parent = parent.getParent()) {
            if (C((View) parent) == 4) {
                B0(view, 2);
                return;
            }
        }
    }

    public static int J(View view) {
        return Build.VERSION.SDK_INT >= 17 ? i.f(view) : view.getPaddingLeft();
    }

    private static f<CharSequence> J0() {
        return new c(r.b.P, CharSequence.class, 64, 30);
    }

    public static j0 K(View view) {
        int i3 = Build.VERSION.SDK_INT;
        if (i3 >= 23) {
            return n.a(view);
        }
        if (i3 >= 21) {
            return m.j(view);
        }
        return null;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static void K0(View view) {
        if (Build.VERSION.SDK_INT >= 21) {
            m.z(view);
        } else if (view instanceof androidx.core.view.m) {
            ((androidx.core.view.m) view).stopNestedScroll();
        }
    }

    public static CharSequence L(View view) {
        return J0().f(view);
    }

    private static void L0(View view) {
        float translationY = view.getTranslationY();
        view.setTranslationY(1.0f + translationY);
        view.setTranslationY(translationY);
    }

    public static String M(View view) {
        if (Build.VERSION.SDK_INT >= 21) {
            return m.k(view);
        }
        WeakHashMap<View, String> weakHashMap = f1953f;
        if (weakHashMap == null) {
            return null;
        }
        return weakHashMap.get(view);
    }

    @Deprecated
    public static int N(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.g(view);
        }
        return 0;
    }

    public static float O(View view) {
        if (Build.VERSION.SDK_INT >= 21) {
            return m.m(view);
        }
        return 0.0f;
    }

    public static boolean P(View view) {
        return o(view) != null;
    }

    public static boolean Q(View view) {
        if (Build.VERSION.SDK_INT >= 15) {
            return g.a(view);
        }
        return false;
    }

    public static boolean R(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.h(view);
        }
        return true;
    }

    public static boolean S(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.i(view);
        }
        return false;
    }

    public static boolean T(View view) {
        Boolean boolF = b().f(view);
        return boolF != null && boolF.booleanValue();
    }

    public static boolean U(View view) {
        return Build.VERSION.SDK_INT >= 19 ? k.b(view) : view.getWindowToken() != null;
    }

    public static boolean V(View view) {
        return Build.VERSION.SDK_INT >= 19 ? k.c(view) : view.getWidth() > 0 && view.getHeight() > 0;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static boolean W(View view) {
        if (Build.VERSION.SDK_INT >= 21) {
            return m.p(view);
        }
        if (view instanceof androidx.core.view.m) {
            return ((androidx.core.view.m) view).isNestedScrollingEnabled();
        }
        return false;
    }

    public static boolean X(View view) {
        if (Build.VERSION.SDK_INT >= 17) {
            return i.g(view);
        }
        return false;
    }

    public static boolean Y(View view) {
        Boolean boolF = q0().f(view);
        return boolF != null && boolF.booleanValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static /* synthetic */ androidx.core.view.c Z(androidx.core.view.c cVar) {
        return cVar;
    }

    static void a0(View view, int i3) {
        AccessibilityManager accessibilityManager = (AccessibilityManager) view.getContext().getSystemService("accessibility");
        if (accessibilityManager.isEnabled()) {
            boolean z2 = r(view) != null && view.isShown() && view.getWindowVisibility() == 0;
            if (q(view) != 0 || z2) {
                AccessibilityEvent accessibilityEventObtain = AccessibilityEvent.obtain();
                accessibilityEventObtain.setEventType(z2 ? 32 : 2048);
                k.g(accessibilityEventObtain, i3);
                if (z2) {
                    accessibilityEventObtain.getText().add(r(view));
                    I0(view);
                }
                view.sendAccessibilityEventUnchecked(accessibilityEventObtain);
                return;
            }
            if (i3 == 32) {
                AccessibilityEvent accessibilityEventObtain2 = AccessibilityEvent.obtain();
                view.onInitializeAccessibilityEvent(accessibilityEventObtain2);
                accessibilityEventObtain2.setEventType(32);
                k.g(accessibilityEventObtain2, i3);
                accessibilityEventObtain2.setSource(view);
                view.onPopulateAccessibilityEvent(accessibilityEventObtain2);
                accessibilityEventObtain2.getText().add(r(view));
                accessibilityManager.sendAccessibilityEvent(accessibilityEventObtain2);
                return;
            }
            if (view.getParent() != null) {
                try {
                    k.e(view.getParent(), view, view, i3);
                } catch (AbstractMethodError e3) {
                    Log.e("ViewCompat", view.getParent().getClass().getSimpleName() + " does not fully implement ViewParent", e3);
                }
            }
        }
    }

    private static f<Boolean> b() {
        return new d(r.b.J, Boolean.class, 28);
    }

    public static void b0(View view, int i3) {
        int i4 = Build.VERSION.SDK_INT;
        if (i4 >= 23) {
            view.offsetLeftAndRight(i3);
            return;
        }
        if (i4 < 21) {
            f(view, i3);
            return;
        }
        Rect rectZ = z();
        boolean z2 = false;
        Object parent = view.getParent();
        if (parent instanceof View) {
            View view2 = (View) parent;
            rectZ.set(view2.getLeft(), view2.getTop(), view2.getRight(), view2.getBottom());
            z2 = !rectZ.intersects(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
        }
        f(view, i3);
        if (z2 && rectZ.intersect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {
            ((View) parent).invalidate(rectZ);
        }
    }

    public static int c(View view, CharSequence charSequence, androidx.core.view.accessibility.g gVar) {
        int iT = t(view, charSequence);
        if (iT != -1) {
            d(view, new d.a(iT, charSequence, gVar));
        }
        return iT;
    }

    public static void c0(View view, int i3) {
        int i4 = Build.VERSION.SDK_INT;
        if (i4 >= 23) {
            view.offsetTopAndBottom(i3);
            return;
        }
        if (i4 < 21) {
            g(view, i3);
            return;
        }
        Rect rectZ = z();
        boolean z2 = false;
        Object parent = view.getParent();
        if (parent instanceof View) {
            View view2 = (View) parent;
            rectZ.set(view2.getLeft(), view2.getTop(), view2.getRight(), view2.getBottom());
            z2 = !rectZ.intersects(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
        }
        g(view, i3);
        if (z2 && rectZ.intersect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())) {
            ((View) parent).invalidate(rectZ);
        }
    }

    private static void d(View view, d.a aVar) {
        if (Build.VERSION.SDK_INT >= 21) {
            l(view);
            m0(aVar.b(), view);
            s(view).add(aVar);
            a0(view, 0);
        }
    }

    public static j0 d0(View view, j0 j0Var) {
        WindowInsets windowInsetsT;
        if (Build.VERSION.SDK_INT >= 21 && (windowInsetsT = j0Var.t()) != null) {
            WindowInsets windowInsetsB = l.b(view, windowInsetsT);
            if (!windowInsetsB.equals(windowInsetsT)) {
                return j0.v(windowInsetsB, view);
            }
        }
        return j0Var;
    }

    public static e0 e(View view) {
        if (f1954g == null) {
            f1954g = new WeakHashMap<>();
        }
        e0 e0Var = f1954g.get(view);
        if (e0Var != null) {
            return e0Var;
        }
        e0 e0Var2 = new e0(view);
        f1954g.put(view, e0Var2);
        return e0Var2;
    }

    public static void e0(View view, androidx.core.view.accessibility.d dVar) {
        view.onInitializeAccessibilityNodeInfo(dVar.v0());
    }

    private static void f(View view, int i3) {
        view.offsetLeftAndRight(i3);
        if (view.getVisibility() == 0) {
            L0(view);
            Object parent = view.getParent();
            if (parent instanceof View) {
                L0((View) parent);
            }
        }
    }

    private static f<CharSequence> f0() {
        return new b(r.b.K, CharSequence.class, 8, 28);
    }

    private static void g(View view, int i3) {
        view.offsetTopAndBottom(i3);
        if (view.getVisibility() == 0) {
            L0(view);
            Object parent = view.getParent();
            if (parent instanceof View) {
                L0((View) parent);
            }
        }
    }

    public static boolean g0(View view, int i3, Bundle bundle) {
        if (Build.VERSION.SDK_INT >= 16) {
            return h.j(view, i3, bundle);
        }
        return false;
    }

    public static j0 h(View view, j0 j0Var, Rect rect) {
        return Build.VERSION.SDK_INT >= 21 ? m.b(view, j0Var, rect) : j0Var;
    }

    public static androidx.core.view.c h0(View view, androidx.core.view.c cVar) {
        if (Log.isLoggable("ViewCompat", 3)) {
            Log.d("ViewCompat", "performReceiveContent: " + cVar + ", view=" + view.getClass().getSimpleName() + "[" + view.getId() + "]");
        }
        if (Build.VERSION.SDK_INT >= 31) {
            return s.b(view, cVar);
        }
        androidx.core.view.t tVar = (androidx.core.view.t) view.getTag(r.b.M);
        if (tVar == null) {
            return A(view).a(cVar);
        }
        androidx.core.view.c cVarA = tVar.a(view, cVar);
        if (cVarA == null) {
            return null;
        }
        return A(view).a(cVarA);
    }

    public static j0 i(View view, j0 j0Var) {
        WindowInsets windowInsetsT;
        if (Build.VERSION.SDK_INT >= 21 && (windowInsetsT = j0Var.t()) != null) {
            WindowInsets windowInsetsA = l.a(view, windowInsetsT);
            if (!windowInsetsA.equals(windowInsetsT)) {
                return j0.v(windowInsetsA, view);
            }
        }
        return j0Var;
    }

    public static void i0(View view) {
        if (Build.VERSION.SDK_INT >= 16) {
            h.k(view);
        } else {
            view.postInvalidate();
        }
    }

    static boolean j(View view, KeyEvent keyEvent) {
        if (Build.VERSION.SDK_INT >= 28) {
            return false;
        }
        return v.a(view).b(view, keyEvent);
    }

    public static void j0(View view, Runnable runnable) {
        if (Build.VERSION.SDK_INT >= 16) {
            h.m(view, runnable);
        } else {
            view.postDelayed(runnable, ValueAnimator.getFrameDelay());
        }
    }

    static boolean k(View view, KeyEvent keyEvent) {
        if (Build.VERSION.SDK_INT >= 28) {
            return false;
        }
        return v.a(view).f(keyEvent);
    }

    @SuppressLint({"LambdaLast"})
    public static void k0(View view, Runnable runnable, long j3) {
        if (Build.VERSION.SDK_INT >= 16) {
            h.n(view, runnable, j3);
        } else {
            view.postDelayed(runnable, ValueAnimator.getFrameDelay() + j3);
        }
    }

    static void l(View view) {
        androidx.core.view.a aVarN = n(view);
        if (aVarN == null) {
            aVarN = new androidx.core.view.a();
        }
        r0(view, aVarN);
    }

    public static void l0(View view, int i3) {
        if (Build.VERSION.SDK_INT >= 21) {
            m0(i3, view);
            a0(view, 0);
        }
    }

    public static int m() {
        AtomicInteger atomicInteger;
        int i3;
        int i4;
        if (Build.VERSION.SDK_INT >= 17) {
            return i.a();
        }
        do {
            atomicInteger = f1948a;
            i3 = atomicInteger.get();
            i4 = i3 + 1;
            if (i4 > 16777215) {
                i4 = 1;
            }
        } while (!atomicInteger.compareAndSet(i3, i4));
        return i3;
    }

    private static void m0(int i3, View view) {
        List<d.a> listS = s(view);
        for (int i4 = 0; i4 < listS.size(); i4++) {
            if (listS.get(i4).b() == i3) {
                listS.remove(i4);
                return;
            }
        }
    }

    public static androidx.core.view.a n(View view) {
        View.AccessibilityDelegate accessibilityDelegateO = o(view);
        if (accessibilityDelegateO == null) {
            return null;
        }
        return accessibilityDelegateO instanceof a.C0020a ? ((a.C0020a) accessibilityDelegateO).f1839a : new androidx.core.view.a(accessibilityDelegateO);
    }

    public static void n0(View view, d.a aVar, CharSequence charSequence, androidx.core.view.accessibility.g gVar) {
        if (gVar == null && charSequence == null) {
            l0(view, aVar.b());
        } else {
            d(view, aVar.a(charSequence, gVar));
        }
    }

    private static View.AccessibilityDelegate o(View view) {
        return Build.VERSION.SDK_INT >= 29 ? q.a(view) : p(view);
    }

    public static void o0(View view) {
        int i3 = Build.VERSION.SDK_INT;
        if (i3 >= 20) {
            l.c(view);
        } else if (i3 >= 16) {
            h.p(view);
        }
    }

    private static View.AccessibilityDelegate p(View view) {
        if (f1956i) {
            return null;
        }
        if (f1955h == null) {
            try {
                Field declaredField = View.class.getDeclaredField("mAccessibilityDelegate");
                f1955h = declaredField;
                declaredField.setAccessible(true);
            } catch (Throwable unused) {
                f1956i = true;
                return null;
            }
        }
        try {
            Object obj = f1955h.get(view);
            if (obj instanceof View.AccessibilityDelegate) {
                return (View.AccessibilityDelegate) obj;
            }
            return null;
        } catch (Throwable unused2) {
            f1956i = true;
            return null;
        }
    }

    public static void p0(View view, @SuppressLint({"ContextFirst"}) Context context, int[] iArr, AttributeSet attributeSet, TypedArray typedArray, int i3, int i4) {
        if (Build.VERSION.SDK_INT >= 29) {
            q.c(view, context, iArr, attributeSet, typedArray, i3, i4);
        }
    }

    public static int q(View view) {
        if (Build.VERSION.SDK_INT >= 19) {
            return k.a(view);
        }
        return 0;
    }

    private static f<Boolean> q0() {
        return new a(r.b.O, Boolean.class, 28);
    }

    public static CharSequence r(View view) {
        return f0().f(view);
    }

    public static void r0(View view, androidx.core.view.a aVar) {
        if (aVar == null && (o(view) instanceof a.C0020a)) {
            aVar = new androidx.core.view.a();
        }
        view.setAccessibilityDelegate(aVar == null ? null : aVar.d());
    }

    private static List<d.a> s(View view) {
        int i3 = r.b.H;
        ArrayList arrayList = (ArrayList) view.getTag(i3);
        if (arrayList != null) {
            return arrayList;
        }
        ArrayList arrayList2 = new ArrayList();
        view.setTag(i3, arrayList2);
        return arrayList2;
    }

    public static void s0(View view, boolean z2) {
        b().g(view, Boolean.valueOf(z2));
    }

    private static int t(View view, CharSequence charSequence) {
        List<d.a> listS = s(view);
        for (int i3 = 0; i3 < listS.size(); i3++) {
            if (TextUtils.equals(charSequence, listS.get(i3).c())) {
                return listS.get(i3).b();
            }
        }
        int i4 = -1;
        int i5 = 0;
        while (true) {
            int[] iArr = f1958k;
            if (i5 >= iArr.length || i4 != -1) {
                break;
            }
            int i6 = iArr[i5];
            boolean z2 = true;
            for (int i7 = 0; i7 < listS.size(); i7++) {
                z2 &= listS.get(i7).b() != i6;
            }
            if (z2) {
                i4 = i6;
            }
            i5++;
        }
        return i4;
    }

    public static void t0(View view, int i3) {
        if (Build.VERSION.SDK_INT >= 19) {
            k.f(view, i3);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static ColorStateList u(View view) {
        if (Build.VERSION.SDK_INT >= 21) {
            return m.g(view);
        }
        if (view instanceof w) {
            return ((w) view).getSupportBackgroundTintList();
        }
        return null;
    }

    public static void u0(View view, CharSequence charSequence) {
        if (Build.VERSION.SDK_INT >= 19) {
            f0().g(view, charSequence);
            if (charSequence != null) {
                f1960m.a(view);
            } else {
                f1960m.d(view);
            }
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static PorterDuff.Mode v(View view) {
        if (Build.VERSION.SDK_INT >= 21) {
            return m.h(view);
        }
        if (view instanceof w) {
            return ((w) view).getSupportBackgroundTintMode();
        }
        return null;
    }

    public static void v0(View view, Drawable drawable) {
        if (Build.VERSION.SDK_INT >= 16) {
            h.q(view, drawable);
        } else {
            view.setBackgroundDrawable(drawable);
        }
    }

    public static Rect w(View view) {
        if (Build.VERSION.SDK_INT >= 18) {
            return j.a(view);
        }
        return null;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static void w0(View view, ColorStateList colorStateList) {
        int i3 = Build.VERSION.SDK_INT;
        if (i3 < 21) {
            if (view instanceof w) {
                ((w) view).setSupportBackgroundTintList(colorStateList);
                return;
            }
            return;
        }
        m.q(view, colorStateList);
        if (i3 == 21) {
            Drawable background = view.getBackground();
            boolean z2 = (m.g(view) == null && m.h(view) == null) ? false : true;
            if (background == null || !z2) {
                return;
            }
            if (background.isStateful()) {
                background.setState(view.getDrawableState());
            }
            h.q(view, background);
        }
    }

    public static Display x(View view) {
        if (Build.VERSION.SDK_INT >= 17) {
            return i.b(view);
        }
        if (U(view)) {
            return ((WindowManager) view.getContext().getSystemService("window")).getDefaultDisplay();
        }
        return null;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static void x0(View view, PorterDuff.Mode mode) {
        int i3 = Build.VERSION.SDK_INT;
        if (i3 < 21) {
            if (view instanceof w) {
                ((w) view).setSupportBackgroundTintMode(mode);
                return;
            }
            return;
        }
        m.r(view, mode);
        if (i3 == 21) {
            Drawable background = view.getBackground();
            boolean z2 = (m.g(view) == null && m.h(view) == null) ? false : true;
            if (background == null || !z2) {
                return;
            }
            if (background.isStateful()) {
                background.setState(view.getDrawableState());
            }
            h.q(view, background);
        }
    }

    public static float y(View view) {
        if (Build.VERSION.SDK_INT >= 21) {
            return m.i(view);
        }
        return 0.0f;
    }

    public static void y0(View view, Rect rect) {
        if (Build.VERSION.SDK_INT >= 18) {
            j.c(view, rect);
        }
    }

    private static Rect z() {
        if (f1957j == null) {
            f1957j = new ThreadLocal<>();
        }
        Rect rect = f1957j.get();
        if (rect == null) {
            rect = new Rect();
            f1957j.set(rect);
        }
        rect.setEmpty();
        return rect;
    }

    public static void z0(View view, float f3) {
        if (Build.VERSION.SDK_INT >= 21) {
            m.s(view, f3);
        }
    }
}
