本文整理匯總了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;
}