package p072y0; import android.content.Context; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.os.Build; import android.util.AttributeSet; import android.util.Xml; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.AccelerateInterpolator; import android.view.animation.AnimationUtils; import android.view.animation.AnticipateInterpolator; import android.view.animation.AnticipateOvershootInterpolator; import android.view.animation.BounceInterpolator; import android.view.animation.CycleInterpolator; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import android.view.animation.LinearInterpolator; import android.view.animation.OvershootInterpolator; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import p050q0.C1561a; import p050q0.C1562b; import p050q0.C1563c; /* renamed from: y0.g */ /* loaded from: classes.dex */ public class C1849g { /* JADX WARN: Code restructure failed: missing block: B:45:0x00ca, code lost: return r4; */ /* renamed from: a */ /* Code decompiled incorrectly, please refer to instructions dump. */ public static Interpolator m227a(Context context, Resources resources, Resources.Theme theme, XmlPullParser xmlPullParser) { Interpolator accelerateInterpolator; int depth = xmlPullParser.getDepth(); Interpolator interpolator = null; while (true) { int next = xmlPullParser.next(); if ((next != 3 || xmlPullParser.getDepth() > depth) && next != 1) { if (next == 2) { AttributeSet asAttributeSet = Xml.asAttributeSet(xmlPullParser); String name = xmlPullParser.getName(); if (name.equals("linearInterpolator")) { interpolator = new LinearInterpolator(); } else { if (name.equals("accelerateInterpolator")) { accelerateInterpolator = new AccelerateInterpolator(context, asAttributeSet); } else if (name.equals("decelerateInterpolator")) { accelerateInterpolator = new DecelerateInterpolator(context, asAttributeSet); } else if (name.equals("accelerateDecelerateInterpolator")) { interpolator = new AccelerateDecelerateInterpolator(); } else if (name.equals("cycleInterpolator")) { accelerateInterpolator = new CycleInterpolator(context, asAttributeSet); } else if (name.equals("anticipateInterpolator")) { accelerateInterpolator = new AnticipateInterpolator(context, asAttributeSet); } else if (name.equals("overshootInterpolator")) { accelerateInterpolator = new OvershootInterpolator(context, asAttributeSet); } else if (name.equals("anticipateOvershootInterpolator")) { accelerateInterpolator = new AnticipateOvershootInterpolator(context, asAttributeSet); } else if (name.equals("bounceInterpolator")) { interpolator = new BounceInterpolator(); } else if (!name.equals("pathInterpolator")) { throw new RuntimeException("Unknown interpolator name: " + xmlPullParser.getName()); } else { accelerateInterpolator = new animationInterpolatorC1853j(context, asAttributeSet, xmlPullParser); } interpolator = accelerateInterpolator; } } } } } /* renamed from: b */ public static Interpolator m226b(Context context, int i) { if (Build.VERSION.SDK_INT >= 21) { return AnimationUtils.loadInterpolator(context, i); } XmlResourceParser xmlResourceParser = null; try { try { if (i == 17563663) { return new C1561a(); } if (i == 17563661) { return new C1562b(); } if (i == 17563662) { return new C1563c(); } XmlResourceParser animation = context.getResources().getAnimation(i); Interpolator m227a = m227a(context, context.getResources(), context.getTheme(), animation); if (animation != null) { animation.close(); } return m227a; } catch (IOException e) { Resources.NotFoundException notFoundException = new Resources.NotFoundException("Can't load animation resource ID #0x" + Integer.toHexString(i)); notFoundException.initCause(e); throw notFoundException; } catch (XmlPullParserException e2) { Resources.NotFoundException notFoundException2 = new Resources.NotFoundException("Can't load animation resource ID #0x" + Integer.toHexString(i)); notFoundException2.initCause(e2); throw notFoundException2; } } catch (Throwable th) { if (0 != 0) { xmlResourceParser.close(); } throw th; } } }