Search in sources :

Example 11 with RotateAnimation

use of android.view.animation.RotateAnimation in project vlc-android by videolan.

the class VideoPlayerActivity method startLoading.

/**
 * Start the video loading animation.
 */
private void startLoading() {
    if (mIsLoading)
        return;
    mIsLoading = true;
    final AnimationSet anim = new AnimationSet(true);
    final RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(800);
    rotate.setInterpolator(new DecelerateInterpolator());
    rotate.setRepeatCount(RotateAnimation.INFINITE);
    anim.addAnimation(rotate);
    mLoading.setVisibility(View.VISIBLE);
    mLoading.startAnimation(anim);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet)

Example 12 with RotateAnimation

use of android.view.animation.RotateAnimation in project BaseProject by feer921.

the class XListViewHeader method initView.

private void initView(Context context) {
    // 初始情况,设置下拉刷新view高度为0
    LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, 0);
    mContainer = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.xlistview_header, null);
    addView(mContainer, lp);
    setGravity(Gravity.BOTTOM);
    mArrowImageView = (ImageView) findViewById(R.id.xlistview_header_arrow);
    mHintTextView = (TextView) findViewById(R.id.xlistview_header_hint_textview);
    mProgressBar = (ProgressBar) findViewById(R.id.xlistview_header_progressbar);
    mRotateUpAnim = new RotateAnimation(0.0f, -180.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Example 13 with RotateAnimation

use of android.view.animation.RotateAnimation in project AndroidStudy by tinggengyan.

the class RefreshableView method rotateArrow.

/**
 * 根据当前的状态来旋转箭头。
 */
private void rotateArrow() {
    float pivotX = arrow.getWidth() / 2f;
    float pivotY = arrow.getHeight() / 2f;
    float fromDegrees = 0f;
    float toDegrees = 0f;
    if (currentStatus == STATUS_PULL_TO_REFRESH) {
        fromDegrees = 180f;
        toDegrees = 360f;
    } else if (currentStatus == STATUS_RELEASE_TO_REFRESH) {
        fromDegrees = 0f;
        toDegrees = 180f;
    }
    RotateAnimation animation = new RotateAnimation(fromDegrees, toDegrees, pivotX, pivotY);
    animation.setDuration(100);
    animation.setFillAfter(true);
    arrow.startAnimation(animation);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Example 14 with RotateAnimation

use of android.view.animation.RotateAnimation in project AndroidStudy by tinggengyan.

the class XFooterView method initView.

private void initView(Context context) {
    mLayout = LayoutInflater.from(context).inflate(R.layout.vw_footer, null);
    mLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    addView(mLayout);
    mProgressBar = mLayout.findViewById(R.id.footer_progressbar);
    mHintView = (TextView) mLayout.findViewById(R.id.footer_hint_text);
    // mHintImage = (ImageView) mLayout.findViewById(R.id.footer_arrow);
    mRotateUpAnim = new RotateAnimation(0.0f, 180.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(180.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Example 15 with RotateAnimation

use of android.view.animation.RotateAnimation in project AndroidStudy by tinggengyan.

the class XHeaderView method initView.

private void initView(Context context) {
    // Initial set header view height 0
    LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, 0);
    mContainer = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.vw_header, null);
    addView(mContainer, lp);
    setGravity(Gravity.BOTTOM);
    mArrowImageView = (ImageView) findViewById(R.id.header_arrow);
    mHintTextView = (TextView) findViewById(R.id.header_hint_text);
    mProgressBar = (ProgressBar) findViewById(R.id.header_progressbar);
    mRotateUpAnim = new RotateAnimation(0.0f, -180.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Aggregations

RotateAnimation (android.view.animation.RotateAnimation)111 LinearInterpolator (android.view.animation.LinearInterpolator)38 Animation (android.view.animation.Animation)27 AnimationSet (android.view.animation.AnimationSet)24 ScaleAnimation (android.view.animation.ScaleAnimation)17 ImageView (android.widget.ImageView)15 View (android.view.View)14 TextView (android.widget.TextView)14 AlphaAnimation (android.view.animation.AlphaAnimation)13 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)12 TranslateAnimation (android.view.animation.TranslateAnimation)9 Context (android.content.Context)5 LinearLayout (android.widget.LinearLayout)5 Intent (android.content.Intent)4 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)4 IOException (java.io.IOException)4 Paint (android.graphics.Paint)3 Drawable (android.graphics.drawable.Drawable)3 RecyclerView (android.support.v7.widget.RecyclerView)3 AttributeSet (android.util.AttributeSet)3