package o;

import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.gms.common.R;
import com.google.android.material.carousel.CarouselLayoutManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Ig, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0214Ig extends AbstractC0870c10 {
    public final Paint a;
    public final List b;

    public C0214Ig() {
        Paint paint = new Paint();
        this.a = paint;
        this.b = Collections.unmodifiableList(new ArrayList());
        paint.setStrokeWidth(5.0f);
        paint.setColor(-65281);
    }

    @Override // o.AbstractC0870c10
    public final void b(Canvas canvas, RecyclerView recyclerView) throws Resources.NotFoundException {
        Canvas canvas2;
        int iF;
        int iD;
        float dimension = recyclerView.getResources().getDimension(R.dimen.m3_carousel_debug_keyline_width);
        Paint paint = this.a;
        paint.setStrokeWidth(dimension);
        Iterator it = this.b.iterator();
        while (it.hasNext()) {
            ((WJ) it.next()).getClass();
            ThreadLocal threadLocal = AbstractC0501Ti.a;
            float f = 1.0f - 0.0f;
            paint.setColor(Color.argb((int) ((Color.alpha(-16776961) * 0.0f) + (Color.alpha(-65281) * f)), (int) ((Color.red(-16776961) * 0.0f) + (Color.red(-65281) * f)), (int) ((Color.green(-16776961) * 0.0f) + (Color.green(-65281) * f)), (int) ((Color.blue(-16776961) * 0.0f) + (Color.blue(-65281) * f))));
            int iE = 0;
            if (((CarouselLayoutManager) recyclerView.getLayoutManager()).A0()) {
                C0240Jg c0240Jg = ((CarouselLayoutManager) recyclerView.getLayoutManager()).q;
                switch (c0240Jg.b) {
                    case 0:
                        break;
                    default:
                        iE = c0240Jg.c.G();
                        break;
                }
                float f2 = iE;
                C0240Jg c0240Jg2 = ((CarouselLayoutManager) recyclerView.getLayoutManager()).q;
                switch (c0240Jg2.b) {
                    case 0:
                        iD = c0240Jg2.c.f519o;
                        break;
                    default:
                        CarouselLayoutManager carouselLayoutManager = c0240Jg2.c;
                        iD = carouselLayoutManager.f519o - carouselLayoutManager.D();
                        break;
                }
                canvas2 = canvas;
                canvas2.drawLine(0.0f, f2, 0.0f, iD, paint);
            } else {
                canvas2 = canvas;
                C0240Jg c0240Jg3 = ((CarouselLayoutManager) recyclerView.getLayoutManager()).q;
                switch (c0240Jg3.b) {
                    case 0:
                        iE = c0240Jg3.c.E();
                        break;
                }
                float f3 = iE;
                C0240Jg c0240Jg4 = ((CarouselLayoutManager) recyclerView.getLayoutManager()).q;
                switch (c0240Jg4.b) {
                    case 0:
                        CarouselLayoutManager carouselLayoutManager2 = c0240Jg4.c;
                        iF = carouselLayoutManager2.n - carouselLayoutManager2.F();
                        break;
                    default:
                        iF = c0240Jg4.c.n;
                        break;
                }
                canvas2.drawLine(f3, 0.0f, iF, 0.0f, paint);
            }
            canvas = canvas2;
        }
    }
}
