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);
}
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);
}
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);
}
Aggregations