package com.google.android.material.tabs;

import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.view.View;

/* JADX INFO: loaded from: classes2.dex */
public final class a extends b {

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

    public /* synthetic */ a(int i10) {
        this.f23327a = i10;
    }

    @Override // com.google.android.material.tabs.b
    public final void a(TabLayout tabLayout, View view, View view2, float f10, Drawable drawable) {
        float fCos;
        float fCos2;
        switch (this.f23327a) {
            case 0:
                RectF rectFCalculateIndicatorWidthForTab = b.calculateIndicatorWidthForTab(tabLayout, view);
                RectF rectFCalculateIndicatorWidthForTab2 = b.calculateIndicatorWidthForTab(tabLayout, view2);
                if (rectFCalculateIndicatorWidthForTab.left < rectFCalculateIndicatorWidthForTab2.left) {
                    double d10 = (((double) f10) * 3.141592653589793d) / 2.0d;
                    fCos2 = (float) (1.0d - Math.cos(d10));
                    fCos = (float) Math.sin(d10);
                } else {
                    double d11 = (((double) f10) * 3.141592653589793d) / 2.0d;
                    float fSin = (float) Math.sin(d11);
                    fCos = (float) (1.0d - Math.cos(d11));
                    fCos2 = fSin;
                }
                drawable.setBounds(y8.a.c(fCos2, (int) rectFCalculateIndicatorWidthForTab.left, (int) rectFCalculateIndicatorWidthForTab2.left), drawable.getBounds().top, y8.a.c(fCos, (int) rectFCalculateIndicatorWidthForTab.right, (int) rectFCalculateIndicatorWidthForTab2.right), drawable.getBounds().bottom);
                break;
            default:
                if (f10 >= 0.5f) {
                    view = view2;
                }
                RectF rectFCalculateIndicatorWidthForTab3 = b.calculateIndicatorWidthForTab(tabLayout, view);
                float fB = f10 < 0.5f ? y8.a.b(1.0f, 0.0f, 0.0f, 0.5f, f10) : y8.a.b(0.0f, 1.0f, 0.5f, 1.0f, f10);
                drawable.setBounds((int) rectFCalculateIndicatorWidthForTab3.left, drawable.getBounds().top, (int) rectFCalculateIndicatorWidthForTab3.right, drawable.getBounds().bottom);
                drawable.setAlpha((int) (fB * 255.0f));
                break;
        }
    }
}
