// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package uk.co.chrisjenx.calligraphy; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.lang.reflect.Field; import org.xmlpull.v1.XmlPullParser; // Referenced classes of package uk.co.chrisjenx.calligraphy: // CalligraphyActivityFactory, CalligraphyFactory, CalligraphyConfig, ReflectionUtils class CalligraphyLayoutInflater extends LayoutInflater implements CalligraphyActivityFactory { private static class PrivateWrapperFactory2 extends WrapperFactory2 { private final CalligraphyLayoutInflater mInflater; public View onCreateView(View view, String s, Context context, AttributeSet attributeset) { return mCalligraphyFactory.onViewCreated(mInflater.createCustomViewInternal(view, mFactory2.onCreateView(view, s, context, attributeset), s, context, attributeset), context, attributeset); } public PrivateWrapperFactory2(android.view.LayoutInflater.Factory2 factory2, CalligraphyLayoutInflater calligraphylayoutinflater, CalligraphyFactory calligraphyfactory) { super(factory2, calligraphyfactory); mInflater = calligraphylayoutinflater; } } private static class WrapperFactory implements android.view.LayoutInflater.Factory { private final CalligraphyFactory mCalligraphyFactory; private final android.view.LayoutInflater.Factory mFactory; private final CalligraphyLayoutInflater mInflater; public View onCreateView(String s, Context context, AttributeSet attributeset) { if (android.os.Build.VERSION.SDK_INT < 11) { return mCalligraphyFactory.onViewCreated(mInflater.createCustomViewInternal(null, mFactory.onCreateView(s, context, attributeset), s, context, attributeset), context, attributeset); } else { return mCalligraphyFactory.onViewCreated(mFactory.onCreateView(s, context, attributeset), context, attributeset); } } public WrapperFactory(android.view.LayoutInflater.Factory factory, CalligraphyLayoutInflater calligraphylayoutinflater, CalligraphyFactory calligraphyfactory) { mFactory = factory; mInflater = calligraphylayoutinflater; mCalligraphyFactory = calligraphyfactory; } } private static class WrapperFactory2 implements android.view.LayoutInflater.Factory2 { protected final CalligraphyFactory mCalligraphyFactory; protected final android.view.LayoutInflater.Factory2 mFactory2; public View onCreateView(View view, String s, Context context, AttributeSet attributeset) { return mCalligraphyFactory.onViewCreated(mFactory2.onCreateView(view, s, context, attributeset), context, attributeset); } public View onCreateView(String s, Context context, AttributeSet attributeset) { return mCalligraphyFactory.onViewCreated(mFactory2.onCreateView(s, context, attributeset), context, attributeset); } public WrapperFactory2(android.view.LayoutInflater.Factory2 factory2, CalligraphyFactory calligraphyfactory) { mFactory2 = factory2; mCalligraphyFactory = calligraphyfactory; } } private static final String sClassPrefixList[] = { "android.widget.", "android.webkit." }; private final int mAttributeId; private final CalligraphyFactory mCalligraphyFactory; private Field mConstructorArgs; private boolean mSetPrivateFactory; protected CalligraphyLayoutInflater(Context context, int i) { super(context); mSetPrivateFactory = false; mConstructorArgs = null; mAttributeId = i; mCalligraphyFactory = new CalligraphyFactory(i); setUpLayoutFactories(false); } protected CalligraphyLayoutInflater(LayoutInflater layoutinflater, Context context, int i, boolean flag) { super(layoutinflater, context); mSetPrivateFactory = false; mConstructorArgs = null; mAttributeId = i; mCalligraphyFactory = new CalligraphyFactory(i); setUpLayoutFactories(flag); } private View createCustomViewInternal(View view, View view1, String s, Context context, AttributeSet attributeset) { Object aobj[]; Object obj; if (!CalligraphyConfig.get().isCustomViewCreation()) { return view1; } view = view1; if (view1 != null) { break MISSING_BLOCK_LABEL_110; } view = view1; if (s.indexOf('.') <= -1) { break MISSING_BLOCK_LABEL_110; } if (mConstructorArgs == null) { mConstructorArgs = ReflectionUtils.getField(android/view/LayoutInflater, "mConstructorArgs"); } aobj = (Object[])(Object[])ReflectionUtils.getValue(mConstructorArgs, this); obj = aobj[0]; aobj[0] = context; ReflectionUtils.setValue(mConstructorArgs, this, ((Object) (aobj))); view = createView(s, null, attributeset); aobj[0] = obj; ReflectionUtils.setValue(mConstructorArgs, this, ((Object) (aobj))); _L2: return view; view; aobj[0] = obj; ReflectionUtils.setValue(mConstructorArgs, this, ((Object) (aobj))); view = view1; if (true) goto _L2; else goto _L1 _L1: view; aobj[0] = obj; ReflectionUtils.setValue(mConstructorArgs, this, ((Object) (aobj))); throw view; } private void setPrivateFactoryInternal() { while (mSetPrivateFactory || !CalligraphyConfig.get().isReflection()) { return; } if (!(getContext() instanceof android.view.LayoutInflater.Factory2)) { mSetPrivateFactory = true; return; } java.lang.reflect.Method method = ReflectionUtils.getMethod(android/view/LayoutInflater, "setPrivateFactory"); if (method != null) { ReflectionUtils.invokeMethod(this, method, new Object[] { new PrivateWrapperFactory2((android.view.LayoutInflater.Factory2)getContext(), this, mCalligraphyFactory) }); } mSetPrivateFactory = true; } private void setUpLayoutFactories(boolean flag) { if (!flag) { if (android.os.Build.VERSION.SDK_INT >= 11 && getFactory2() != null && !(getFactory2() instanceof WrapperFactory2)) { setFactory2(getFactory2()); } if (getFactory() != null && !(getFactory() instanceof WrapperFactory)) { setFactory(getFactory()); return; } } } public LayoutInflater cloneInContext(Context context) { return new CalligraphyLayoutInflater(this, context, mAttributeId, true); } public View inflate(XmlPullParser xmlpullparser, ViewGroup viewgroup, boolean flag) { setPrivateFactoryInternal(); return super.inflate(xmlpullparser, viewgroup, flag); } public View onActivityCreateView(View view, View view1, String s, Context context, AttributeSet attributeset) { return mCalligraphyFactory.onViewCreated(createCustomViewInternal(view, view1, s, context, attributeset), context, attributeset); } protected View onCreateView(View view, String s, AttributeSet attributeset) throws ClassNotFoundException { return mCalligraphyFactory.onViewCreated(super.onCreateView(view, s, attributeset), getContext(), attributeset); } protected View onCreateView(String s, AttributeSet attributeset) throws ClassNotFoundException { View view; String as[]; int i; int j; view = null; as = sClassPrefixList; j = as.length; i = 0; _L2: Object obj; if (i >= j) { break; /* Loop/switch isn't completed */ } obj = as[i]; obj = createView(s, ((String) (obj)), attributeset); view = ((View) (obj)); _L3: i++; if (true) goto _L2; else goto _L1 _L1: View view1 = view; if (view == null) { view1 = super.onCreateView(s, attributeset); } return mCalligraphyFactory.onViewCreated(view1, view1.getContext(), attributeset); ClassNotFoundException classnotfoundexception; classnotfoundexception; goto _L3 } public void setFactory(android.view.LayoutInflater.Factory factory) { if (!(factory instanceof WrapperFactory)) { super.setFactory(new WrapperFactory(factory, this, mCalligraphyFactory)); return; } else { super.setFactory(factory); return; } } public void setFactory2(android.view.LayoutInflater.Factory2 factory2) { if (!(factory2 instanceof WrapperFactory2)) { super.setFactory2(new WrapperFactory2(factory2, mCalligraphyFactory)); return; } else { super.setFactory2(factory2); return; } } }