本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshBase.Mode类的典型用法代码示例。如果您正苦于以下问题:Java Mode类的具体用法?Java Mode怎么用?Java Mode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Mode类属于com.handmark.pulltorefresh.library.PullToRefreshBase包,在下文中一共展示了Mode类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RotateLoadingLayout
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
super(context, mode, scrollDirection, attrs);
mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);
mHeaderImage.setScaleType(ScaleType.MATRIX);
mHeaderImageMatrix = new Matrix();
mHeaderImage.setImageMatrix(mHeaderImageMatrix);
mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);
}
示例2: FlipLoadingLayout
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs) {
super(context, mode, scrollDirection, attrs);
final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;
mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);
}
示例3: LoadingLayout
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
/**
* The constructor to customize layout, not public scope now.
* @param context
* @param mode
* @param scrollDirection
*/
protected LoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs, int inflateId) {
super(context);
mMode = mode;
mScrollDirection = scrollDirection;
initInflate(context, inflateId);
initComponents();
initProperties(context, mode, attrs);
if (null != mImageDrawable) {
setLoadingDrawable(mImageDrawable);
mImageDrawable = null;
}
reset();
}
示例4: createIndicatorLayout
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的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;
}
示例5: createLoadingLayout
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
/**
* Create a {@code LoadingLayout} instance matched by <b>{@code clazz} token</b>
* @param layoutCode Loading layout code, which must be defined in pulltorefresh.xml
* @param context
* @param mode
* @return {@code LoadingLayout} instance if the class matched by {@code layoutCode} exists, or {@code RotateLoadingLayout} instance if not
*/
public static LoadingLayout createLoadingLayout(
Class<? extends LoadingLayout> clazz, Context context, Mode mode,
Orientation orientation, TypedArray attrs) {
LoadingLayout layout = null;
// Prevent NullPointerException
if ( clazz == null ) {
Log.i(LOG_TAG, "The Class token of the Loading Layout is missing. Default Loading Layout will be used.");
clazz = DefaultLoadingLayoutFactory.createLoadingLayoutClazz("");
}
layout = tryNewInstance(clazz, context, mode, orientation, attrs);
// If trying to create new instance has failed,
if (layout == null) {
layout = DefaultLoadingLayoutFactory.createLoadingLayout(clazz, context, mode, orientation, attrs);
}
layout.setVisibility(View.INVISIBLE);
return layout;
}
示例6: handleStyledAttributes
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
protected void handleStyledAttributes(TypedArray a) {
super.handleStyledAttributes(a);
this.mListViewExtrasEnabled = a.getBoolean(R.styleable
.PullToRefresh_ptrListViewExtrasEnabled, true);
if (this.mListViewExtrasEnabled) {
LayoutParams lp = new LayoutParams(-1, -2, 1);
FrameLayout frame = new FrameLayout(getContext());
this.mHeaderLoadingView = createLoadingLayout(getContext(), Mode.PULL_FROM_START, a);
this.mHeaderLoadingView.setVisibility(8);
frame.addView(this.mHeaderLoadingView, lp);
((ListView) this.mRefreshableView).addHeaderView(frame, null, false);
this.mLvFooterLoadingFrame = new FrameLayout(getContext());
this.mFooterLoadingView = createLoadingLayout(getContext(), Mode.PULL_FROM_END, a);
this.mFooterLoadingView.setVisibility(8);
this.mLvFooterLoadingFrame.addView(this.mFooterLoadingView, lp);
if (!a.hasValue(R.styleable.PullToRefresh_ptrScrollingWhileRefreshingEnabled)) {
setScrollingWhileRefreshingEnabled(true);
}
}
}
示例7: RotateLoadingLayout
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs)
{
super(context, mode, scrollDirection, attrs);
mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);
mHeaderImage.setScaleType(ScaleType.MATRIX);
mHeaderImageMatrix = new Matrix();
mHeaderImage.setImageMatrix(mHeaderImageMatrix);
mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);
}
示例8: FlipLoadingLayoutFooter
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
public FlipLoadingLayoutFooter(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs)
{
super(context, mode, scrollDirection, attrs, true);
final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;
mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);
}
示例9: FlipLoadingLayout
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs)
{
super(context, mode, scrollDirection, attrs);
final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;
mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);
}
示例10: RotateLoadingLayoutFooter
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入依赖的package包/类
public RotateLoadingLayoutFooter(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs)
{
super(context, mode, scrollDirection, attrs, true);
mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);
mHeaderImage.setScaleType(ScaleType.MATRIX);
mHeaderImageMatrix = new Matrix();
mHeaderImage.setImageMatrix(mHeaderImageMatrix);
mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);
}