package o;

import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import com.google.android.gms.common.R;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.button.MaterialButtonToggleGroup;
import com.google.android.material.internal.CheckableImageButton;
import com.google.android.material.internal.NavigationMenuItemView;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.th, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2545th extends C2011o0 {
    public final /* synthetic */ int d;
    public final /* synthetic */ Object e;

    public /* synthetic */ C2545th(int i, Object obj) {
        this.d = i;
        this.e = obj;
    }

    @Override // o.C2011o0
    public void c(View view, AccessibilityEvent accessibilityEvent) {
        switch (this.d) {
            case 0:
                super.c(view, accessibilityEvent);
                accessibilityEvent.setChecked(((CheckableImageButton) this.e).f28o);
                break;
            default:
                super.c(view, accessibilityEvent);
                break;
        }
    }

    @Override // o.C2011o0
    public final void d(View view, H0 h0) {
        int i = this.d;
        Object obj = this.e;
        View.AccessibilityDelegate accessibilityDelegate = this.a;
        switch (i) {
            case 0:
                AccessibilityNodeInfo accessibilityNodeInfo = h0.a;
                accessibilityDelegate.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfo);
                CheckableImageButton checkableImageButton = (CheckableImageButton) obj;
                accessibilityNodeInfo.setCheckable(checkableImageButton.p);
                accessibilityNodeInfo.setChecked(checkableImageButton.f28o);
                break;
            case 1:
                accessibilityDelegate.onInitializeAccessibilityNodeInfo(view, h0.a);
                MaterialButtonToggleGroup materialButtonToggleGroup = (MaterialButtonToggleGroup) obj;
                int i2 = MaterialButtonToggleGroup.v;
                int i3 = -1;
                if (view instanceof MaterialButton) {
                    int i4 = 0;
                    int i5 = 0;
                    while (true) {
                        if (i4 < materialButtonToggleGroup.getChildCount()) {
                            if (materialButtonToggleGroup.getChildAt(i4) == view) {
                                i3 = i5;
                            } else {
                                if ((materialButtonToggleGroup.getChildAt(i4) instanceof MaterialButton) && materialButtonToggleGroup.c(i4)) {
                                    i5++;
                                }
                                i4++;
                            }
                        }
                    }
                }
                h0.k(G0.b(((MaterialButton) view).z, 0, 1, i3, 1));
                break;
            case 2:
                accessibilityDelegate.onInitializeAccessibilityNodeInfo(view, h0.a);
                VN vn = (VN) obj;
                h0.l(vn.w.getVisibility() == 0 ? vn.getString(R.string.mtrl_picker_toggle_to_year_selection) : vn.getString(R.string.mtrl_picker_toggle_to_day_selection));
                break;
            default:
                AccessibilityNodeInfo accessibilityNodeInfo2 = h0.a;
                accessibilityDelegate.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfo2);
                accessibilityNodeInfo2.setCheckable(((NavigationMenuItemView) obj).I);
                break;
        }
    }
}
