安卓动画note
来源:互联网 发布:php的resource类型 编辑:程序博客网 时间:2024/06/06 05:48
package com.example.qq_lite;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.support.annotation.Nullable;import android.view.animation.AlphaAnimation;import android.view.animation.Animation;import android.view.animation.AnimationSet;import android.view.animation.ScaleAnimation;import android.view.animation.TranslateAnimation;import android.widget.ImageView;import android.widget.TextView;/** * Created by linpiaohsin on 2017/11/17. */public class AnimationActivity extends Activity { TextView textView; ImageView imageView1; ImageView imageView2; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.animation_layout); textView=findViewById(R.id.text_animation); imageView1=findViewById(R.id.imageView1); imageView2=findViewById(R.id.imageView2); animationLeft(); animationRight(); animationText(); } public void animationLeft(){ AnimationSet animationSet=new AnimationSet(true); TranslateAnimation translateAnimation=new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF, -1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f); translateAnimation.setDuration(3*1000); translateAnimation.setStartOffset(8*100); translateAnimation.setFillAfter(true); animationSet.addAnimation(translateAnimation); imageView1.startAnimation(animationSet); } public void animationRight(){ AnimationSet animationSet=new AnimationSet(true); TranslateAnimation translateAnimation=new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF, +1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f); translateAnimation.setDuration(3*1000); translateAnimation.setStartOffset(8*100); translateAnimation.setFillAfter(true); animationSet.addAnimation(translateAnimation); imageView2.startAnimation(animationSet); } public void animationText(){ AnimationSet animationSet=new AnimationSet(true); ScaleAnimation scaleAnimation=new ScaleAnimation(1f,3f,1f,3f,Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF,0.5f); scaleAnimation.setDuration(1*1000); AlphaAnimation alphaAnimation=new AlphaAnimation(1,0.00001f); alphaAnimation.setDuration(2*1000); animationSet.addAnimation(scaleAnimation); animationSet.addAnimation(alphaAnimation); animationSet.setFillAfter(true); textView.startAnimation(animationSet); new Handler().postDelayed(new Runnable() { @Override public void run() { startActivity(new Intent(AnimationActivity.this,TableListActivity.class)); } },3500); }}
阅读全文
1 0
- 安卓动画note
- 安卓版本note
- 安卓 动画帧动画基础动画
- 安卓开发-动画
- 安卓动画总结
- 安卓 动画效果
- 引导动画-安卓
- 安卓 动画效果
- 安卓属性动画
- 安卓齿轮动画
- 安卓-属性动画
- 安卓属性动画
- 安卓动画
- 安卓动画学习
- 安卓动画技术
- 安卓中的动画
- 安卓动画
- 安卓动画小结
- HierarchyViewer报Unable to get view server protocol的原因以及解决方法
- Java作业-窗体点击事件
- 堆
- 从csdn去到简书
- 《算法4》有向图与DAG与Kosaraju算法
- 安卓动画note
- 深入分析ConcurrentHashMap
- 矩阵微分基础知识
- c: scanf 与 getchar
- DTS认证测试
- 5
- 二叉树的镜像
- CMS垃圾收集器执行过程
- Jetson TX1 安装Caffe教程