package 㸾.ʬ;

import android.util.TypedValue;
import android.view.View;
import ඓ.K.K.K.C1293;

/* renamed from: 㸾.ʬ.ʬ  reason: contains not printable characters */
/* compiled from: Utils */
public final class C2524 {
    static {
        new TypedValue();
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static <T> T m6568(View view, int i, String str, Class<T> cls) {
        return (T) m6570(m6569(view, i, str), i, str, cls);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static View m6569(View view, int i, String str) {
        View findViewById = view.findViewById(i);
        if (findViewById != null) {
            return findViewById;
        }
        String r3 = m6571(view, i);
        StringBuilder sb = new StringBuilder();
        sb.append("Required view '");
        sb.append(r3);
        sb.append("' with ID ");
        sb.append(i);
        sb.append(" for ");
        throw new IllegalStateException(C1293.m3414(sb, str, " was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation."));
    }

    /* renamed from: K  reason: contains not printable characters */
    public static <T> T m6570(View view, int i, String str, Class<T> cls) {
        try {
            return cls.cast(view);
        } catch (ClassCastException e) {
            String r3 = m6571(view, i);
            StringBuilder sb = new StringBuilder();
            sb.append("View '");
            sb.append(r3);
            sb.append("' with ID ");
            sb.append(i);
            sb.append(" for ");
            throw new IllegalStateException(C1293.m3414(sb, str, " was of the wrong type. See cause for more info."), e);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m6571(View view, int i) {
        if (view.isInEditMode()) {
            return "<unavailable while editing>";
        }
        return view.getContext().getResources().getResourceEntryName(i);
    }
}
