补间动画+跳转
来源:互联网 发布:淘宝子账号客服权重值 编辑:程序博客网 时间:2024/06/06 04:01
MainActivity
public class MainActivity extends Activity {private Button button; private boolean flag = true; private ImageView iv; private Handler handler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Animation rotate = AnimationUtils.loadAnimation(this, R.anim.anim_alpha); button = findViewById(R.id.button); iv = findViewById(R.id.image); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) {if (flag){ iv.startAnimation(rotate);} handler=new Handler() ; new Thread(new Runnable() { @Override public void run() { SystemClock.sleep(2000); handler.post(new Runnable() { @Override public void run() { Intent intent = new Intent(MainActivity.this, Activity_MU.class); startActivity(intent); finish(); } }); } }).start(); } }); }}
anim
<set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true" android:fillBefore="true"><alpha android:duration="2000" android:fromAlpha="1" android:repeatCount="1" android:repeatMode="reverse" android:toAlpha="0"/> <rotate android:duration="2000" android:fromDegrees="0" android:interpolator="@android:anim/accelerate_interpolator" android:pivotX="50%" android:pivotY="50%" android:toDegrees="720" > </rotate> <rotate android:duration="2000" android:fromDegrees="360" android:interpolator="@android:anim/accelerate_interpolator" android:pivotX="50%" android:pivotY="50%" android:startOffset="2000" android:toDegrees="0" > </rotate> <scale android:fromXScale="1" android:interpolator="@android:anim/decelerate_interpolator" android:fromYScale="1" android:toXScale="2.0" android:toYScale="2.0" android:pivotX="50%" android:pivotY="50%" android:fillAfter="true" android:repeatCount="1" android:repeatMode="reverse" android:duration="2000" /> <translate android:fromXDelta="0" android:toXDelta="860" android:fromYDelta="0" android:toYDelta="0" android:fillAfter="true" android:repeatMode="reverse" android:repeatCount="1" android:duration="2000"> </translate></set>布局
<LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button" android:text="补间动画" /><ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/image" android:background="@mipmap/ic_launcher_round"/></LinearLayout>
阅读全文
0 0
- 补间动画+跳转
- 补间动画实现Activity的动画跳转
- Android开发 之 activity跳转动画(补间动画跳转)
- 动画----补间动画
- Android动画系列一、补间,帧,Activity跳转,ListView条目动画
- Android动画效果——1.帧动画2.补间动画3.跳转画面(三)
- Android 动画-----补间动画
- 补间动画,属性动画
- 补间动画,帧动画
- 补间动画,帧动画
- Android动画--补间动画
- Android-补间动画
- 补间(Tween)动画
- 补间动画Tween
- Animation补间动画
- 补间(Tween)动画
- 补间动画
- 补间动画
- ElasticSearch学习
- RecylerView配合ChekBox实现单选,解决了因为复用导致单选框混乱现象
- 二级类表布局
- ImageLoader的基础使用
- 缺少api-ms-win-..-0.dll文件
- 补间动画+跳转
- 实现一个出栈,入栈,返回最小值的操作的时间复杂度为O(1)的栈
- 课程11 项目3
- mac vim 复制粘贴
- 从零开始学习VTK
- JQuery 图片轮换,图片幻灯片
- Golang中的信号处理
- Leetcode算法学习日志-257 Binary Tree Paths
- document.write用法与清空原来的内容原因