public DachshundIndicator(DachshundTabLayout dachshundTabLayout){
this.dachshundTabLayout = dachshundTabLayout;
valueAnimatorLeft = new ValueAnimator();
valueAnimatorLeft.setDuration(DEFAULT_DURATION);
valueAnimatorLeft.addUpdateListener(this);
valueAnimatorRight = new ValueAnimator();
valueAnimatorRight.setDuration(DEFAULT_DURATION);
valueAnimatorRight.addUpdateListener(this);
accelerateInterpolator = new AccelerateInterpolator();
decelerateInterpolator = new DecelerateInterpolator();
rectF = new RectF();
rect = new Rect();
paint = new Paint();
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.FILL);
leftX = (int) dachshundTabLayout.getChildXCenter(dachshundTabLayout.getCurrentPosition());
rightX = leftX;
}
java类android.view.animation.AccelerateInterpolator的实例源码
DachshundIndicator.java 文件源码
项目:Dachshund-Tab-Layout
阅读 27
收藏 0
点赞 0
评论 0
SmoothProgressDrawable.java 文件源码
项目:GitHub
阅读 35
收藏 0
点赞 0
评论 0
private void initValues(Context context, boolean editMode) {
Resources res = context.getResources();
mInterpolator = new AccelerateInterpolator();
if (!editMode) {
mSectionsCount = res.getInteger(R.integer.spb_default_sections_count);
mSpeed = Float.parseFloat(res.getString(R.string.spb_default_speed));
mReversed = res.getBoolean(R.bool.spb_default_reversed);
mProgressiveStartActivated = res.getBoolean(R.bool.spb_default_progressiveStart_activated);
mColors = new int[]{res.getColor(R.color.spb_default_color)};
mStrokeSeparatorLength = res.getDimensionPixelSize(R.dimen.spb_default_stroke_separator_length);
mStrokeWidth = res.getDimensionPixelOffset(R.dimen.spb_default_stroke_width);
} else {
mSectionsCount = 4;
mSpeed = 1f;
mReversed = false;
mProgressiveStartActivated = false;
mColors = new int[]{0xff33b5e5};
mStrokeSeparatorLength = 4;
mStrokeWidth = 4;
}
mProgressiveStartSpeed = mSpeed;
mProgressiveStopSpeed = mSpeed;
mGradients = false;
}
ScanImageviewActivity.java 文件源码
项目:DailyStudy
阅读 34
收藏 0
点赞 0
评论 0
private void hideSystemUI() {
runOnUiThread(new Runnable() {
public void run() {
toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())
.setDuration(200).start();
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_IMMERSIVE);
fullScreenMode = true;
changeBackGroundColor();
}
});
}
FlyRefreshStyleActivity.java 文件源码
项目:GitHub
阅读 28
收藏 0
点赞 0
评论 0
private void bounceAnimateView(final View view) {
if (view == null) {
return;
}
ValueAnimator swing = ValueAnimator.ofFloat(0, 60, -40, 0);
swing.setDuration(400);
swing.setInterpolator(new AccelerateInterpolator());
swing.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
view.setRotationX((float)animation.getAnimatedValue());
}
});
swing.start();
}
ToggleOnTapCallback.java 文件源码
项目:FlickLauncher
阅读 30
收藏 0
点赞 0
评论 0
@Override
public void onTouchDown() {
if (mAnim != null) {
mAnim.cancel();
}
if (mViewtoToggle.getAlpha() == 1f) {
mIgnoreNextTap = true;
}
mAnim = mViewtoToggle.animate();
mAnim.alpha(0f)
.setDuration(150)
.withEndAction(new Runnable() {
public void run() {
mViewtoToggle.setVisibility(View.INVISIBLE);
}
});
mAnim.setInterpolator(new AccelerateInterpolator(0.75f));
mAnim.start();
}
ViewActivity.java 文件源码
项目:Cluttr
阅读 38
收藏 0
点赞 0
评论 0
public void toggleToolbar(boolean show) {
if (show==showToolbar || toolbarGroup==null) {
return;
}
showToolbar=show;
if (showToolbar) {
startTimeOut();
showSystemUI();
toolbarGroup.animate().translationY(0).setInterpolator(new DecelerateInterpolator()).start();
} else {
if (timeoutSubscription!=null) {
timeoutSubscription.unsubscribe();
}
toolbarGroup.animate().translationY(-toolbarGroup.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
hideSystemUI();
}
}
InstructionView.java 文件源码
项目:mapbox-navigation-android
阅读 31
收藏 0
点赞 0
评论 0
/**
* Hide the instruction list and show the sound button.
* <p>
* This is based on orientation so the different layouts (for portrait vs. landscape)
* can be animated appropriately.
*/
public void hideInstructionList() {
int orientation = getContext().getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
ConstraintSet collapsed = new ConstraintSet();
collapsed.clone(getContext(), R.layout.instruction_layout);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
TransitionManager.beginDelayedTransition(InstructionView.this);
}
collapsed.applyTo(instructionLayout);
instructionListLayout.setVisibility(INVISIBLE);
} else {
Animation slideUp = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up_top);
slideUp.setInterpolator(new AccelerateInterpolator());
instructionListLayout.startAnimation(slideUp);
instructionListLayout.setVisibility(INVISIBLE);
}
}
SliderImageLayout.java 文件源码
项目:SliderImageLayout
阅读 25
收藏 0
点赞 0
评论 0
private void initView()
{
mListImgView = new ArrayList<>();
titleTexts = new ArrayList<>();
mInflater = LayoutInflater.from(mContext);
View view = mInflater.inflate(R.layout.view_slider_layout , this);
mDotLayout = (LinearLayout) view.findViewById(R.id.ll_dot_group);
mTitleTV = (TextView) view.findViewById(R.id.tv_img_desc);
mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
mViewPager.setPageTransformer(true , new DepthPageTransformer());
mViewPager.setOnPageChangeListener(this);
try
{
Field mField = ViewPager.class.getDeclaredField("mScroller");
mField.setAccessible(true);
mScroller = new FixedSpeedScroller(mContext ,new AccelerateInterpolator());
mField.set(mViewPager , mScroller);
}
catch (Exception e)
{
e.printStackTrace();
}
}
HoldingDrawable.java 文件源码
项目:HoldingButton
阅读 35
收藏 0
点赞 0
评论 0
private ValueAnimator createCollapseValueAnimator() {
ValueAnimator animator = ValueAnimator.ofFloat(1f, 0f);
animator.setDuration(DEFAULT_ANIMATION_DURATION_COLLAPSE);
animator.setInterpolator(new AccelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mExpandedScaleFactor[0] = (float) valueAnimator.getAnimatedValue();
invalidateSelf();
}
});
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
notifyCollapsed();
}
});
return animator;
}
NaviSetLineActivity.java 文件源码
项目:AssistantBySDK
阅读 34
收藏 0
点赞 0
评论 0
@Override
public void switchShowRouteLineDetail() {
if (showState == ShowState.showing || showState == ShowState.unshowing)
return;
height = mAnslMapBox.getHeight();
if (showState == ShowState.unshow) {
if (showState == ShowState.showed)
return;
mAnslOutBottomBox.setVisibility(View.GONE);
mAnslVoiceBt.setVisibility(View.GONE);
findViewById(R.id.ansl_route_detail_list_box).setVisibility(View.VISIBLE);
startHeight = mAnslRouteLineBox.getHeight();
mAnslRouteLineBox.getLayoutParams().height = startHeight;
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mAnslRouteDetailBottomBox.getLayoutParams();
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
layoutParams.height = RelativeLayout.LayoutParams.MATCH_PARENT;
}
mAnimateToTargetPosition.reset();
mAnimateToTargetPosition.setInterpolator(new AccelerateInterpolator());
mAnimateToTargetPosition.setDuration(300);
mAnimateToTargetPosition.setAnimationListener(animationListener);
mAnslRouteDetailBottomBox.startAnimation(mAnimateToTargetPosition);
}
FlipClockView.java 文件源码
项目:TimeTicker
阅读 29
收藏 0
点赞 0
评论 0
public void init(Context context) {
mScroller = new Scroller(context, new AccelerateInterpolator());// 加速 // 动画插入器
mInvisibleTextView = new MyTextView(context);
mInvisibleTextView.setText("0");
mInvisibleTextView.setGravity(Gravity.CENTER);
mInvisibleTextView.setIncludeFontPadding(false);
addView(mInvisibleTextView);
mVisibleTextView = new MyTextView(context);
mVisibleTextView.setText("0");
mVisibleTextView.setGravity(Gravity.CENTER);
mVisibleTextView.setIncludeFontPadding(false);
addView(mVisibleTextView);
mShadePaint.setColor(Color.BLACK);
mShadePaint.setStyle(Paint.Style.FILL);
mShinePaint.setColor(Color.WHITE);
mShinePaint.setStyle(Paint.Style.FILL);
}
MaterialIn.java 文件源码
项目:file.io-app
阅读 28
收藏 0
点赞 0
评论 0
public static void startAnimators(final View view, int startOffsetX, int startOffsetY, long delay) {
if (view.getVisibility() == View.VISIBLE && view.getAlpha() != 0f) {
view.clearAnimation();
view.animate().cancel();
final Resources res = view.getResources();
final float endAlpha = view.getAlpha();
final float endTranslateX = view.getTranslationX();
final float endTranslateY = view.getTranslationY();
view.setAlpha(0);
final Animator fade = ObjectAnimator.ofFloat(view, View.ALPHA, endAlpha);
fade.setDuration(res.getInteger(R.integer.material_in_fade_anim_duration));
fade.setInterpolator(new AccelerateInterpolator());
fade.setStartDelay(delay);
fade.start();
ViewPropertyAnimator slide = view.animate();
if (startOffsetY != 0) {
view.setTranslationY(startOffsetY);
slide.translationY(endTranslateY);
} else {
view.setTranslationX(startOffsetX);
slide.translationX(endTranslateX);
}
slide.setInterpolator(new DecelerateInterpolator(2));
slide.setDuration(res.getInteger(R.integer.material_in_slide_anim_duration));
slide.setStartDelay(delay);
slide.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationCancel(Animator animation) {
if (fade.isStarted()) {
fade.cancel();
}
view.setAlpha(endAlpha);
view.setTranslationX(endTranslateX);
view.setTranslationY(endTranslateY);
}
});
slide.start();
}
}
CommentsActivity.java 文件源码
项目:FirebasePost
阅读 34
收藏 0
点赞 0
评论 0
private void startIntroAnimation() {
ViewCompat.setElevation(getToolbar(), 0);
contentRoot.setScaleY(0.1f);
contentRoot.setPivotY(drawingStartLocation);
llAddComment.setTranslationY(200);
contentRoot.animate()
.scaleY(1)
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
ViewCompat.setElevation(getToolbar(), Utils.dpToPx(8));
animateContent();
}
})
.start();
}
FeedContextMenuManager.java 文件源码
项目:InstaFlickr
阅读 30
收藏 0
点赞 0
评论 0
private void performDismissAnimation() {
contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
contextMenuView.setPivotY(contextMenuView.getHeight());
contextMenuView.animate()
.scaleX(0.1f).scaleY(0.1f)
.setDuration(150)
.setInterpolator(new AccelerateInterpolator())
.setStartDelay(100)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (contextMenuView != null) {
contextMenuView.dismiss();
}
isContextMenuDismissing = false;
}
});
}
CommentsActivity.java 文件源码
项目:InstaFlickr
阅读 37
收藏 0
点赞 0
评论 0
private void startIntroAnimation() {
contentRoot.setScaleY(0.1f);
contentRoot.setPivotY(drawingStartLocation);//设置reyclerview的父view展开动画的起始位置(中心线)为上一activity的点击位置
llAddComment.setTranslationY(200);//设置地下发送评论的控件的Y坐标初始位置(隐藏在屏幕底下100dp为起始位置)
contentRoot.animate()
.scaleY(1)
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
animateContent();
}
})
.start();
}
TranslationHideAnimator2.java 文件源码
项目:AndroidSkinAnimator
阅读 33
收藏 0
点赞 0
评论 0
@Override
public SkinAnimator apply(@NonNull final View view, @Nullable final Action action) {
animator = ObjectAnimator.ofPropertyValuesHolder(view,
PropertyValuesHolder.ofFloat("alpha", 1, 0),
PropertyValuesHolder.ofFloat("translationY", 0, view.getHeight()));
animator.setDuration(3 * PRE_DURATION);
animator.setInterpolator(new AccelerateInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
resetView(view);
if (action != null) {
action.action();
}
}
});
return this;
}
TranslationRotationHideAnimator2.java 文件源码
项目:AndroidSkinAnimator
阅读 26
收藏 0
点赞 0
评论 0
@Override
public SkinAnimator apply(@NonNull final View view, @Nullable final Action action) {
animator = ObjectAnimator.ofPropertyValuesHolder(view,
PropertyValuesHolder.ofFloat("alpha", 1, 0),
PropertyValuesHolder.ofFloat("rotation", 0, 360),
PropertyValuesHolder.ofFloat("translationY", 0, view.getHeight()),
PropertyValuesHolder.ofFloat("translationX", 0, view.getWidth()));
animator.setDuration(5 * PRE_DURATION);
animator.setInterpolator(new AccelerateInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
resetView(view);
if (action != null) {
action.action();
}
}
});
return this;
}
TranslationAnimator2.java 文件源码
项目:AndroidSkinAnimator
阅读 27
收藏 0
点赞 0
评论 0
@Override
public SkinAnimator apply(@NonNull View view, @Nullable final Action action) {
this.targetView = view;
preAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
PropertyValuesHolder.ofFloat("translationX",
view.getLeft(), view.getRight()))
.setDuration(PRE_DURATION * 3);
preAnimator.setInterpolator(new AccelerateInterpolator());
afterAnimator = ObjectAnimator.ofPropertyValuesHolder(targetView,
PropertyValuesHolder.ofFloat("translationX",
view.getLeft() - view.getWidth(), view.getLeft()))
.setDuration(AFTER_DURATION * 3);
afterAnimator.setInterpolator(new BounceInterpolator());
preAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (action != null) {
action.action();
}
afterAnimator.start();
}
});
return this;
}
RxAnimations.java 文件源码
项目:Rx2Animations
阅读 35
收藏 0
点赞 0
评论 0
public static Completable leave(final View view, final int xOffset, final int yOffset) {
final float startingX = view.getX();
final float startingY = view.getY();
return animate(view, new AccelerateInterpolator())
.fadeOut()
.translateBy(xOffset, yOffset)
.onAnimationCancel(aView -> set(aView, startingX, startingY, TRANSPARENT))
.schedule(false);
}
FloatingView.java 文件源码
项目:text_converter
阅读 27
收藏 0
点赞 0
评论 0
private void hideDeleteBox(boolean shrink) {
if (mDeleteBoxVisible) {
mDeleteBoxVisible = false;
if (mDeleteView != null) {
mDeleteBoxView.animate()
.alpha(0)
.setDuration(DELETE_ANIM_DURATION);
mDeleteIconHolder.animate()
.scaleX(shrink ? 0.3f : 1)
.scaleY(shrink ? 0.3f : 1)
.translationYBy(CLOSE_ANIMATION_DISTANCE)
.setDuration(DELETE_ANIM_DURATION)
.setInterpolator(new AccelerateInterpolator())
.setListener(new AnimationFinishedListener() {
@Override
public void onAnimationFinished() {
if (mDeleteView != null) {
mDeleteView.setVisibility(View.GONE);
}
}
});
}
}
}
DetailActivity.java 文件源码
项目:LittleFlickr
阅读 35
收藏 0
点赞 0
评论 0
void startHideAnimation() {
float toolBarYStart = mDetailToolBar.getTop();
float toolBarYEnd = mDetailToolBar.getTop() - mDetailToolBar.getBottom();
float floatingButtonYStart = mFloatingActionButton.getTop();
float floatingButtonYEnd = mViewPager.getBottom();
ObjectAnimator toolBarAnimator = ObjectAnimator
.ofFloat(mDetailToolBar, "y", toolBarYStart, toolBarYEnd)
.setDuration(500);
toolBarAnimator.setInterpolator(new AccelerateInterpolator());
ObjectAnimator floatingButtonAnimator = ObjectAnimator
.ofFloat(mFloatingActionButton, "y", floatingButtonYStart, floatingButtonYEnd)
.setDuration(500);
floatingButtonAnimator.setInterpolator(new AccelerateInterpolator());
AnimatorSet animatorSet = new AnimatorSet();
animatorSet
.play(toolBarAnimator)
.before(floatingButtonAnimator);
animatorSet.start();
}
PlayerPlaybackControlsFragment.java 文件源码
项目:RetroMusicPlayer
阅读 28
收藏 0
点赞 0
评论 0
public void showBouceAnimation() {
playPauseFab.clearAnimation();
playPauseFab.setScaleX(0.9f);
playPauseFab.setScaleY(0.9f);
playPauseFab.setVisibility(View.VISIBLE);
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
playPauseFab.animate()
.setDuration(200)
.setInterpolator(new DecelerateInterpolator())
.scaleX(1.1f)
.scaleY(1.1f)
.withEndAction(() -> playPauseFab.animate()
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.scaleX(1f)
.scaleY(1f)
.alpha(1f)
.start())
.start();
}
FlyRefreshStyleActivity.java 文件源码
项目:SmartRefreshLayout
阅读 36
收藏 0
点赞 0
评论 0
private void bounceAnimateView(final View view) {
if (view == null) {
return;
}
ValueAnimator swing = ValueAnimator.ofFloat(0, 60, -40, 0);
swing.setDuration(400);
swing.setInterpolator(new AccelerateInterpolator());
swing.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
view.setRotationX((float)animation.getAnimatedValue());
}
});
swing.start();
}
DetailActivity.java 文件源码
项目:LittleFlickr
阅读 27
收藏 0
点赞 0
评论 0
void startShowAnimation() {
float toolBarYStart = mDetailToolBar.getTop();
float toolBarYEnd = mDetailToolBar.getTop() - mDetailToolBar.getBottom();
float floatingButtonYStart = mFloatingActionButton.getTop();
float floatingButtonYEnd = mViewPager.getBottom();
ObjectAnimator toolBarAnimator = ObjectAnimator
.ofFloat(mDetailToolBar, "y", toolBarYEnd, toolBarYStart)
.setDuration(500);
toolBarAnimator.setInterpolator(new AccelerateInterpolator());
ObjectAnimator floatingButtonAnimator = ObjectAnimator
.ofFloat(mFloatingActionButton, "y", floatingButtonYEnd, floatingButtonYStart)
.setDuration(500);
floatingButtonAnimator.setInterpolator(new AccelerateInterpolator());
AnimatorSet animatorSet = new AnimatorSet();
animatorSet
.play(toolBarAnimator)
.before(floatingButtonAnimator);
animatorSet.start();
}
SunsetFragment.java 文件源码
项目:Android-Programming-BigNerd
阅读 31
收藏 0
点赞 0
评论 0
private void sunsetAnimator() {
float sunYStart = mSunView.getTop();
float sunYEnd = mSkyView.getHeight();
ObjectAnimator heightAnimator = ObjectAnimator.ofFloat(mSunView, "y", sunYStart, sunYEnd)
.setDuration(3000);
ObjectAnimator sunsetSkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
mBlueSkyColor, mSunsetSkyColor)
.setDuration(3000);
ObjectAnimator nightSkyAnimator = ObjectAnimator.ofInt(mSkyView, "backgroundColor",
mSunsetSkyColor, mNightSkyColor)
.setDuration(1500);
heightAnimator.setInterpolator(new AccelerateInterpolator());
sunsetSkyAnimator.setEvaluator(new ArgbEvaluator());
nightSkyAnimator.setEvaluator(new ArgbEvaluator());
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(heightAnimator).with(sunsetSkyAnimator).before(nightSkyAnimator);
animatorSet.start();
}
DrawerToast.java 文件源码
项目:AndroidBasicLibs
阅读 27
收藏 0
点赞 0
评论 0
/**
* 获得离场动画
*
* @return
*/
protected Animation getEndAnimation() {
AlphaAnimation animAlpha = new AlphaAnimation(1, 0);
animAlpha.setDuration(TIME_END_ANIM);
animAlpha.setFillAfter(true);
TranslateAnimation animTrans = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0f,
Animation.RELATIVE_TO_PARENT, -1.5f,
Animation.RELATIVE_TO_PARENT, 0f,
Animation.RELATIVE_TO_PARENT, 0f);
animTrans.setDuration(TIME_END_ANIM);
animTrans.setFillAfter(true);
animTrans.setInterpolator(new AccelerateInterpolator());
AnimationSet sets = new AnimationSet(true);
sets.addAnimation(animAlpha);
sets.addAnimation(animTrans);
return sets;
}
BottomRedPointView.java 文件源码
项目:letv
阅读 29
收藏 0
点赞 0
评论 0
private void init(Context context, View target) {
this.context = context;
this.target = target;
fadeIn = new AlphaAnimation(0.0f, 1.0f);
fadeIn.setInterpolator(new DecelerateInterpolator());
fadeIn.setDuration(200);
fadeOut = new AlphaAnimation(1.0f, 0.0f);
fadeOut.setInterpolator(new AccelerateInterpolator());
fadeOut.setDuration(200);
this.isShown = false;
if (this.target != null) {
applyTo(this.target);
} else {
show();
}
}
BezierCircleHeader.java 文件源码
项目:SmartRefreshLayout
阅读 25
收藏 0
点赞 0
评论 0
@Override
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
mShowOuter = false;
mShowBoll = false;
ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mFinishRatio = (float) animation.getAnimatedValue();
BezierCircleHeader.this.invalidate();
}
});
animator.setInterpolator(new AccelerateInterpolator());
animator.setDuration(DURATION_FINISH);
animator.start();
return DURATION_FINISH;
}
HazeType.java 文件源码
项目:FakeWeather
阅读 26
收藏 0
点赞 0
评论 0
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
super.endAnimation(dynamicWeatherView, listener);
ValueAnimator animator1 = ValueAnimator.ofFloat(1, 0);
animator1.setInterpolator(new AccelerateInterpolator());
animator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
speed = (float) animation.getAnimatedValue() * 32;
rotate = (float) animation.getAnimatedValue();
}
});
AnimatorSet animSet = new AnimatorSet();
animSet.play(animator1);
animSet.setDuration(1000);
if (listener != null) {
animSet.addListener(listener);
}
animSet.start();
}
HailType.java 文件源码
项目:FakeWeather
阅读 27
收藏 0
点赞 0
评论 0
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
super.endAnimation(dynamicWeatherView, listener);
ValueAnimator animator = ValueAnimator.ofFloat(getWidth() - bitmap.getWidth() * 0.25f, getWidth());
animator.setDuration(1000);
animator.setRepeatCount(0);
animator.setInterpolator(new AccelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
transFactor = (float) animation.getAnimatedValue();
}
});
if (listener != null) {
animator.addListener(listener);
}
animator.start();
}