Java Code Examples for android.view.animation.RotateAnimation#startNow()

The following examples show how to use android.view.animation.RotateAnimation#startNow() . 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: GankHomeFragment.java    From CloudReader with Apache License 2.0 5 votes vote down vote up
private void initAnimation() {
    bindingView.llLoading.setVisibility(View.VISIBLE);
    animation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(3000);//设置动画持续时间
    animation.setInterpolator(new LinearInterpolator());//不停顿
    animation.setRepeatMode(ValueAnimator.RESTART);//重新从头执行
    animation.setRepeatCount(ValueAnimator.INFINITE);//设置重复次数
    bindingView.ivLoading.setAnimation(animation);
    animation.startNow();
}
 
Example 2
Source File: EverydayFragment.java    From CloudReader with Apache License 2.0 5 votes vote down vote up
private void initAnimation() {
    bindingView.llLoading.setVisibility(View.VISIBLE);
    animation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(3000);//设置动画持续时间
    animation.setInterpolator(new LinearInterpolator());//不停顿
    animation.setRepeatMode(ValueAnimator.RESTART);//重新从头执行
    animation.setRepeatCount(ValueAnimator.INFINITE);//设置重复次数
    bindingView.ivLoading.setAnimation(animation);
    animation.startNow();
}