/** * 注册自定义的ViewFactory到LayoutInflater中,实现对View生成的拦截 * * @param li */ public void registerViewFactory(LayoutInflater li) { Factory factory = li.getFactory(); if (factory instanceof ViewFactory) { Log.w("Had register factory"); return; } if (factory != null && ReflectUtil.get(factory, "mF1") instanceof ViewFactory) { Log.w("Had register factory"); return; } ViewFactory vf; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { vf = new ViewFactory(); } else { vf = new ViewFactoryAfterGingerbread(); } vf.register(li); Log.d("LayoutInflater:{} register custom factory:{}", li, vf); }
View callActivityOnCreateView(View parent, String name, Context context, AttributeSet attrs) { if (this.mOriginalWindowCallback instanceof Factory) { View result = ((Factory) this.mOriginalWindowCallback).onCreateView(name, context, attrs); if (result != null) { return result; } } return null; }
static void setFactory(LayoutInflater inflater, LayoutInflaterFactory factory) { Factory2 factory2 = factory != null ? new FactoryWrapperHC(factory) : null; inflater.setFactory2(factory2); Factory f = inflater.getFactory(); if (f instanceof Factory2) { forceSetFactory2(inflater, (Factory2) f); } else { forceSetFactory2(inflater, factory2); } }
static LayoutInflaterFactory getFactory(LayoutInflater inflater) { Factory factory = inflater.getFactory(); if (factory instanceof FactoryWrapper) { return ((FactoryWrapper) factory).mDelegateFactory; } return null; }
View m1714b(View view, String str, Context context, AttributeSet attributeSet) { if (this.c instanceof Factory) { View onCreateView = ((Factory) this.c).onCreateView(str, context, attributeSet); if (onCreateView != null) { return onCreateView; } } return null; }
static void m847a(LayoutInflater layoutInflater, al alVar) { Factory2 ajVar = alVar != null ? new aj(alVar) : null; layoutInflater.setFactory2(ajVar); Factory factory = layoutInflater.getFactory(); if (factory instanceof Factory2) { ai.m848a(layoutInflater, (Factory2) factory); } else { ai.m848a(layoutInflater, ajVar); } }
View callActivityOnCreateView$1fef4371(String paramString, Context paramContext, AttributeSet paramAttributeSet) { if ((this.mOriginalWindowCallback instanceof LayoutInflater.Factory)) { View localView = ((LayoutInflater.Factory)this.mOriginalWindowCallback).onCreateView(paramString, paramContext, paramAttributeSet); if (localView != null) { return localView; } } return null; }
public void setFactory(LayoutInflater paramLayoutInflater, LayoutInflaterFactory paramLayoutInflaterFactory) { if (paramLayoutInflaterFactory != null) {} for (LayoutInflaterCompatHC.FactoryWrapperHC localFactoryWrapperHC = new LayoutInflaterCompatHC.FactoryWrapperHC(paramLayoutInflaterFactory);; localFactoryWrapperHC = null) { paramLayoutInflater.setFactory2(localFactoryWrapperHC); LayoutInflater.Factory localFactory = paramLayoutInflater.getFactory(); if (!(localFactory instanceof LayoutInflater.Factory2)) { break; } LayoutInflaterCompatHC.forceSetFactory2(paramLayoutInflater, (LayoutInflater.Factory2)localFactory); return; } LayoutInflaterCompatHC.forceSetFactory2(paramLayoutInflater, localFactoryWrapperHC); }
public void a(LayoutInflater paramLayoutInflater, mh parammh) { if (parammh != null) {} for (mg localmg = new mg(parammh);; localmg = null) { paramLayoutInflater.setFactory2(localmg); LayoutInflater.Factory localFactory = paramLayoutInflater.getFactory(); if (!(localFactory instanceof LayoutInflater.Factory2)) { break; } aau.a(paramLayoutInflater, (LayoutInflater.Factory2)localFactory); return; } aau.a(paramLayoutInflater, localmg); }
static al m845a(LayoutInflater layoutInflater) { Factory factory = layoutInflater.getFactory(); return factory instanceof ah ? ((ah) factory).f430a : null; }