Java Code Examples for android.view.LayoutInflater#Factory
The following examples show how to use
android.view.LayoutInflater#Factory .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalligraphyFactory.java From UltimateAndroid with Apache License 2.0 | 6 votes |
@Override public View onCreateView(String name, Context context, AttributeSet attrs) { View view = null; if (context instanceof LayoutInflater.Factory) { view = ((LayoutInflater.Factory) context).onCreateView(name, context, attrs); } if (factory != null && view == null) { view = factory.onCreateView(name, context, attrs); } if (view == null) { view = createViewOrFailQuietly(name, context, attrs); } if (view != null) { onViewCreated(view, name, context, attrs); } return view; }
Example 2
Source File: PluginViewFactory.java From Android-Plugin-Framework with MIT License | 6 votes |
private View callActivityOnCreateView(View parent, String name, Context context, AttributeSet attrs) { View view = null; if (mOriginalWindowCallback instanceof LayoutInflater.Factory) { view = ((LayoutInflater.Factory) mOriginalWindowCallback) .onCreateView(name, context, attrs); } if (view != null) { return view; } if(Build.VERSION.SDK_INT >= 11) { if (mOriginalWindowCallback instanceof LayoutInflater.Factory2) { return ((LayoutInflater.Factory2) mOriginalWindowCallback) .onCreateView(parent, name, context, attrs); } } return null; }
Example 3
Source File: CalligraphyFactory.java From UltimateAndroid with Apache License 2.0 | 6 votes |
@Override public View onCreateView(String name, Context context, AttributeSet attrs) { View view = null; if (context instanceof LayoutInflater.Factory) { view = ((LayoutInflater.Factory) context).onCreateView(name, context, attrs); } if (factory != null && view == null) { view = factory.onCreateView(name, context, attrs); } if (view == null) { view = createViewOrFailQuietly(name, context, attrs); } if (view != null) { onViewCreated(view, name, context, attrs); } return view; }
Example 4
Source File: SkinLayoutInflater.java From chameleon with Apache License 2.0 | 5 votes |
/** * 初始化 * * @param original */ private void init(LayoutInflater original) { //将自己设置为LayoutInflaterFactory,接管view的创建 setFactory2(this); if (mConstructorArgsField != null) { try { mConstructorArgs = (Object[]) mConstructorArgsField.get(this); } catch (IllegalAccessException e) { e.printStackTrace(); } } //将自己注册到换肤监听 SkinEngine.registerSkinObserver(this); if (original == null) { return; } if (original instanceof SkinLayoutInflater) { SkinLayoutInflater skinLayoutInflater = (SkinLayoutInflater) original; this.mFactory = skinLayoutInflater.mFactory; this.mFactory2 = skinLayoutInflater.mFactory2; } else { LayoutInflater.Factory factory = original.getFactory(); if (factory instanceof LayoutInflater.Factory2) { mFactory2 = (Factory2) factory; } else { mFactory = factory; } } }
Example 5
Source File: SceneLayoutInflater.java From scene with Apache License 2.0 | 5 votes |
private void createLayoutInflaterIfNeeded() { if (this.mLayoutInflater != null) { return; } Context context = null; if (this.mScene.getTheme() == 0) { context = this.mScene.requireActivity(); } else { context = this.mScene.requireSceneContext(); } //create new LayoutInflater this.mLayoutInflater = this.mScene.requireActivity().getLayoutInflater().cloneInContext(context); LayoutInflater.Filter filter = getFilter(); if (filter != null) { this.mLayoutInflater.setFilter(filter); } LayoutInflater.Factory2 factory2 = getFactory2(); if (factory2 != null) { this.mLayoutInflater.setFactory2(factory2); } else { LayoutInflater.Factory factory = getFactory(); if (factory != null) { this.mLayoutInflater.setFactory(factory); } } }
Example 6
Source File: EnvLayoutInflaterWrapper.java From Android_Skin_2.0 with Apache License 2.0 | 5 votes |
@Override public View onCreateView(String name, Context context, AttributeSet attrs) { View view = null; name = transfer(name); if (context instanceof LayoutInflater.Factory) { view = ((LayoutInflater.Factory) context).onCreateView(name, context, attrs); } if (view == null && wrapped != null) { view = wrapped.onCreateView(name, context, attrs); } if (view == null) { view = createViewOrFailQuietly(name, context, attrs); } return view; }
Example 7
Source File: SceneLayoutInflater.java From scene with Apache License 2.0 | 5 votes |
@Override public void setFactory(LayoutInflater.Factory factory) { super.setFactory(factory); if (this.mLayoutInflater != null) { this.mLayoutInflater.setFactory(factory); } }
Example 8
Source File: TypefaceLayoutInflator.java From support with Apache License 2.0 | 5 votes |
@Override public void setFactory(LayoutInflater.Factory factory) { // Only set our factory and wrap calls to the Factory trying to be set! if (!(factory instanceof WrapperFactory)) { super.setFactory(new WrapperFactory(factory, this)); } else { super.setFactory(factory); } }
Example 9
Source File: CustomTypefaceFactory.java From custom-typeface with Apache License 2.0 | 4 votes |
public CustomTypefaceFactory(Context context, CustomTypeface customTypeface, LayoutInflater.Factory factory) { mContext = context; mCustomTypeface = customTypeface; mFactory = factory; }
Example 10
Source File: CalligraphyFactory.java From UltimateAndroid with Apache License 2.0 | 4 votes |
public CalligraphyFactory(LayoutInflater.Factory factory, int attributeId) { this.factory = factory; this.mAttributeId = attributeId; }
Example 11
Source File: CustomTypefaceFactory.java From custom-typeface with Apache License 2.0 | 4 votes |
public LayoutInflater.Factory getFactory() { return mFactory; }
Example 12
Source File: InjectedInflaterV7.java From NightOwl with Apache License 2.0 | 4 votes |
public static LayoutInflater.Factory wrap(InjectedInflaterBase inflater, LayoutInflater.Factory factory){ return new FactoryWrapperImpl(inflater,factory); }
Example 13
Source File: InjectedInflaterV11.java From NightOwl with Apache License 2.0 | 4 votes |
private FactoryWrapperImpl(LayoutInflater.Factory factory) { mFactory = factory; }
Example 14
Source File: InjectedInflaterV11.java From NightOwl with Apache License 2.0 | 4 votes |
public static LayoutInflater.Factory wrap(LayoutInflater.Factory factory){ return new FactoryWrapperImpl(factory); }
Example 15
Source File: BackgroundFactory.java From BackgroundLibrary with Apache License 2.0 | 4 votes |
public void setInterceptFactory(LayoutInflater.Factory factory) { mViewCreateFactory = factory; }
Example 16
Source File: FragmentManager.java From adt-leanback-support with Apache License 2.0 | 4 votes |
LayoutInflater.Factory getLayoutInflaterFactory() { return this; }
Example 17
Source File: PluginViewInflater.java From Android-Plugin-Framework with MIT License | 4 votes |
public PluginViewInflater(Context context, final LayoutInflater.Factory viewfactory) { mContext = context; mViewfactory = viewfactory; }
Example 18
Source File: PluginViewFactory.java From Android-Plugin-Framework with MIT License | 4 votes |
public PluginViewFactory(Activity context, Window window, LayoutInflater.Factory viewfactory) { mContext = context; mWindow = window; mOriginalWindowCallback = window.getCallback(); mViewfactory = viewfactory; }
Example 19
Source File: BackgroundFactory.java From BackgroundLibrary with Apache License 2.0 | 4 votes |
public void setInterceptFactory(LayoutInflater.Factory factory) { mViewCreateFactory = factory; }
Example 20
Source File: LayoutInflaterCompat.java From Android-skin-support with MIT License | 3 votes |
/** * Return the current {@link LayoutInflaterFactory} (or null). This is * called on each element name. If the factory returns a View, add that * to the hierarchy. If it returns null, proceed to call onCreateView(name). * * @return The {@link LayoutInflaterFactory} associated with the * {@link LayoutInflater}. Will be {@code null} if the inflater does not * have a {@link LayoutInflaterFactory} but a raw {@link LayoutInflater.Factory}. * @see LayoutInflater#getFactory() * @deprecated Use {@link #setFactory2(LayoutInflater, LayoutInflater.Factory2)} to set and * {@link LayoutInflater#getFactory2()} to get the factory. */ @Deprecated public static LayoutInflaterFactory getFactory(LayoutInflater inflater) { LayoutInflater.Factory factory = inflater.getFactory(); if (factory instanceof LayoutInflaterCompat.Factory2Wrapper) { return ((LayoutInflaterCompat.Factory2Wrapper) factory).mDelegateFactory; } return null; }