package y3;

import androidx.viewpager2.widget.ViewPager2;
import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public final class f extends k {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f36785a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f36786b;

    public /* synthetic */ f(ViewPager2 viewPager2, int i10) {
        this.f36785a = i10;
        this.f36786b = viewPager2;
    }

    @Override // y3.k
    public final void a(int i10) {
        int i11 = this.f36785a;
        Object obj = this.f36786b;
        switch (i11) {
            case 0:
                if (i10 == 0) {
                    ((ViewPager2) obj).d();
                    return;
                }
                return;
            case 1:
            default:
                return;
            case 2:
                try {
                    Iterator it = ((List) obj).iterator();
                    while (it.hasNext()) {
                        ((k) it.next()).a(i10);
                        break;
                    }
                    return;
                } catch (ConcurrentModificationException e10) {
                    throw new IllegalStateException("Adding and removing callbacks during dispatch to callbacks is not supported", e10);
                }
        }
    }

    @Override // y3.k
    public final void b(int i10, float f10, int i11) {
        switch (this.f36785a) {
            case 2:
                try {
                    Iterator it = ((List) this.f36786b).iterator();
                    while (it.hasNext()) {
                        ((k) it.next()).b(i10, f10, i11);
                        break;
                    }
                    return;
                } catch (ConcurrentModificationException e10) {
                    throw new IllegalStateException("Adding and removing callbacks during dispatch to callbacks is not supported", e10);
                }
            default:
                return;
        }
    }

    @Override // y3.k
    public final void c(int i10) {
        int i11 = this.f36785a;
        Object obj = this.f36786b;
        switch (i11) {
            case 0:
                ViewPager2 viewPager2 = (ViewPager2) obj;
                if (viewPager2.f4394d != i10) {
                    viewPager2.f4394d = i10;
                    viewPager2.W.b();
                    return;
                }
                return;
            case 1:
                ViewPager2 viewPager22 = (ViewPager2) obj;
                viewPager22.clearFocus();
                if (viewPager22.hasFocus()) {
                    viewPager22.f4400j.requestFocus(2);
                    return;
                }
                return;
            default:
                try {
                    Iterator it = ((List) obj).iterator();
                    while (it.hasNext()) {
                        ((k) it.next()).c(i10);
                        break;
                    }
                    return;
                } catch (ConcurrentModificationException e10) {
                    throw new IllegalStateException("Adding and removing callbacks during dispatch to callbacks is not supported", e10);
                }
        }
    }

    public f() {
        this.f36785a = 2;
        this.f36786b = new ArrayList(3);
    }
}
