package p055s;

import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import androidx.constraintlayout.widget.C0188b;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import p058t.C1632a;

/* renamed from: s.a */
/* loaded from: classes.dex */
public class C1603a {

    /* renamed from: s.a$a */
    /* loaded from: classes.dex */
    public static /* synthetic */ class C1604a {

        /* renamed from: a */
        public static final /* synthetic */ int[] f3733a;

        static {
            int[] iArr = new int[C0188b.EnumC0190b.values().length];
            f3733a = iArr;
            try {
                iArr[C0188b.EnumC0190b.INT_TYPE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f3733a[C0188b.EnumC0190b.FLOAT_TYPE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f3733a[C0188b.EnumC0190b.COLOR_DRAWABLE_TYPE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f3733a[C0188b.EnumC0190b.COLOR_TYPE.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f3733a[C0188b.EnumC0190b.STRING_TYPE.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                f3733a[C0188b.EnumC0190b.BOOLEAN_TYPE.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                f3733a[C0188b.EnumC0190b.DIMENSION_TYPE.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
        }
    }

    /* renamed from: a */
    public static int m803a(int i) {
        int i2 = (i & ((i >> 31) ^ (-1))) - 255;
        return (i2 & (i2 >> 31)) + 255;
    }

    /* renamed from: b */
    public static void m802b(C0188b c0188b, View view, float[] fArr) {
        StringBuilder sb;
        String str;
        Class<?> cls = view.getClass();
        String str2 = "set" + c0188b.m4560b();
        try {
            boolean z = true;
            switch (C1604a.f3733a[c0188b.m4559c().ordinal()]) {
                case 1:
                    cls.getMethod(str2, Integer.TYPE).invoke(view, Integer.valueOf((int) fArr[0]));
                    return;
                case 2:
                    cls.getMethod(str2, Float.TYPE).invoke(view, Float.valueOf(fArr[0]));
                    return;
                case 3:
                    Method method = cls.getMethod(str2, Drawable.class);
                    int m803a = m803a((int) (((float) Math.pow(fArr[0], 0.45454545454545453d)) * 255.0f));
                    int m803a2 = m803a((int) (((float) Math.pow(fArr[1], 0.45454545454545453d)) * 255.0f));
                    ColorDrawable colorDrawable = new ColorDrawable();
                    colorDrawable.setColor((m803a << 16) | (m803a((int) (fArr[3] * 255.0f)) << 24) | (m803a2 << 8) | m803a((int) (((float) Math.pow(fArr[2], 0.45454545454545453d)) * 255.0f)));
                    method.invoke(view, colorDrawable);
                    return;
                case 4:
                    cls.getMethod(str2, Integer.TYPE).invoke(view, Integer.valueOf((m803a((int) (((float) Math.pow(fArr[0], 0.45454545454545453d)) * 255.0f)) << 16) | (m803a((int) (fArr[3] * 255.0f)) << 24) | (m803a((int) (((float) Math.pow(fArr[1], 0.45454545454545453d)) * 255.0f)) << 8) | m803a((int) (((float) Math.pow(fArr[2], 0.45454545454545453d)) * 255.0f))));
                    return;
                case 5:
                    throw new RuntimeException("unable to interpolate strings " + c0188b.m4560b());
                case 6:
                    Method method2 = cls.getMethod(str2, Boolean.TYPE);
                    Object[] objArr = new Object[1];
                    if (fArr[0] <= 0.5f) {
                        z = false;
                    }
                    objArr[0] = Boolean.valueOf(z);
                    method2.invoke(view, objArr);
                    return;
                case 7:
                    cls.getMethod(str2, Float.TYPE).invoke(view, Float.valueOf(fArr[0]));
                    return;
                default:
                    return;
            }
        } catch (IllegalAccessException e) {
            e = e;
            sb = new StringBuilder();
            str = "cannot access method ";
            sb.append(str);
            sb.append(str2);
            sb.append(" on View \"");
            sb.append(C1632a.m757b(view));
            sb.append("\"");
            Log.e("CustomSupport", sb.toString());
            e.printStackTrace();
        } catch (NoSuchMethodException e2) {
            e = e2;
            sb = new StringBuilder();
            str = "no method ";
            sb.append(str);
            sb.append(str2);
            sb.append(" on View \"");
            sb.append(C1632a.m757b(view));
            sb.append("\"");
            Log.e("CustomSupport", sb.toString());
            e.printStackTrace();
        } catch (InvocationTargetException e3) {
            e = e3;
            e.printStackTrace();
        }
    }
}