com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation Java Examples
The following examples show how to use
com.handmark.pulltorefresh.library.PullToRefreshBase.Orientation.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RotateLoadingLayout.java From handmarkPulltorefreshLibrary with Apache License 2.0 | 6 votes |
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); }
Example #2
Source File: FlipLoadingLayout.java From SweetMusicPlayer with Apache License 2.0 | 6 votes |
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); }
Example #3
Source File: FlipLoadingLayout.java From SweetMusicPlayer with Apache License 2.0 | 6 votes |
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; }
Example #4
Source File: RotateLoadingLayout.java From ONE-Unofficial with Apache License 2.0 | 6 votes |
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); }
Example #5
Source File: FlipLoadingLayout.java From ONE-Unofficial with Apache License 2.0 | 6 votes |
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); }
Example #6
Source File: FlipLoadingLayout.java From ONE-Unofficial with Apache License 2.0 | 6 votes |
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; }
Example #7
Source File: RotateLoadingLayout.java From bmob-android-demo-paging with GNU General Public License v3.0 | 6 votes |
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); }
Example #8
Source File: FlipLoadingLayout.java From bmob-android-demo-paging with GNU General Public License v3.0 | 6 votes |
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); }
Example #9
Source File: FlipLoadingLayout.java From bmob-android-demo-paging with GNU General Public License v3.0 | 6 votes |
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; }
Example #10
Source File: RotateLoadingLayout.java From iSCAU-Android with GNU General Public License v3.0 | 6 votes |
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); }
Example #11
Source File: FlipLoadingLayout.java From iSCAU-Android with GNU General Public License v3.0 | 6 votes |
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); }
Example #12
Source File: FlipLoadingLayout.java From iSCAU-Android with GNU General Public License v3.0 | 6 votes |
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; }
Example #13
Source File: RotateLoadingLayout.java From PullToRefresh-PinnedSection-ListView with MIT License | 6 votes |
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); }
Example #14
Source File: FlipLoadingLayout.java From PullToRefresh-PinnedSection-ListView with MIT License | 6 votes |
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); }
Example #15
Source File: FlipLoadingLayout.java From PullToRefresh-PinnedSection-ListView with MIT License | 6 votes |
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; }
Example #16
Source File: RotateLoadingLayout.java From SweetMusicPlayer with Apache License 2.0 | 6 votes |
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); }
Example #17
Source File: FlipLoadingLayout.java From handmarkPulltorefreshLibrary with Apache License 2.0 | 6 votes |
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); }
Example #18
Source File: FlipLoadingLayout.java From handmarkPulltorefreshLibrary with Apache License 2.0 | 6 votes |
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; }
Example #19
Source File: FlipLoadingLayout_foot.java From handmarkPulltorefreshLibrary with Apache License 2.0 | 6 votes |
public FlipLoadingLayout_foot(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); }
Example #20
Source File: FlipLoadingLayout_foot.java From handmarkPulltorefreshLibrary with Apache License 2.0 | 6 votes |
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; }
Example #21
Source File: RotateLoadingLayout.java From zen4android with MIT License | 6 votes |
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); }
Example #22
Source File: FlipLoadingLayout.java From zen4android with MIT License | 6 votes |
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); }
Example #23
Source File: FlipLoadingLayout.java From zen4android with MIT License | 6 votes |
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; }
Example #24
Source File: RotateLoadingLayout.java From effective_android_sample with Apache License 2.0 | 6 votes |
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); }
Example #25
Source File: FlipLoadingLayout.java From effective_android_sample with Apache License 2.0 | 6 votes |
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); }
Example #26
Source File: FlipLoadingLayout.java From effective_android_sample with Apache License 2.0 | 6 votes |
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; }
Example #27
Source File: RotateLoadingLayout.java From FacebookNewsfeedSample-Android with Apache License 2.0 | 6 votes |
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); }
Example #28
Source File: FlipLoadingLayout.java From FacebookNewsfeedSample-Android with Apache License 2.0 | 6 votes |
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); }
Example #29
Source File: FlipLoadingLayout.java From FacebookNewsfeedSample-Android with Apache License 2.0 | 6 votes |
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; }
Example #30
Source File: RotateLoadingLayoutFooter.java From BigApp_WordPress_Android with Apache License 2.0 | 6 votes |
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); }