package ῲ.䀟.K;

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import androidx.recyclerview.widget.RecyclerView;
import java.util.Map;
import java.util.WeakHashMap;
import ῲ.ᨨ.ᨨ.C1729;
import ῲ.ᨨ.ᨨ.C1747;
import ῲ.ᨨ.ᨨ.䃖.C1778;
import ῲ.ᨨ.ᨨ.䃖.C1782;

/* renamed from: ῲ.䀟.K.ݜ  reason: contains not printable characters */
/* compiled from: RecyclerViewAccessibilityDelegate */
public class C2304 extends C1747 {
    public final C2305 mItemDelegate;
    public final RecyclerView mRecyclerView;

    /* renamed from: ῲ.䀟.K.ݜ$K  reason: contains not printable characters */
    /* compiled from: RecyclerViewAccessibilityDelegate */
    public static class C2305 extends C1747 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public Map<View, C1747> f7964 = new WeakHashMap();

        /* renamed from: K  reason: contains not printable characters */
        public final C2304 f7965;

        public C2305(C2304 r2) {
            this.f7965 = r2;
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public boolean dispatchPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
            C1747 k = this.f7964.get(view);
            if (k != null) {
                return k.dispatchPopulateAccessibilityEvent(view, accessibilityEvent);
            }
            return super.dispatchPopulateAccessibilityEvent(view, accessibilityEvent);
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public C1778 getAccessibilityNodeProvider(View view) {
            C1747 k = this.f7964.get(view);
            if (k != null) {
                return k.getAccessibilityNodeProvider(view);
            }
            return super.getAccessibilityNodeProvider(view);
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
            C1747 k = this.f7964.get(view);
            if (k != null) {
                k.onInitializeAccessibilityEvent(view, accessibilityEvent);
            } else {
                super.onInitializeAccessibilityEvent(view, accessibilityEvent);
            }
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public void onInitializeAccessibilityNodeInfo(View view, C1782 r3) {
            if (this.f7965.shouldIgnore() || this.f7965.mRecyclerView.getLayoutManager() == null) {
                super.onInitializeAccessibilityNodeInfo(view, r3);
                return;
            }
            this.f7965.mRecyclerView.getLayoutManager().onInitializeAccessibilityNodeInfoForItem(view, r3);
            C1747 k = this.f7964.get(view);
            if (k != null) {
                k.onInitializeAccessibilityNodeInfo(view, r3);
            } else {
                super.onInitializeAccessibilityNodeInfo(view, r3);
            }
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public void onPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
            C1747 k = this.f7964.get(view);
            if (k != null) {
                k.onPopulateAccessibilityEvent(view, accessibilityEvent);
            } else {
                super.onPopulateAccessibilityEvent(view, accessibilityEvent);
            }
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public boolean onRequestSendAccessibilityEvent(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
            C1747 k = this.f7964.get(viewGroup);
            if (k != null) {
                return k.onRequestSendAccessibilityEvent(viewGroup, view, accessibilityEvent);
            }
            return super.onRequestSendAccessibilityEvent(viewGroup, view, accessibilityEvent);
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public boolean performAccessibilityAction(View view, int i, Bundle bundle) {
            if (this.f7965.shouldIgnore() || this.f7965.mRecyclerView.getLayoutManager() == null) {
                return super.performAccessibilityAction(view, i, bundle);
            }
            C1747 k = this.f7964.get(view);
            if (k != null) {
                if (k.performAccessibilityAction(view, i, bundle)) {
                    return true;
                }
            } else if (super.performAccessibilityAction(view, i, bundle)) {
                return true;
            }
            return this.f7965.mRecyclerView.getLayoutManager().performAccessibilityActionForItem(view, i, bundle);
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public void sendAccessibilityEvent(View view, int i) {
            C1747 k = this.f7964.get(view);
            if (k != null) {
                k.sendAccessibilityEvent(view, i);
            } else {
                super.sendAccessibilityEvent(view, i);
            }
        }

        @Override // ῲ.ᨨ.ᨨ.C1747
        public void sendAccessibilityEventUnchecked(View view, AccessibilityEvent accessibilityEvent) {
            C1747 k = this.f7964.get(view);
            if (k != null) {
                k.sendAccessibilityEventUnchecked(view, accessibilityEvent);
            } else {
                super.sendAccessibilityEventUnchecked(view, accessibilityEvent);
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m6029(View view) {
            C1747 r0 = C1729.m4459(view);
            if (r0 != null && r0 != this) {
                this.f7964.put(view, r0);
            }
        }
    }

    public C2304(RecyclerView recyclerView) {
        this.mRecyclerView = recyclerView;
        C1747 itemDelegate = getItemDelegate();
        if (itemDelegate == null || !(itemDelegate instanceof C2305)) {
            this.mItemDelegate = new C2305(this);
        } else {
            this.mItemDelegate = (C2305) itemDelegate;
        }
    }

    public C1747 getItemDelegate() {
        return this.mItemDelegate;
    }

    @Override // ῲ.ᨨ.ᨨ.C1747
    public void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
        super.onInitializeAccessibilityEvent(view, accessibilityEvent);
        if ((view instanceof RecyclerView) && !shouldIgnore()) {
            RecyclerView recyclerView = (RecyclerView) view;
            if (recyclerView.getLayoutManager() != null) {
                recyclerView.getLayoutManager().onInitializeAccessibilityEvent(accessibilityEvent);
            }
        }
    }

    @Override // ῲ.ᨨ.ᨨ.C1747
    public void onInitializeAccessibilityNodeInfo(View view, C1782 r2) {
        super.onInitializeAccessibilityNodeInfo(view, r2);
        if (!shouldIgnore() && this.mRecyclerView.getLayoutManager() != null) {
            this.mRecyclerView.getLayoutManager().onInitializeAccessibilityNodeInfo(r2);
        }
    }

    @Override // ῲ.ᨨ.ᨨ.C1747
    public boolean performAccessibilityAction(View view, int i, Bundle bundle) {
        if (super.performAccessibilityAction(view, i, bundle)) {
            return true;
        }
        if (shouldIgnore() || this.mRecyclerView.getLayoutManager() == null) {
            return false;
        }
        return this.mRecyclerView.getLayoutManager().performAccessibilityAction(i, bundle);
    }

    public boolean shouldIgnore() {
        return this.mRecyclerView.hasPendingAdapterUpdates();
    }
}
