Search in sources :

Example 61 with RotateAnimation

use of android.view.animation.RotateAnimation in project smartmodule by carozhu.

the class AnimationController method scaleRotateOut.

public void scaleRotateOut(View view, long durationMillis, long delayMillis) {
    ScaleAnimation animation1 = new ScaleAnimation(1, 0, 1, 0, rela1, 0.5f, rela1, 0.5f);
    RotateAnimation animation2 = new RotateAnimation(0, 360, rela1, 0.5f, rela1, 0.5f);
    AnimationSet animation = new AnimationSet(false);
    animation.addAnimation(animation1);
    animation.addAnimation(animation2);
    baseOut(view, animation, durationMillis, delayMillis);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 62 with RotateAnimation

use of android.view.animation.RotateAnimation in project smartmodule by carozhu.

the class AnimationController method scaleRotateIn.

public void scaleRotateIn(View view, long durationMillis, long delayMillis) {
    ScaleAnimation animation1 = new ScaleAnimation(0, 1, 0, 1, rela1, 0.5f, rela1, 0.5f);
    RotateAnimation animation2 = new RotateAnimation(0, 360, rela1, 0.5f, rela1, 0.5f);
    AnimationSet animation = new AnimationSet(false);
    animation.addAnimation(animation1);
    animation.addAnimation(animation2);
    baseIn(view, animation, durationMillis, delayMillis);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 63 with RotateAnimation

use of android.view.animation.RotateAnimation in project JustAndroid by chinaltz.

the class AbListViewHeader method initView.

/**
	 * 初始化View.
	 */
private void initView() {
    //顶部刷新栏整体内容
    headerView = new LinearLayout(context);
    headerView.setOrientation(LinearLayout.HORIZONTAL);
    headerView.setGravity(Gravity.CENTER);
    AbViewUtil.setPadding(headerView, 0, 10, 0, 10);
    //显示箭头与进度
    FrameLayout headImage = new FrameLayout(context);
    arrowImageView = new ImageView(context);
    //箭头图片
    arrowImageView.setImageResource(R.drawable.arrow);
    //style="?android:attr/progressBarStyleSmall" 默认的样式
    headerProgressBar = new ProgressBar(context, null, android.R.attr.progressBarStyle);
    headerProgressBar.setVisibility(View.GONE);
    LayoutParams layoutParamsWW = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    layoutParamsWW.gravity = Gravity.CENTER;
    layoutParamsWW.width = AbViewUtil.scaleValue(context, 50);
    layoutParamsWW.height = AbViewUtil.scaleValue(context, 50);
    headImage.addView(arrowImageView, layoutParamsWW);
    headImage.addView(headerProgressBar, layoutParamsWW);
    //顶部刷新栏文本内容
    LinearLayout headTextLayout = new LinearLayout(context);
    tipsTextview = new TextView(context);
    headerTimeView = new TextView(context);
    headTextLayout.setOrientation(LinearLayout.VERTICAL);
    headTextLayout.setGravity(Gravity.CENTER_VERTICAL);
    AbViewUtil.setPadding(headTextLayout, 0, 0, 0, 0);
    LayoutParams layoutParamsWW2 = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    headTextLayout.addView(tipsTextview, layoutParamsWW2);
    headTextLayout.addView(headerTimeView, layoutParamsWW2);
    tipsTextview.setTextColor(Color.rgb(107, 107, 107));
    headerTimeView.setTextColor(Color.rgb(107, 107, 107));
    AbViewUtil.setTextSize(tipsTextview, 30);
    AbViewUtil.setTextSize(headerTimeView, 27);
    LayoutParams layoutParamsWW3 = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    layoutParamsWW3.gravity = Gravity.CENTER;
    layoutParamsWW3.rightMargin = AbViewUtil.scaleValue(context, 10);
    LinearLayout headerLayout = new LinearLayout(context);
    headerLayout.setOrientation(LinearLayout.HORIZONTAL);
    headerLayout.setGravity(Gravity.CENTER);
    headerLayout.addView(headImage, layoutParamsWW3);
    headerLayout.addView(headTextLayout, layoutParamsWW3);
    LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
    lp.gravity = Gravity.BOTTOM;
    //添加大布局
    headerView.addView(headerLayout, lp);
    this.addView(headerView, lp);
    //获取View的高度
    AbViewUtil.measureView(this);
    headerHeight = this.getMeasuredHeight();
    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);
    setState(STATE_NORMAL);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout)

Aggregations

RotateAnimation (android.view.animation.RotateAnimation)63 LinearInterpolator (android.view.animation.LinearInterpolator)24 Animation (android.view.animation.Animation)15 AnimationSet (android.view.animation.AnimationSet)14 ScaleAnimation (android.view.animation.ScaleAnimation)12 AlphaAnimation (android.view.animation.AlphaAnimation)10 View (android.view.View)8 TranslateAnimation (android.view.animation.TranslateAnimation)6 ImageView (android.widget.ImageView)6 TextView (android.widget.TextView)5 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)4 LinearLayout (android.widget.LinearLayout)4 Paint (android.graphics.Paint)3 LayoutInflater (android.view.LayoutInflater)3 SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)3 Context (android.content.Context)2 Intent (android.content.Intent)2 AbsListView (android.widget.AbsListView)2 ListView (android.widget.ListView)2 IOException (java.io.IOException)2