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