当前位置: 首页>>代码示例>>Java>>正文


Java Mode类代码示例

本文整理汇总了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);
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:17,代码来源:RotateLoadingLayout.java

示例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);
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:18,代码来源:FlipLoadingLayout.java

示例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();	
	
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:24,代码来源:LoadingLayout.java

示例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;
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:27,代码来源:IndicatorLayoutFactory.java

示例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;
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:28,代码来源:LoadingLayoutFactory.java

示例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);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:PullToRefreshListView.java

示例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);
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:18,代码来源:RotateLoadingLayout.java

示例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);
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:19,代码来源:FlipLoadingLayoutFooter.java

示例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);
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:19,代码来源:FlipLoadingLayout.java

示例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);
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:18,代码来源:RotateLoadingLayoutFooter.java


注:本文中的com.handmark.pulltorefresh.library.PullToRefreshBase.Mode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。