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


Java Orientation类代码示例

本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation的典型用法代码示例。如果您正苦于以下问题:Java Orientation类的具体用法?Java Orientation怎么用?Java Orientation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Orientation类属于com.handmark.pulltorefresh.library.PullToRefreshBase包,在下文中一共展示了Orientation类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RotateLoadingLayout

import com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation; //导入依赖的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.Orientation; //导入依赖的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: getDrawableRotationAngle

import com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation; //导入依赖的package包/类
private float getDrawableRotationAngle() {
	float angle = 0f;
	switch (mMode) {
		case PULL_FROM_END:
			if (mScrollDirection == Orientation.HORIZONTAL) {
				angle = 90f;
			} else {
				angle = 180f;
			}
			break;

		case PULL_FROM_START:
			if (mScrollDirection == Orientation.HORIZONTAL) {
				angle = 270f;
			}
			break;

		default:
			break;
	}

	return angle;
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:24,代码来源:FlipLoadingLayout.java

示例4: LoadingLayout

import com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation; //导入依赖的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

示例5: createLoadingLayout

import com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation; //导入依赖的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: getDrawableRotationAngle

import com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation; //导入依赖的package包/类
private float getDrawableRotationAngle() {
    switch (this.mMode) {
        case PULL_FROM_END:
            if (this.mScrollDirection == Orientation.HORIZONTAL) {
                return 90.0f;
            }
            return 180.0f;
        case PULL_FROM_START:
            if (this.mScrollDirection == Orientation.HORIZONTAL) {
                return 270.0f;
            }
            return 0.0f;
        default:
            return 0.0f;
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:17,代码来源:FlipLoadingLayout.java

示例7: RotateLoadingLayout

import com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation; //导入依赖的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


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