本文整理汇总了Java中com.handmark.pulltorefresh.library.internal.IndicatorLayout类的典型用法代码示例。如果您正苦于以下问题:Java IndicatorLayout类的具体用法?Java IndicatorLayout怎么用?Java IndicatorLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IndicatorLayout类属于com.handmark.pulltorefresh.library.internal包,在下文中一共展示了IndicatorLayout类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIndicatorLayoutClazz
import com.handmark.pulltorefresh.library.internal.IndicatorLayout; //导入依赖的package包/类
/**
* Create the class token matched by <b>class name</b>
* @param clazzName Class name such as "com.handmark.pulltorefresh.library.internal.DefaultIndicatorLayout"
* @return Class token if the class matched by class name exists, or the class token of {@code DefaultIndicatorLayout} instance if not
*/
@SuppressWarnings("unchecked")
public static Class<? extends IndicatorLayout> createIndicatorLayoutClazz(String clazzName) {
Class<? extends IndicatorLayout> clazz = null;
if (clazzName == null) {
clazz = DefaultIndicatorLayoutFactory.createIndicatorLayoutClazz(clazzName);
return clazz;
}
try {
clazz = (Class<? extends IndicatorLayout> )Class.forName(clazzName);
} catch (ClassNotFoundException e) {
Log.e(LOG_TAG, "The indicator layout you have chosen class has not been found.", e);
clazz = DefaultIndicatorLayoutFactory.createIndicatorLayoutClazz(clazzName);
}
return clazz;
}
示例2: createIndicatorLayout
import com.handmark.pulltorefresh.library.internal.IndicatorLayout; //导入依赖的package包/类
/**
* Create a {@code IndicatorLayout} instance matched by <b>{@code clazz} token</b>
* @param clazz Indicator layout class token, which must be defined in pulltorefresh.xml
* @param context
* @param mode
* @return {@code IndicatorLayout} instance if the class matched by {@code layoutCode} exists, or {@code DefaultIndicatorLayout} instance if not
*/
public static IndicatorLayout createIndicatorLayout(
Class<? extends IndicatorLayout> clazz, Context context, Mode mode) {
IndicatorLayout layout = null;
// Prevent NullPointerException
if ( clazz == null ) {
Log.i(LOG_TAG, "The Class token of the Indicator Layout is missing. Default Indicator Layout will be used.");
clazz = DefaultIndicatorLayoutFactory.createIndicatorLayoutClazz("");
}
layout = tryNewInstance(clazz, context, mode);
// If trying to create new instance has failed,
if (layout == null) {
layout = DefaultIndicatorLayoutFactory.createIndicatorLayout(clazz, context, mode);
}
layout.setVisibility(View.INVISIBLE);
return layout;
}
示例3: createIndicatorLayoutClazzByLayoutCode
import com.handmark.pulltorefresh.library.internal.IndicatorLayout; //导入依赖的package包/类
/**
* Create the class token matched by <b>{@code layoutCode}</b>
* @param layoutCode Indicator layout code, which must be defined in pulltorefresh.xml
* @return Class token which is matched by {@code layoutCode}, or the class token of {@code DefaultIndicatorLayout} instance if not
*/
public static Class<? extends IndicatorLayout> createIndicatorLayoutClazzByLayoutCode(String layoutCode) {
String clazzName = PullToRefreshXmlConfiguration.getInstance().getIndicatorLayoutClazzName(layoutCode);
return createIndicatorLayoutClazz(clazzName);
}