package androidx.viewpager2.widget;

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

/* loaded from: classes.dex */
final class b extends ViewPager2.i {

    /* renamed from: a, reason: collision with root package name */
    private final List f5813a;

    /* JADX INFO: Access modifiers changed from: package-private */
    public b(int i10) {
        this.f5813a = new ArrayList(i10);
    }

    private void f(ConcurrentModificationException concurrentModificationException) {
        throw new IllegalStateException("Adding and removing callbacks during dispatch to callbacks is not supported", concurrentModificationException);
    }

    @Override // androidx.viewpager2.widget.ViewPager2.i
    public void a(int i10) {
        try {
            Iterator it = this.f5813a.iterator();
            while (it.hasNext()) {
                ((ViewPager2.i) it.next()).a(i10);
            }
        } catch (ConcurrentModificationException e10) {
            f(e10);
        }
    }

    @Override // androidx.viewpager2.widget.ViewPager2.i
    public void b(int i10, float f10, int i11) {
        try {
            Iterator it = this.f5813a.iterator();
            while (it.hasNext()) {
                ((ViewPager2.i) it.next()).b(i10, f10, i11);
            }
        } catch (ConcurrentModificationException e10) {
            f(e10);
        }
    }

    @Override // androidx.viewpager2.widget.ViewPager2.i
    public void c(int i10) {
        try {
            Iterator it = this.f5813a.iterator();
            while (it.hasNext()) {
                ((ViewPager2.i) it.next()).c(i10);
            }
        } catch (ConcurrentModificationException e10) {
            f(e10);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void d(ViewPager2.i iVar) {
        this.f5813a.add(iVar);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void e(ViewPager2.i iVar) {
        this.f5813a.remove(iVar);
    }
}
