This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sunrefreshview and modify sample's icon
- Loading branch information
LuMeng
committed
Jul 8, 2016
1 parent
c072720
commit 508a445
Showing
22 changed files
with
311 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,20 @@ | |
import android.view.animation.AccelerateInterpolator; | ||
import android.view.animation.Animation; | ||
import android.view.animation.Interpolator; | ||
import android.view.animation.LinearInterpolator; | ||
|
||
/** | ||
* @author lumeng on 2016-06-16. | ||
* [email protected] | ||
*/ | ||
public class AnimationFractory { | ||
public class AnimationFactory { | ||
private static final int ANIMATION_FIRE_BURN_DURATION = 180; | ||
private static final int ANIMATION_FIRE_SCALE_DURATION = 100; | ||
private static final int ANIMATION_SUN_ROTATE_DURATION = 1000; | ||
|
||
private static final Interpolator ACCELERATE_INTERPOLATOR = new AccelerateInterpolator(); | ||
private static final Interpolator DECELERATE_INTERPOLATOR = new AccelerateDecelerateInterpolator(); | ||
private static final Interpolator NORMAL_INTERPOLATOR = new LinearInterpolator(); | ||
|
||
Animation getFireScale(Animation animation) { | ||
configureAnimation(animation, | ||
|
@@ -38,6 +41,17 @@ Animation getFireBurn(Animation animation) { | |
return animation; | ||
} | ||
|
||
Animation getSunRotate(Animation animation) { | ||
configureAnimation(animation, | ||
NORMAL_INTERPOLATOR, | ||
ANIMATION_SUN_ROTATE_DURATION, | ||
0, | ||
Animation.RESTART, | ||
Animation.INFINITE); | ||
|
||
return animation; | ||
} | ||
|
||
private void configureAnimation(Animation animation, Interpolator interpolator, int duration, int startOffset, int repeatMode, int repeatCount) { | ||
animation.setInterpolator(interpolator); | ||
animation.setDuration(duration); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.