微信开门动画的实现
来源:互联网 发布:js compare函数 编辑:程序博客网 时间:2024/04/19 22:34
当前很多应用首次安装启动后会出现门一样的动画,下面我们就看看他的实现
其主要实现是动画的实现
/**导航过后的动画效果界面*/public class WhatsnewAnimationA extends Activity {private ImageView img_left, img_right;@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.whatnew_animation);img_left = (ImageView) findViewById(R.id.doorpage_left);img_right = (ImageView) findViewById(R.id.doorpage_right);//创建一个AnimationSet对象AnimationSet animLeft = new AnimationSet(true);TranslateAnimation transLeft = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,-1f, Animation.RELATIVE_TO_SELF, 0f,Animation.RELATIVE_TO_SELF, 0f);//设置动画效果持续的时间transLeft.setDuration(2000);//将anim对象添加到AnimationSet对象中animLeft.addAnimation(transLeft);animLeft.setFillAfter(true);img_left.startAnimation(transLeft);transLeft.startNow();//创建一个AnimationSet对象AnimationSet animRight = new AnimationSet(true);TranslateAnimation transRight = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,1f, Animation.RELATIVE_TO_SELF, 0f,Animation.RELATIVE_TO_SELF, 0f);//设置动画效果持续的时间transRight.setDuration(2000);//将anim对象添加到AnimationSet对象中animRight.addAnimation(transRight);animRight.setFillAfter(true);img_right.startAnimation(transRight);transRight.startNow();new Handler().postDelayed(new Runnable() {@Overridepublic void run() {// TODO Auto-generated method stubIntent intent = new Intent(WhatsnewAnimationA.this, FirstPageA.class);startActivity(intent);WhatsnewAnimationA.this.finish();}}, 1000);}}
开门activity的whatnew_animation.xml
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/doorpage_left" android:scaleType="fitXY" android:layout_width="fill_parent" android:layout_height="fill_parent"android:src="@drawable/doorpage_left"/> <ImageView android:id="@+id/doorpage_right" android:scaleType="fitXY" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/doorpage_right"/> </RelativeLayout>
0 0
- 微信开门动画的实现
- android 实现微信的开门效果
- android实现类似微信的开门效果
- 类似开门的动画-iOS
- 微信开场欢迎动画的实现
- android-微信引导图类似开门的效果
- 开机动画开门效果实现中遇到的隐式动画问题
- 43_实现开门动画效果
- 开门动画
- Android实现微信录制小视频的计时动画
- 学习COCOS2D-x 精灵动画 实现一个《热血传奇》开门效果
- 单侧开门动画
- android开门动画效果
- 使用ViewDragHelper实现的DragLayout开门效果
- Android高效率实现弹出带动画效果的对话框,仿照微信对话框效果
- 简单的实现微信领取红包界面,按钮旋转动画效果。
- Android仿打开微信红包动画效果实现
- Android使用动画实现微信扫描线效果
- Cocos2d-x 2.2.3 使用NDK配置编译环境
- 了解Breeze (一)
- [leetcode] Sum Root to Leaf Numbers
- JAVA连接oracle数据库
- [深度优先遍历—栈实现]求图中两点是否连通
- 微信开门动画的实现
- 为什么网络银行不支持GNU/Linux操作系统下的浏览器操作
- tomcat内存溢出的解决方法 在tocmat的catalian.bat文件中加入如下代码
- Android TabHost设置不加载第一个tab
- linux守护进程及系统启动项
- 硬盘文件丢失怎么进行数据恢复
- leetcode 74 Subsets
- Effective Java读书笔记(第5章-泛型)
- REG QUERY命令参数(注册表)