Java Code Examples for android.view.LayoutInflater.getFactory()

The following are Jave code examples for showing how to use getFactory() of the android.view.LayoutInflater class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: boohee_v5.6   File: AppCompatDelegateImplV7.java   Source Code and License Vote up 5 votes
public void installViewFactory() {
    LayoutInflater layoutInflater = LayoutInflater.from(this.mContext);
    if (layoutInflater.getFactory() == null) {
        LayoutInflaterCompat.setFactory(layoutInflater, this);
    } else if (!(LayoutInflaterCompat.getFactory(layoutInflater) instanceof AppCompatDelegateImplV7)) {
        Log.i("AppCompatDelegate", "The Activity's LayoutInflater already has a Factory installed so we can not install AppCompat's");
    }
}
 
Example 2
Project: boohee_v5.6   File: LayoutInflaterCompatHC.java   Source Code and License Vote up 5 votes
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);
    }
}
 
Example 3
Project: boohee_v5.6   File: LayoutInflaterCompatBase.java   Source Code and License Vote up 5 votes
static LayoutInflaterFactory getFactory(LayoutInflater inflater) {
    Factory factory = inflater.getFactory();
    if (factory instanceof FactoryWrapper) {
        return ((FactoryWrapper) factory).mDelegateFactory;
    }
    return null;
}