206 lines
8.7 KiB
Java
206 lines
8.7 KiB
Java
|
package o;
|
||
|
|
||
|
import android.os.Bundle;
|
||
|
import android.text.style.ClickableSpan;
|
||
|
import android.util.SparseArray;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.view.accessibility.AccessibilityEvent;
|
||
|
import android.view.accessibility.AccessibilityNodeInfo;
|
||
|
import android.view.accessibility.AccessibilityNodeProvider;
|
||
|
import androidx.core.view.ViewCompat;
|
||
|
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
||
|
import androidx.core.view.accessibility.AccessibilityNodeProviderCompat;
|
||
|
import java.lang.ref.WeakReference;
|
||
|
import java.util.Collections;
|
||
|
import java.util.List;
|
||
|
import o.KtR;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public class yZt {
|
||
|
private static final View.AccessibilityDelegate DEFAULT_DELEGATE = new View.AccessibilityDelegate();
|
||
|
private final View.AccessibilityDelegate mBridge;
|
||
|
private final View.AccessibilityDelegate mOriginalDelegate;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public static final class IeS extends View.AccessibilityDelegate {
|
||
|
public final yZt d;
|
||
|
|
||
|
IeS(yZt yzt) {
|
||
|
this.d = yzt;
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final boolean dispatchPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
return this.d.dispatchPopulateAccessibilityEvent(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
this.d.onInitializeAccessibilityEvent(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfo accessibilityNodeInfo) {
|
||
|
AccessibilityNodeInfoCompat tU_ = AccessibilityNodeInfoCompat.tU_(accessibilityNodeInfo);
|
||
|
tU_.m(ViewCompat.L(view));
|
||
|
tU_.h(ViewCompat.F(view));
|
||
|
tU_.h(ViewCompat.e(view));
|
||
|
tU_.i(ViewCompat.x(view));
|
||
|
this.d.onInitializeAccessibilityNodeInfo(view, tU_);
|
||
|
tU_.a(accessibilityNodeInfo.getText(), view);
|
||
|
List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> actionList = yZt.getActionList(view);
|
||
|
for (int i = 0; i < actionList.size(); i++) {
|
||
|
tU_.e(actionList.get(i));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final void onPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
this.d.onPopulateAccessibilityEvent(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final boolean onRequestSendAccessibilityEvent(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
|
||
|
return this.d.onRequestSendAccessibilityEvent(viewGroup, view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final void sendAccessibilityEvent(View view, int i) {
|
||
|
this.d.sendAccessibilityEvent(view, i);
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final void sendAccessibilityEventUnchecked(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
this.d.sendAccessibilityEventUnchecked(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final AccessibilityNodeProvider getAccessibilityNodeProvider(View view) {
|
||
|
AccessibilityNodeProviderCompat accessibilityNodeProvider = this.d.getAccessibilityNodeProvider(view);
|
||
|
if (accessibilityNodeProvider != null) {
|
||
|
return (AccessibilityNodeProvider) accessibilityNodeProvider.a();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.AccessibilityDelegate
|
||
|
public final boolean performAccessibilityAction(View view, int i, Bundle bundle) {
|
||
|
return this.d.performAccessibilityAction(view, i, bundle);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public yZt() {
|
||
|
this(DEFAULT_DELEGATE);
|
||
|
}
|
||
|
|
||
|
public yZt(View.AccessibilityDelegate accessibilityDelegate) {
|
||
|
this.mOriginalDelegate = accessibilityDelegate;
|
||
|
this.mBridge = new IeS(this);
|
||
|
}
|
||
|
|
||
|
public void sendAccessibilityEvent(View view, int i) {
|
||
|
this.mOriginalDelegate.sendAccessibilityEvent(view, i);
|
||
|
}
|
||
|
|
||
|
public void sendAccessibilityEventUnchecked(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
this.mOriginalDelegate.sendAccessibilityEventUnchecked(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
public boolean dispatchPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
return this.mOriginalDelegate.dispatchPopulateAccessibilityEvent(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
public void onPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
this.mOriginalDelegate.onPopulateAccessibilityEvent(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
public void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
||
|
this.mOriginalDelegate.onInitializeAccessibilityEvent(view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
public void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
||
|
this.mOriginalDelegate.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfoCompat.ub_());
|
||
|
}
|
||
|
|
||
|
public boolean onRequestSendAccessibilityEvent(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
|
||
|
return this.mOriginalDelegate.onRequestSendAccessibilityEvent(viewGroup, view, accessibilityEvent);
|
||
|
}
|
||
|
|
||
|
public AccessibilityNodeProviderCompat getAccessibilityNodeProvider(View view) {
|
||
|
AccessibilityNodeProvider qO_ = Sts.qO_(this.mOriginalDelegate, view);
|
||
|
if (qO_ != null) {
|
||
|
return new AccessibilityNodeProviderCompat(qO_);
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public boolean performAccessibilityAction(View view, int i, Bundle bundle) {
|
||
|
List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> actionList = getActionList(view);
|
||
|
boolean z = false;
|
||
|
int i2 = 0;
|
||
|
while (true) {
|
||
|
if (i2 >= actionList.size()) {
|
||
|
break;
|
||
|
}
|
||
|
AccessibilityNodeInfoCompat.AccessibilityActionCompat accessibilityActionCompat = actionList.get(i2);
|
||
|
if (accessibilityActionCompat.c() == i) {
|
||
|
z = accessibilityActionCompat.uc_(view, bundle);
|
||
|
break;
|
||
|
}
|
||
|
i2++;
|
||
|
}
|
||
|
if (!z) {
|
||
|
z = Sts.qP_(this.mOriginalDelegate, view, i, bundle);
|
||
|
}
|
||
|
return (z || i != KtR.Sts.accessibility_action_clickable_span || bundle == null) ? z : performClickableSpanAction(bundle.getInt("ACCESSIBILITY_CLICKABLE_SPAN_ID", -1), view);
|
||
|
}
|
||
|
|
||
|
private boolean performClickableSpanAction(int i, View view) {
|
||
|
WeakReference weakReference;
|
||
|
SparseArray sparseArray = (SparseArray) view.getTag(KtR.Sts.tag_accessibility_clickable_spans);
|
||
|
if (sparseArray == null || (weakReference = (WeakReference) sparseArray.get(i)) == null) {
|
||
|
return false;
|
||
|
}
|
||
|
ClickableSpan clickableSpan = (ClickableSpan) weakReference.get();
|
||
|
if (!isSpanStillValid(clickableSpan, view)) {
|
||
|
return false;
|
||
|
}
|
||
|
clickableSpan.onClick(view);
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
private boolean isSpanStillValid(ClickableSpan clickableSpan, View view) {
|
||
|
if (clickableSpan != null) {
|
||
|
ClickableSpan[] tT_ = AccessibilityNodeInfoCompat.tT_(view.createAccessibilityNodeInfo().getText());
|
||
|
for (int i = 0; tT_ != null && i < tT_.length; i++) {
|
||
|
if (clickableSpan.equals(tT_[i])) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
static List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> getActionList(View view) {
|
||
|
List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> list = (List) view.getTag(KtR.Sts.tag_accessibility_actions);
|
||
|
return list == null ? Collections.emptyList() : list;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes.dex */
|
||
|
public static class Sts {
|
||
|
static AccessibilityNodeProvider qO_(View.AccessibilityDelegate accessibilityDelegate, View view) {
|
||
|
return accessibilityDelegate.getAccessibilityNodeProvider(view);
|
||
|
}
|
||
|
|
||
|
static boolean qP_(View.AccessibilityDelegate accessibilityDelegate, View view, int i, Bundle bundle) {
|
||
|
return accessibilityDelegate.performAccessibilityAction(view, i, bundle);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public View.AccessibilityDelegate getBridge() {
|
||
|
return this.mBridge;
|
||
|
}
|
||
|
}
|