use of android.animation.ArgbEvaluator in project BoomMenu by Nightonke.
the class BoomMenuButton method lightBackground.
private void lightBackground(boolean immediately) {
createBackground();
AnimationManager.animate(background, "backgroundColor", 0, immediately ? 1 : hideDuration + hideDelay * (pieces.size() - 1), new ArgbEvaluator(), new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
boomStateEnum = BoomStateEnum.DidHide;
if (onBoomListener != null)
onBoomListener.onBoomDidHide();
clearViewsAndValues();
}
}, dimColor, Color.TRANSPARENT);
if (piecePlaceEnum == PiecePlaceEnum.Share) {
AnimationManager.animate(shareLinesView, "hideProcess", 0, immediately ? 1 : hideDuration + hideDelay * (pieces.size() - 1), Ease.getInstance(EaseEnum.Linear), 0f, 1f);
}
}
use of android.animation.ArgbEvaluator in project LoadingView by ldoublem.
the class LVChromeLogo method initPaint.
private void initPaint() {
evaluator = new ArgbEvaluator();
mPaintRed = new Paint();
mPaintRed.setAntiAlias(true);
mPaintRed.setStyle(Paint.Style.FILL);
mPaintRed.setColor(Color.rgb(211, 57, 53));
mPaintYellow = new Paint();
mPaintYellow.setAntiAlias(true);
mPaintYellow.setStyle(Paint.Style.FILL);
mPaintYellow.setColor(Color.rgb(253, 197, 53));
mPaintGreen = new Paint();
mPaintGreen.setAntiAlias(true);
mPaintGreen.setStyle(Paint.Style.FILL);
mPaintGreen.setColor(Color.rgb(27, 147, 76));
mPaintBulue = new Paint();
mPaintBulue.setAntiAlias(true);
mPaintBulue.setStyle(Paint.Style.FILL);
mPaintBulue.setColor(Color.rgb(61, 117, 242));
mPaintWhite = new Paint();
mPaintWhite.setAntiAlias(true);
mPaintWhite.setStyle(Paint.Style.FILL);
mPaintWhite.setColor(Color.WHITE);
mPaintLine = new Paint();
mPaintLine.setAntiAlias(true);
mPaintLine.setStyle(Paint.Style.FILL);
mPaintLine.setColor(Color.argb(30, 0, 0, 0));
mProgerssRotateAnim = new RotateAnimation(0f, 360f, android.view.animation.Animation.RELATIVE_TO_SELF, 0.5f, android.view.animation.Animation.RELATIVE_TO_SELF, 0.5f);
mProgerssRotateAnim.setRepeatCount(-1);
//不停顿
mProgerssRotateAnim.setInterpolator(new LinearInterpolator());
//停在最后
mProgerssRotateAnim.setFillAfter(true);
}
use of android.animation.ArgbEvaluator in project LoadingView by ldoublem.
the class LVBlazeWood method initPaint.
private void initPaint() {
evaluator = new ArgbEvaluator();
mPadding = dip2px(1);
mPaintBg = new Paint();
mPaintBg.setAntiAlias(true);
mPaintBg.setStyle(Paint.Style.FILL);
mPaintBg.setColor(Color.BLACK);
mPaintWood = new Paint();
mPaintWood.setAntiAlias(true);
mPaintWood.setStyle(Paint.Style.FILL);
mPaintWood.setColor(Color.rgb(122, 57, 47));
mPaintFire = new Paint();
mPaintFire.setAntiAlias(true);
mPaintFire.setStyle(Paint.Style.FILL);
mPaintFire.setColor(Color.rgb(232, 132, 40));
}
use of android.animation.ArgbEvaluator in project qksms by moezbhatti.
the class ThemeManager method setTheme.
public static void setTheme(Theme theme) {
final int startColor = mBackgroundColor;
initializeTheme(theme);
final int endColor = mBackgroundColor;
if (startColor != endColor) {
ValueAnimator backgroundAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), startColor, endColor);
backgroundAnimation.setDuration(TRANSITION_LENGTH);
backgroundAnimation.addUpdateListener(animation -> {
mBackgroundColor = (Integer) animation.getAnimatedValue();
LiveViewManager.refreshViews(QKPreference.BACKGROUND);
});
backgroundAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mBackgroundColor = endColor;
LiveViewManager.refreshViews(QKPreference.BACKGROUND);
WidgetProvider.notifyThemeChanged(mContext);
}
});
backgroundAnimation.start();
} else {
LiveViewManager.refreshViews(QKPreference.BACKGROUND);
WidgetProvider.notifyThemeChanged(mContext);
}
}
use of android.animation.ArgbEvaluator in project Slidr by r0adkll.
the class Slidr method attach.
/**
* Attach a slideable mechanism to an activity that adds the slide to dismiss functionality
* and allows for the statusbar to transition between colors
*
* @param activity the activity to attach the slider to
* @param statusBarColor1 the primaryDark status bar color of the interface that this will slide back to
* @param statusBarColor2 the primaryDark status bar color of the activity this is attaching to that will transition
* back to the statusBarColor1 color
*
* @return a {@link com.r0adkll.slidr.model.SlidrInterface} that allows
* the user to lock/unlock the sliding mechanism for whatever purpose.
*/
public static SlidrInterface attach(final Activity activity, final int statusBarColor1, final int statusBarColor2) {
// Setup the slider panel and attach it to the decor
final SliderPanel panel = initSliderPanel(activity, null);
// Set the panel slide listener for when it becomes closed or opened
panel.setOnPanelSlideListener(new SliderPanel.OnPanelSlideListener() {
private final ArgbEvaluator mEvaluator = new ArgbEvaluator();
@Override
public void onStateChanged(int state) {
}
@Override
public void onClosed() {
activity.finish();
activity.overridePendingTransition(0, 0);
}
@Override
public void onOpened() {
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onSlideChange(float percent) {
// Interpolate the statusbar color
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && statusBarColor1 != -1 && statusBarColor2 != -1) {
int newColor = (int) mEvaluator.evaluate(percent, statusBarColor1, statusBarColor2);
activity.getWindow().setStatusBarColor(newColor);
}
}
});
// Return the lock interface
return initInterface(panel);
}
Aggregations