<?xml version="1.0" encoding="utf-8" ?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@anim/interpolator_resource" android:shareInterpolator="true|false"> <alpha android:fromAlpha="float"<!-- 透明度起始值--> android:toAlpha="float"/><!-- 透明度结束值--> <scale android:fromXScale="float"<!--水平方向缩放起始值 --> android:toXScale="float"<!--水平方向缩放结束值 --> android:fromYScale="float"<!--垂直方向缩放起始值 --> android:toYScale="float"<!--垂直方向缩放结束值 --> android:pivotX="float"<!--缩放轴点x坐标 --> android:pivotY="float"/><!--缩放轴点y坐标 --> <translate android:fromXDelta="float"<!--x的起始位置--> android:fromYDelta="float"<!--y的起始位置--> android:toXDelta="float"<!--x的结束位置--> android:toYDelta="float"/><!--y的结束位置--> <rotate android:fromDegrees="float"<!--起始角度 --> android:toDegrees="float"<!-- 结束角度--> android:pivotX="float"<!-- 旋转轴点x坐标 --> android:pivotY="float"/><!-- 旋转轴点y坐标--> <set> ... </set> </set>
Animation animation = AnimationUtils.loadAnimation(this, R.anim.view1); button.startAnimation(animation);
<?xml version="1.0" encoding="utf-8" ?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true|false"> <item android:drawable="@mipmap/ic_launcher" android:duration="500"/> <item android:drawable="@mipmap/ic_launcher" android:duration="500"/> <item android:drawable="@mipmap/ic_launcher" android:duration="500"/> </animation-list>
button.setBackgroundResource(R.drawable.view2); AnimationDrawable drawable=(AnimationDrawable)button.getBackground(); drawable.start();
<?xml version="1.0" encoding="utf-8" ?> <layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android" android:delay="0.5" android:animationOrder="normal" android:animation="@anim/anim_item"/>
<?xml version="1.0" encoding="utf-8" ?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="300" android:interpolator="@android:anim/accelerate_interpolator" android:shareInterpolator="true"> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" /> <translate android:fromXDelta="500" android:toYDelta="0" /> </set>
android:layoutAnimation="@anim/anim_layout"
Animation animation = AnimationUtils.loadAnimation(this, R.anim.anim_item); LayoutAnimationController controller=new LayoutAnimationController(animation); controller.setDelay(0.5f); controller.setOrder(LayoutAnimationController.ORDER_NORMAL); linearlayout.setLayoutAnimation(controller);
Intent intent =new Intent(this,TestActivity.class); startActivity(intent); overridePendingTransition(R.anim.enter_anim,R.anim.exit_anim);
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.enter_anim,R.anim.exit_anim);
}
ValueAnimator colorAnim=ObjectAnimator.ofInt(this,"backgroundColor",0xFFFF8080,0xFF8080FF); colorAnim.setDuration(3000); colorAnim.setEvaluator(new ArgbEvaluator()); colorAnim.setRepeatCount(ValueAnimator.INFINITE); colorAnim.setRepeatMode(ValueAnimator.REVERSE); colorAnim.start();
<?xml version="1.0" encoding="utf-8" ?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:ordering="sequentially|together"><!--together:子动画同时播放。sequentially:自动化按照先后顺序依次播放--> <objectAnimator android:duration="int"<!--动画时长--> android:propertyName="string"<!--属性名称--> android:repeatCount="int"<!--重复次数--> android:repeatMode="restart|reverse"<!--重复模式--> android:startOffset="int"<!--延迟时间--> android:valueFrom="float|int|color"<!--属性起始值--> android:valueTo="float|int|color"<!--属性结束值--> android:valueType="colorType|intType|floatType|pathType" /><!--属性类型--> <animator android:duration="int" android:repeatCount="int" android:repeatMode="restart|reverse" android:startOffset="int" android:valueFrom="float|int|color" android:valueTo="float|int|color" android:valueType="colorType|intType|floatType|pathType" /> </set>
AnimatorSet set=(AnimatorSet) AnimatorInflater.loadAnimator(context,R.anim.property_animator); set.setTarget(button); set.start();
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有