本文整理汇总了Java中android.view.LayoutInflater.getFactory方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutInflater.getFactory方法的具体用法?Java LayoutInflater.getFactory怎么用?Java LayoutInflater.getFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.LayoutInflater
的用法示例。
在下文中一共展示了LayoutInflater.getFactory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installViewFactory
import android.view.LayoutInflater; //导入方法依赖的package包/类
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");
}
}
示例2: setFactory
import android.view.LayoutInflater; //导入方法依赖的package包/类
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);
}
}
示例3: getFactory
import android.view.LayoutInflater; //导入方法依赖的package包/类
static LayoutInflaterFactory getFactory(LayoutInflater inflater) {
Factory factory = inflater.getFactory();
if (factory instanceof FactoryWrapper) {
return ((FactoryWrapper) factory).mDelegateFactory;
}
return null;
}