[Zhuantie] Android Activity beautiful custom jump effect

2011-05-31  来源:本站原创  分类:Mobile  人气:129 

Jump to customize Android Activity beautiful effect

Jump when the two Activity, custom mouse gestures:

Intent intent = new Intent (FirstActivity.this, SecondActivity.class);
startActivityForResult (intent, 11);

/ / Add interface switching effect, note that only Android's 2.0 (SdkVersion version 5) was later supported
int version = Integer.valueOf (android.os.Build.VERSION.SDK);
if (version> = 5) {
overridePendingTransition (R.anim.zoomin, R.anim.zoomout); / / This is a custom animation effects, the following two animations for the system
/ / OverridePendingTransition (android.R.anim.fade_in, android.R.anim.fade_out);
/ / OverridePendingTransition (android.R.anim.slide_in_left, android.R.anim.slide_out_right);
}

Intent intent = new Intent (FirstActivity.this, SecondActivity.class);
startActivityForResult (intent, 11);

/ / Add interface switching effect, note that only Android's 2.0 (SdkVersion version 5) was later supported
int version = Integer.valueOf (android.os.Build.VERSION.SDK);
if (version> = 5) {
overridePendingTransition (R.anim.zoomin, R.anim.zoomout); / / This is a custom animation effects, the following two animations for the system
/ / OverridePendingTransition (android.R.anim.fade_in, android.R.anim.fade_out);
/ / OverridePendingTransition (android.R.anim.slide_in_left, android.R.anim.slide_out_right);
}

Here are two custom animation XML files, store location is: res / anim /

1, the animation into effect: zoomin.xml

<? 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: fromXScale = "2.0" android: toXScale = "1.0"
android: fromYScale = "2.0" android: toYScale = "1.0"
android: pivotX = "50% p" android: pivotY = "50% p"
android: duration = "@ android: integer / config_mediumAnimTime" />
</ Set>

<? 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: fromXScale = "2.0" android: toXScale = "1.0"
android: fromYScale = "2.0" android: toYScale = "1.0"
android: pivotX = "50% p" android: pivotY = "50% p"
android: duration = "@ android: integer / config_mediumAnimTime" />
</ Set>

2, exit animation effects: zoomout.xml

<? 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">
<Scale android: fromXScale = "1.0" android: toXScale = ".5"
android: fromYScale = "1.0" android: toYScale = ".5"
android: pivotX = "50% p" android: pivotY = "50% p"
android: duration = "@ android: integer / config_mediumAnimTime" />
<Alpha android: fromAlpha = "1.0" android: toAlpha = "0"
android: duration = "@ android: integer / config_mediumAnimTime" />
</ Set>

Transfer from: http://hi.baidu.com/hbzha/blog/item/eeb42afd30726beafd037f18.html

相关文章
  • [Zhuantie] Android Activity beautiful custom jump effect 2011-05-31

    Jump to customize Android Activity beautiful effect Jump when the two Activity, custom mouse gestures: Intent intent = new Intent (FirstActivity.this, SecondActivity.class); startActivityForResult (intent, 11); / / Add interface switching effect, not

  • Android Activity of the jump and transfer value 2010-09-03

    Activity jumps and mass values, mainly through the Intent class to connect multiple Activity, and transfer data. Intent is a very important class of Android. Intent literal translation is "intent" and what is intended to do? Such as the Activity

  • android activity in the Jump to page 2010-08-19

    Intent it = new Intent (Intent.ACTION_VIEW); it.setData (Uri.parse (" http://www.pingan.com/ ")); / / need to turn around the inside of the rul it = Intent.createChooser (it, null); startActivity (it);

  • Custom Activity nice jump effect 2010-11-16

    Jump when the two Activity, custom mouse gestures: Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivityForResult(intent, 11); // Add interface transitions, note Android By 2.0(SdkVersion The version number is 5) Later v

  • Android Activity type application skills sharing 2010-05-27

    Android Activity class in the Android operating system, applications are often important. So how can the right to operate in the application of this work? In an application, each display screen is a Activity. So learning Android, must have some under

  • Android Activity interface switch to add animation effects (transfer) 2010-11-02

    After the Android 2.0 has overridePendingTransition (), of which there are two parameters, one is the withdrawal of the previous activity twenty-one entry activity, @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInsta

  • Used in the Android Activity, Service, Broadcast, BroadcastReceiver 2010-12-06

    Describes the use of the Android Activity, Service, Broadcast, BroadcastReceiver Activities (Activity) - for the performance of functional services (Service) - the equivalent of running in the background Activity Radio (Broadcast) - used to send broa

  • Android change the custom title bar layout TitleBar 2011-01-11

    Android Activity program default title bar can only display a text, but can not change its layout, color, title bar height. If you want to add icons in the title bar, button, input boxes, progress bars, title bar color changes can only use a custom t

  • Android Activity interface switch to add animation effects (reproduced) 2011-06-01

    "Disclaimer: This article is reproduced only come, not yet read" After the Android 2.0 has overridePendingTransition (), of which there are two parameters, one is the withdrawal of the previous activity twenty-one entry activity, @ Override publ

  • Fourth Lecture - Android Activity of the preliminary 2010-06-18

    Fourth Lecture - Android Activity of the initial

  • Fourth Lecture - Android Activity of the initial 2010-06-18

    Fourth Lecture - Android Activity of the initial

  • Android android activity set in full screen and get the screen width and height 2010-08-23

    android activity set in full screen requestWindowFeature (Window.FEATURE_NO_TITLE); Android get screen width and height int screenWidth; int screenHeight; WindowManager windowManager = getWindowManager (); Display display = windowManager.getDefaultDi

  • Android Activity Introduction to Life Cycle 2010-10-22

    Android activity of the life cycle activity class in the android.app package, inheritance system is as follows: 1.java.lang.Object 2.android.content.Context 3.android.app.ApplicationContext 4.android.app.Activity activity alone, for processing user.

  • Android: Activity. Process. BoradcastReceiver life cycle 2010-12-24

    Android Activity and processes in the life cycle is a very important issue. Android have taken the process like garbage collection mechanism, which means that even if the user quit the program, the process may still exist in the system. This will dir

  • Android Activity之间传递图片(Bitmap)的方法 2014-10-06

    这篇文章介绍了Android Activity之间传递图片(Bitmap)的方法,有需要的朋友可以参考一下 在Android开发中:Activity之间传递参数是常见的事:如果我们要在Activity之间传递图片: 1.MainActivity中包括一个ImageView:当我们点击ImageView时:把图片传递给另外一个Activity MainActivity的主要代码: Intent intent=new Intent(MainActivity.this,TranActivity.cla

  • Android Activity切换(跳转)时出现黑屏的解决方法 分享 2015-01-04

    Android Activity切换(跳转)时出现黑屏的解决方法 分享,需要的朋友可以参考一下 在两个Activity跳转时,由于第二个Activity在启动时加载了较多数据,就会在启动之前出现一个短暂的黑屏时间,解决这个问题比较简单的处理方法是将第二个Activity的主题设置成透明的,这样在启动第二个Activity时的黑屏就变成了显示第一个Activity界面.这个分两步完成: 第一步:xxx/res/values/styles.xml中加入自定义Activity的Theme,如下所示:

  • Android Activity 调用startActivityForResult之后被销毁? 2014-09-28

    Android Activity 调用startActivityForResult之后调用的Activity被销毁的问题 最近在华为的手机上面发现Activity调用startActivityForResult后返回结果时,调用的Activity都会被重新创建,也就是Activity被销毁了. 在网上经过一番查找,发现有哥们说在手机开发人员选项里面有这么一项"不保留活动"被勾上了, 一看还真是. 把那个勾去掉一切又恢复正常了.

  • Android必备:Android Activity的生命周期 2014-11-28

    链接地址:http://www.xx566.com/detail/124.html 在Android应用程序组成中, 我们了解到了Android组件Activity的重要性,它是Android应用的表示层,负责应用的UI展现,直接与用户进行交互,与Servlet 类似,Activity也有自己的生命周期,接下来,我们就来简单觉得了解一下Android Activity的生命周期. 关于Android Activity生命周期,网上有许多经典的介绍,不过大神写的永远是大神的,只有自己详尽的理解和总

  • Android Activity / Service Intent communication Jump 2010-03-29

    The first approach, using action to jump. 1, using Action jump, if there is a program AndroidManifest.xml an Activity in a defined segment of IntentFilter that contains the same Action then this Intent with this goal Action matches. If this IntentFil

  • Android Activity pass between the custom class objects 2010-09-01

    A lot of time needs to pass data between different Activity. There are many ways to achieve, you can use the Bundle to pass, can also be used to pass additional parameters Intent with putExtra. Of course, you can pass a custom class object. To make a