本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
}
示例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);
}