java类android.view.animation.LinearInterpolator的实例源码

ShareElementActivity.java 文件源码 项目:AndroidShareElement 阅读 26 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        setTheme(R.style.AppTheme);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_share_element);
    mImageView = (ImageView) findViewById(R.id.image_view);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        mImageView.setTransitionName(MainActivity.TRANSITION_NAME_SHARE);
    } else {
        ShareElementInfo info = getIntent().getExtras().getParcelable(MainActivity.EXTRA_SHARE_ELEMENT_INFO);
        mShareElement = new FKJShareElement(info, this, mImageView.getRootView());
        mShareElement.convert(mImageView)
                .setDuration(ANIMATOR_DURATION)
                .setInterpolator(new LinearInterpolator())
                .startEnterAnimator();
    }
}
IndicatorLoadingView.java 文件源码 项目:MyLoadingViews 阅读 42 收藏 0 点赞 0 评论 0
/**
 * 开始旋转
 *
 * @param start
 * @param end
 * @param time
 */
private void startAnim(int start, final int end, long time) {
    isAround = true;
    mCurrentMode = MODE_ROTATE;
    mValueAnimator = ValueAnimator.ofInt(start, end);
    mValueAnimator.setDuration(time);
    mValueAnimator.setRepeatCount(getRepeatCount());
    mValueAnimator.setRepeatMode(ValueAnimator.RESTART);
    mValueAnimator.setInterpolator(new LinearInterpolator());
    mValueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            if (currentValue != (int) (animation.getAnimatedValue())) {
                onAnimatorUpdate(animation);
            }
        }
    });
    mValueAnimator.start();
}
XRadarView.java 文件源码 项目:XRadarView 阅读 34 收藏 0 点赞 0 评论 0
public void loadAnimation(boolean enabled) {
    if (!enabled) {
        currentScale = 1;
        invalidate();
    } else {
        ValueAnimator valueAnimator = ValueAnimator.ofFloat(0.3f, 1.0f);
        valueAnimator.setInterpolator(new LinearInterpolator());
        valueAnimator.setDuration(animDuration);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                currentScale = (float) animation.getAnimatedValue();
                invalidate();
            }
        });
        valueAnimator.start();
    }
}
SimpleProgressBar.java 文件源码 项目:RLibrary 阅读 39 收藏 0 点赞 0 评论 0
private void startIncertitudeAnimator() {
    if (mColorAnimator == null) {
        mColorAnimator = ValueAnimator.ofObject(new ArgbEvaluator(), mProgressColor, SkinHelper.getTranColor(mProgressColor, 0x10));
        mColorAnimator.setInterpolator(new LinearInterpolator());
        mColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                drawColor = (int) animation.getAnimatedValue();//之后就可以得到动画的颜色了.
                postInvalidate();
            }
        });
        mColorAnimator.setDuration(1000);
        mColorAnimator.setRepeatCount(ValueAnimator.INFINITE);
        mColorAnimator.setRepeatMode(ValueAnimator.REVERSE);
    }
    mColorAnimator.start();
}
PullToRefreshListView.java 文件源码 项目:GitHub 阅读 48 收藏 0 点赞 0 评论 0
private void init(Context context) {
    mFlipAnimation = new RotateAnimation(0, -180,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mFlipAnimation.setInterpolator(new LinearInterpolator());
    mFlipAnimation.setDuration(250);
    mFlipAnimation.setFillAfter(true);
    mReverseFlipAnimation = new RotateAnimation(-180, 0,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
    mReverseFlipAnimation.setDuration(250);
    mReverseFlipAnimation.setFillAfter(true);

    mRefreshView = (LinearLayout) View.inflate(context, R.layout.pull_to_refresh_header, null);
    mRefreshViewText = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_text);
    mRefreshViewImage = (ImageView) mRefreshView.findViewById(R.id.pull_to_refresh_image);
    mRefreshViewProgress = (ProgressBar) mRefreshView.findViewById(R.id.pull_to_refresh_progress);
    mRefreshViewLastUpdated = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_updated_at);

    mRefreshState = PULL_TO_REFRESH;
    mRefreshViewImage.setMinimumHeight(50); //设置下拉最小的高度为50

    setFadingEdgeLength(0);
    setHeaderDividersEnabled(false);

    //把refreshview加入到listview的头部
    addHeaderView(mRefreshView);
    super.setOnScrollListener(this);
    mRefreshView.setOnClickListener(this);

    mRefreshView.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
    mRefreshViewHeight = mRefreshView.getMeasuredHeight();
    mRefreshOriginalTopPadding = -mRefreshViewHeight;

    resetHeaderPadding();
}
LineFadeIndicator.java 文件源码 项目:Dachshund-Tab-Layout 阅读 38 收藏 0 点赞 0 评论 0
public LineFadeIndicator(DachshundTabLayout dachshundTabLayout) {
    this.dachshundTabLayout = dachshundTabLayout;

    valueAnimator = new ValueAnimator();
    valueAnimator.setInterpolator(new LinearInterpolator());
    valueAnimator.setDuration(DEFAULT_DURATION);
    valueAnimator.addUpdateListener(this);
    valueAnimator.setIntValues(0,255);

    paint = new Paint();
    paint.setAntiAlias(true);
    paint.setStyle(Paint.Style.FILL);

    rectF = new RectF();

    startXLeft = (int) dachshundTabLayout.getChildXLeft(dachshundTabLayout.getCurrentPosition());
    startXRight = (int) dachshundTabLayout.getChildXRight(dachshundTabLayout.getCurrentPosition());

    edgeRadius = -1;
}
ReadEPubActivity.java 文件源码 项目:BookReader-master 阅读 39 收藏 0 点赞 0 评论 0
private void toolbarAnimateHide() {
    if (mIsActionBarVisible) {
        mCommonToolbar.animate()
                .translationY(-mCommonToolbar.getHeight())
                .setInterpolator(new LinearInterpolator())
                .setDuration(180)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        toolbarSetElevation(0);
                        hideStatusBar();
                        if (mTocListPopupWindow != null && mTocListPopupWindow.isShowing()) {
                            mTocListPopupWindow.dismiss();
                        }
                    }
                });
        mIsActionBarVisible = false;
    }
}
AnimatingDrawable.java 文件源码 项目:floating_calc 阅读 32 收藏 0 点赞 0 评论 0
private AnimatingDrawable(Drawable[] frames, long duration) {
    mFrames = frames;
    mAnimator = ValueAnimator.ofInt(0, mFrames.length - 1);
    mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            // Normalize the position in case the interporator isn't linear
            int pos = Math.max(Math.min((int) animation.getAnimatedValue(), mFrames.length - 1), 0);
            setFrame(mFrames[pos]);
        }
    });
    mAnimator.setDuration(duration);
    mAnimator.setInterpolator(new LinearInterpolator());

    // Calculate the largest drawable, and use that as our intrinsic width/height
    for (Drawable drawable : mFrames) {
        mIntrinsicWidth = Math.max(mIntrinsicWidth, drawable.getIntrinsicWidth());
        mIntrinsicHeight = Math.max(mIntrinsicHeight, drawable.getIntrinsicWidth());
    }

    setFrame(mFrames[0]);
}
ScrollAwareFABBehavior.java 文件源码 项目:RetroMusicPlayer 阅读 42 收藏 0 点赞 0 评论 0
@Override
public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
                           @NonNull FloatingActionButton child,
                           @NonNull View target,
                           int dxConsumed,
                           int dyConsumed,
                           int dxUnconsumed,
                           int dyUnconsumed) {
    super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed);

    //child -> Floating Action Button
    if (dyConsumed > 0) {
        Log.d("Scrolling", "Up");
        CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) child.getLayoutParams();
        int fab_bottomMargin = layoutParams.bottomMargin;
        child.animate().translationY(child.getHeight() + fab_bottomMargin).setInterpolator(new LinearInterpolator()).start();
    } else if (dyConsumed < 0) {
        Log.d("Scrolling", "down");
        child.animate().translationY(0).setInterpolator(new LinearInterpolator()).start();
    }
}
ScanMusicActivity.java 文件源码 项目:NeteaseCloudMusic 阅读 34 收藏 0 点赞 0 评论 0
private void initAnimations() {
    searchAnimation = ValueAnimator.ofFloat(0f, 1f);
    searchAnimation.setDuration(50000);
    searchAnimation.setRepeatCount(ValueAnimator.INFINITE);
    searchAnimation.setRepeatMode(ValueAnimator.RESTART);
    searchAnimation.setInterpolator(new LinearInterpolator());
    searchAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            float angle = (valueAnimator.getAnimatedFraction() * 360);
            ViewHelper.setTranslationX(ivSearch, (float) Math.sin(angle) * radius);
            ViewHelper.setTranslationY(ivSearch, (float) Math.cos(angle) * radius);
        }
    });


    scanAnimation = new TranslateAnimation(TranslateAnimation.RELATIVE_TO_PARENT, 0f, TranslateAnimation.RELATIVE_TO_PARENT, 0f, TranslateAnimation.RELATIVE_TO_PARENT, 0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.61f);
    scanAnimation.setDuration(2000);
    scanAnimation.setRepeatCount(TranslateAnimation.INFINITE);
    scanAnimation.setRepeatMode(TranslateAnimation.RESTART);
}
FriskyTanslations.java 文件源码 项目:FriskyImage 阅读 31 收藏 0 点赞 0 评论 0
public void MoveXBy(float distance,long duration,final boolean StopRotationAtCurrentAngle)
{
    final FriskyTanslations friskyTanslations1 =this;
    Runnable runnable=new Runnable() {
        @Override
        public void run() {

                if(StopRotationAtCurrentAngle)
                {
                    friskyTanslations1.StopCrazyRotationAtCurrentAngle();
                }
                else
                {
                    friskyTanslations1.StopCrazyRotationAtAngle(0);

                }


        }
    };
    view.animate().translationXBy(distance).setInterpolator(new LinearInterpolator()).withEndAction(runnable).setDuration(duration).start();


}
AnimationUtil.java 文件源码 项目:CXJPadProject 阅读 36 收藏 0 点赞 0 评论 0
public static void rotate(View v){
    //创建旋转动画 对象   fromDegrees:旋转开始的角度  toDegrees:结束的角度
    RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    //设置动画的显示时间
    rotateAnimation.setDuration(1000);
    //设置动画重复播放几次
    rotateAnimation.setRepeatCount(RotateAnimation.INFINITE);
    //设置动画插值器
    rotateAnimation.setInterpolator(new LinearInterpolator());
    //设置动画重复播放的方式,翻转播放
    rotateAnimation.setRepeatMode(Animation.RESTART);
    //拿着imageview对象来运行动画效果
    v.setAnimation(rotateAnimation);
}
FriskyRotating.java 文件源码 项目:FriskyImage 阅读 30 收藏 0 点赞 0 评论 0
public void CustomOscillation(int startAngle, final int MaxAngleOfRotation,final int TimeToReachStartAngle,final int TimePeriodOfOscillation)
{
     runnable1 = new Runnable() {
        @Override
        public void run() {
            imageView.animate().rotationBy((-1)*MaxAngleOfRotation).withEndAction(runnable2).setDuration(TimePeriodOfOscillation).setInterpolator(new LinearInterpolator()).start();
        }
    };

    runnable2 = new Runnable() {
        @Override
        public void run() {
            imageView.animate().rotationBy(MaxAngleOfRotation).withEndAction(runnable1).setDuration(TimePeriodOfOscillation).setInterpolator(new LinearInterpolator()).start();
        }
    };

    imageView.animate().rotationBy(startAngle).withEndAction(runnable1).setDuration(TimeToReachStartAngle).setInterpolator(new LinearInterpolator()).start();

}
FriskyRotating.java 文件源码 项目:FriskyImage 阅读 34 收藏 0 点赞 0 评论 0
public void StopCrazyRotationAtCurrentAngle()
{
    runnable1 = new Runnable() {
        @Override
        public void run() {
            imageView.animate().rotationBy(0).withEndAction(runnable2).setDuration(0).setInterpolator(new LinearInterpolator()).start();
        }
    };

    runnable2 = new Runnable() {
        @Override
        public void run() {
            imageView.animate().rotationBy(0).withEndAction(runnable1).setDuration(0).setInterpolator(new LinearInterpolator()).start();
        }
    };

    imageView.animate().rotationBy(0).withEndAction(runnable1).setDuration(0).setInterpolator(new LinearInterpolator()).start();

}
LoadView.java 文件源码 项目:SunmiUI 阅读 37 收藏 0 点赞 0 评论 0
private void init(){
    mView = getView();
    mText = (TextView)mView.findViewById(R.id.txt);
    img = (ImageView)mView.findViewById(R.id.img);
    Animation operatingAnim = AnimationUtils.loadAnimation(getContext(), R.anim.loading_anim);
    LinearInterpolator lin = new LinearInterpolator();
    operatingAnim.setInterpolator(lin);
    img.setAnimation(operatingAnim);
    img.startAnimation(operatingAnim);
}
BackgroundDrawableSwitchCompat.java 文件源码 项目:GracefulMovies 阅读 30 收藏 0 点赞 0 评论 0
private void startAnimation(boolean firstToSecond) {
        if (animator != null) {
            animator.cancel();
        }
        animator = ValueAnimator.ofInt(firstToSecond ? OPAQUE : TRANSPARENT, firstToSecond ? TRANSPARENT : OPAQUE);
        animator.setDuration(THUMB_ANIMATION_DURATION);
        animator.setInterpolator(new LinearInterpolator());
//        animator.setRepeatMode(ValueAnimator.RESTART);
//        animator.setRepeatCount(ValueAnimator.INFINITE);

        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                mFirstDrawableAlpha = (int) animation.getAnimatedValue();
                mSecondDrawableAlpha = OPAQUE - (int) animation.getAnimatedValue();
                invalidate();
            }
        });

        animator.start();
    }
BouncingSlidingDotView.java 文件源码 项目:widgetlab 阅读 35 收藏 0 点赞 0 评论 0
@NonNull
private AnimatorSet getMoveAnimator(long ratioAnimationTotalDuration) {
    AnimatorSet moveAnimatorSet = new AnimatorSet();

    ValueAnimator slidingAnimator = ValueAnimator.ofInt(startLeft, 0);
    slidingAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animator) {
            targetLeft = (int) animator.getAnimatedValue();
            invalidate();
        }
    });
    slidingAnimator.setInterpolator(new LinearInterpolator());
    slidingAnimator.setDuration(ratioAnimationTotalDuration);

    AnimatorSet bounceSet = getBounceAnimatorSet(ratioAnimationTotalDuration);

    moveAnimatorSet.playTogether(slidingAnimator, bounceSet);
    return moveAnimatorSet;
}
CredentialDisplay.java 文件源码 项目:passman-android 阅读 31 收藏 0 点赞 0 评论 0
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        Vault v = (Vault) SingleTon.getTon().getExtra(SettingValues.ACTIVE_VAULT.toString());
        credential = v.findCredentialByGUID(getArguments().getString(CREDENTIAL));
    }

    handler = new Handler();
    otp_refresh = new Runnable() {
        @Override
        public void run() {
            int progress =  (int) (System.currentTimeMillis() / 1000) % 30 ;
            otp_progress.setProgress(progress*100);

            ObjectAnimator animation = ObjectAnimator.ofInt(otp_progress, "progress", (progress+1)*100);
            animation.setDuration(1000);
            animation.setInterpolator(new LinearInterpolator());
            animation.start();

            otp.setText(TOTPHelper.generate(new Base32().decode(credential.getOtp())));
            handler.postDelayed(this, 1000);
        }
    };
}
PageScrollTab.java 文件源码 项目:PageScrollView 阅读 35 收藏 0 点赞 0 评论 0
public void smoothScroll(int from, int to, Animation.AnimationListener l) {
    int childCount = getItemCount();
    if (from >= 0 && to >= 0 && (from < childCount && to < childCount)) {
        if (getAnimation() != null) {
            getAnimation().cancel();
            clearAnimation();
        }
        boolean horizontal = mOrientation == HORIZONTAL;
        int scrollFrom = computeScrollOffset(getVirtualChildAt(from, true), 0, false, horizontal);
        int scrollTo = computeScrollOffset(getVirtualChildAt(to, true), 0, false, horizontal);
        if (scrollTo != scrollFrom) {
            int absDx = Math.abs(scrollTo - scrollFrom);
            ScrollAnimation anim = new ScrollAnimation(scrollFrom, scrollTo);
            int measureWidth = getMeasuredWidth();
            if (measureWidth == 0) {
                measureWidth = Math.max(getSuggestedMinimumWidth(), 1);
            }
            anim.setDuration(Math.min(4000, absDx * 1800 / measureWidth));
            anim.setInterpolator(new LinearInterpolator());
            anim.setAnimationListener(l);
            startAnimation(anim);
        }
    }
}
AlphaHideAnimator.java 文件源码 项目:AndroidSkinAnimator 阅读 32 收藏 0 点赞 0 评论 0
@Override
public SkinAnimator apply(@NonNull final View view, @Nullable final Action action) {
    animator = ObjectAnimator.ofPropertyValuesHolder(view,
            PropertyValuesHolder.ofFloat("alpha", 1, 0)
    );
    animator.setDuration(3 * PRE_DURATION);
    animator.setInterpolator(new LinearInterpolator());
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            resetView(view);
            if (action != null) {
                action.action();
            }
        }
    });
    return this;
}
RefreshListView.java 文件源码 项目:yyox 阅读 37 收藏 0 点赞 0 评论 0
private void init(Context context) {
    inflater = LayoutInflater.from(context);
    headView = (LinearLayout) inflater.inflate(R.layout.kf5_list_head, null);
    arrowImageView = (ImageView) headView.findViewById(R.id.kf5_head_arrowImageView);
    arrowImageView.setMinimumWidth(70);
    arrowImageView.setMinimumHeight(50);
    progressBar = (ProgressBar) headView.findViewById(R.id.kf5_head_progressBar);
    tipsTextview = (TextView) headView.findViewById(R.id.kf5_head_tipsTextView);
    lastUpdatedTextView = (TextView) headView.findViewById(R.id.kf5_head_lastUpdatedTextView);
    measureView(headView);
    headContentHeight = headView.getMeasuredHeight();
    headContentWidth = headView.getMeasuredWidth();
    headView.setPadding(0, -1 * headContentHeight, 0, 0);
    headView.invalidate();
    addHeaderView(headView);
    setOnScrollListener(this);
    animation = new RotateAnimation(0, -180,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    animation.setInterpolator(new LinearInterpolator());
    animation.setDuration(250);
    animation.setFillAfter(true);
    reverseAnimation = new RotateAnimation(-180, 0,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    reverseAnimation.setInterpolator(new LinearInterpolator());
    reverseAnimation.setDuration(200);
    reverseAnimation.setFillAfter(true);

    state = DONE;
    isRefreshable = false;
}
BlurEngine.java 文件源码 项目:MVVMFrames 阅读 38 收藏 0 点赞 0 评论 0
@Override
@SuppressLint("NewApi")
protected void onPostExecute(Void aVoid) {
    super.onPostExecute(aVoid);

    view.destroyDrawingCache();
    view.setDrawingCacheEnabled(false);

    activity.getWindow().addContentView(
            blurredBackgroundView,
            blurredBackgroundLayoutParams
    );

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
        blurredBackgroundView.setAlpha(0f);
        blurredBackgroundView
                .animate()
                .alpha(1f)
                .setDuration(300)
                .setInterpolator(new LinearInterpolator())
                .start();
    }
    view = null;
    bitmap = null;
}
CustomRefreshLayout.java 文件源码 项目:BrotherWeather 阅读 41 收藏 0 点赞 0 评论 0
private void startLoadingAnimation(ImageView imageView) {
  RotateAnimation loadingAnimation =
      new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
          0.5f);
  loadingAnimation.setDuration(1000);
  loadingAnimation.setRepeatCount(-1);
  loadingAnimation.setInterpolator(new LinearInterpolator());
  loadingAnimation.setFillAfter(false);
  imageView.setAnimation(loadingAnimation);
  loadingAnimation.start();
}
Animator.java 文件源码 项目:TreebolicLib 阅读 39 收藏 0 点赞 0 评论 0
@Override
public boolean run(final ActionListener thisListener, final int theseSteps, final int startDelay)
{
    // Log.d(Animator.TAG, "animate steps " + theseSteps);
    this.theLastStep = theseSteps - 1;
    this.theListener = thisListener;
    this.theAnimator = ValueAnimator.ofInt(0, this.theLastStep);
    this.theAnimator.setRepeatCount(0);
    this.theAnimator.setDuration(1000);
    this.theAnimator.setStartDelay(startDelay);
    this.theAnimator.setInterpolator(new LinearInterpolator());
    this.theAnimator.addUpdateListener(this);
    this.theAnimator.addListener(this);
    this.theAnimator.start();
    return true;
}
VideoPlayActivity.java 文件源码 项目:boohee_v5.6 阅读 39 收藏 0 点赞 0 评论 0
private void updateProgress() {
    if (this.progressAnimator != null && this.progressAnimator.isRunning()) {
        this.progressAnimator.end();
    }
    double progress = (double) (((this.mentionIndex * 1000) + ((this.playCountNum * 1000) /
            this.currentMention.number)) / this.totalMetionCount);
    this.progressAnimator = ObjectAnimator.ofInt(this.progressBar, "progress", new int[]{
            (int) progress});
    if (this.currentMention.is_times) {
        this.progressAnimator.setDuration(((long) this.currentMention.rate) * 1000);
    } else {
        this.progressAnimator.setDuration(1000);
    }
    this.progressAnimator.setInterpolator(new LinearInterpolator());
    this.progressAnimator.start();
}
MainActivity.java 文件源码 项目:secretknock 阅读 32 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);

    sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);
    editor = sharedPreferences.edit();

    an = new RotateAnimation(0.0f,
            360.0f,Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF,
            0.5f);

    // Set the animation's parameters
    an.setInterpolator(new LinearInterpolator());
    an.setDuration(7000);               // duration in ms
    an.setRepeatCount(-1);                // -1 = infinite repeated
}
AlbumSurfaceView.java 文件源码 项目:Musicoco 阅读 41 收藏 0 点赞 0 评论 0
@Override
public void run() {

    rotateAnim = ObjectAnimator.ofInt(0, 360);
    rotateAnim.setInterpolator(new LinearInterpolator());
    rotateAnim.setRepeatCount(ValueAnimator.INFINITE);
    rotateAnim.setRepeatMode(ValueAnimator.RESTART);
    rotateAnim.setDuration(40000);
    rotateAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            rotateAngle = (int) animation.getAnimatedValue();
            repaint();
        }
    });

    Looper.prepare();
    mLooper = Looper.myLooper();
    handler = new DrawHandler(Looper.myLooper());
    repaint();
    Looper.loop();
}
LoveLikeLayout.java 文件源码 项目:BilibiliClient 阅读 35 收藏 0 点赞 0 评论 0
/**
 * 爱心的显示动画实现
 */
private AnimatorSet getEnterAnimtorSet(View target) {
  //爱心的3中动画组合 透明度 x,y轴的缩放
  ObjectAnimator alpha = ObjectAnimator.ofFloat(target, View.ALPHA, 0.2f, 1f);
  ObjectAnimator scaleX = ObjectAnimator.ofFloat(target, View.SCALE_X, 0.2f, 1f);
  ObjectAnimator scaleY = ObjectAnimator.ofFloat(target, View.SCALE_Y, 0.2f, 1f);

  //组合动画
  AnimatorSet set = new AnimatorSet();
  set.setDuration(500);
  set.setInterpolator(new LinearInterpolator());
  set.playTogether(alpha, scaleX, scaleY);
  set.setTarget(target);

  return set;
}
DefaultRefreshIndicator.java 文件源码 项目:RefreshLoadLayout 阅读 34 收藏 0 点赞 0 评论 0
private void initAnimation() {
    LinearInterpolator linearInterpolator=new LinearInterpolator();
    flipUpAnimation =new RotateAnimation(0,-180,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
    flipUpAnimation.setDuration(FLIP_DURATION);
    flipUpAnimation.setFillAfter(true);
    flipUpAnimation.setInterpolator(linearInterpolator);

    flipDownAnimation=new RotateAnimation(-180,0,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
    flipDownAnimation.setDuration(FLIP_DURATION);
    flipDownAnimation.setFillAfter(true);
    flipDownAnimation.setInterpolator(linearInterpolator);

    infiniteRotation=new RotateAnimation(0,360,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
    infiniteRotation.setDuration(ROTATE_DURATION);
    infiniteRotation.setRepeatCount(Animation.INFINITE);
    infiniteRotation.setInterpolator(linearInterpolator);
}
ReadEPubActivity.java 文件源码 项目:TextReader 阅读 38 收藏 0 点赞 0 评论 0
private void toolbarAnimateHide() {
    if (mIsActionBarVisible) {
        mCommonToolbar.animate()
                .translationY(-mCommonToolbar.getHeight())
                .setInterpolator(new LinearInterpolator())
                .setDuration(180)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        toolbarSetElevation(0);
                        hideStatusBar();
                        if (mTocListPopupWindow != null && mTocListPopupWindow.isShowing()) {
                            mTocListPopupWindow.dismiss();
                        }
                    }
                });
        mIsActionBarVisible = false;
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号