首页 > 代码库 > Activity 页面切换的效果
Activity 页面切换的效果
package com.example.androidui; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new Handler().postDelayed(new Runnable() { @Override public void run() { Intent mainIntent = new Intent(MainActivity.this, OtherActivity.class); MainActivity.this.startActivity(mainIntent); MainActivity.this.finish(); overridePendingTransition(R.anim.myenteranim, R.anim.myexitanim); } }, 3000); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } }
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/decelerate_interpolator" > <!-- 渐变尺寸伸缩动画效果 --> <scale android:duration="@android:integer/config_mediumAnimTime" android:fromXScale="2.0" android:fromYScale="2.0" android:pivotX="50%p" android:pivotY="50%p" android:toXScale="1.0" android:toYScale="1.0" /> </set>
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/decelerate_interpolator" android:zAdjustment="top" > <alpha android:duration="@android:integer/config_mediumAnimTime" android:fromAlpha="1.0" android:toAlpha="0" /> <scale android:duration="@android:integer/config_mediumAnimTime" android:fromXScale="1.0" android:fromYScale="1.0" android:pivotX="50%p" android:pivotY="50%p" android:toXScale=".5" android:toYScale=".5" /> </set>
all code:https://github.com/moziqi/androidUI 分支v1.0
Activity 页面切换的效果
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。