`
isiqi
  • 浏览: 16745297 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

APIDEMO ACTIVITY 过场动画

阅读更多

public class Animation extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_animation);

// Watch for button clicks.
Button button = (Button)findViewById(R.id.fade_animation);
button.setOnClickListener(mFadeListener);
button = (Button)findViewById(R.id.zoom_animation);
button.setOnClickListener(mZoomListener);
}

private OnClickListener mFadeListener = new OnClickListener() {
public void onClick(View v) {
// Request the next activity transition (here starting a new one).
startActivity(new Intent(Animation.this, Controls1.class));
// Supply a custom animation. This one will just fade the new
// activity on top. Note that we need to also supply an animation
// (here just doing nothing for the same amount of time) for the
// old activity to prevent it from going away too soon.
overridePendingTransition(R.anim.fade, R.anim.hold);

API Level 5

Call immediately after one of the flavors of startActivity(Intent) or finish() to specify an explicit transition animation to perform next.

Parameters
enterAnim exitAnim
A resource ID of the animation resource to use for the incoming activity. Use 0 for no animation.
A resource ID of the animation resource to use for the outgoing activity. Use 0 for no animation.

}
};

private OnClickListener mZoomListener = new OnClickListener() {
public void onClick(View v) {
// Request the next activity transition (here starting a new one).
startActivity(new Intent(Animation.this, Controls1.class));
// This is a more complicated animation, involving transformations
// on both this (exit) and the new (enter) activity. Note how for
// the duration of the animation we force the exiting activity
// to be Z-ordered on top (even though it really isn't) to achieve
// the effect we want.
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
}
};
}

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_longAnimTime" />

<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>

<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>

分享到:
评论

相关推荐

    Google官方API(Android ApiDemo)

    ApiDemo展示了如何创建、启动、暂停、恢复和结束Activity,以及如何处理生命周期事件。 2. **Intent使用**:Intent是Android中用于启动其他组件(如Activity或Service)的通信桥梁。ApiDemo演示了如何创建和发送...

    android中文apidemo详解,适合新手阅读快速上手

    ApiDemo展示了如何在Activity之间切换以及如何添加各种类型的动画效果。 5. **自定义对话框(CustomDialog)**: Android允许开发者创建自定义的对话框以满足特定的UI需求。ApiDemo解释了如何扩展Dialog类,创建...

    android apidemo-17

    13. **动画**:包括视图动画、属性动画和帧动画,让开发者了解如何创建动态效果。 14. **权限管理**:展示如何在 AndroidManifest.xml 中声明和使用权限,以及如何处理权限请求。 15. **多线程与异步任务**:涵盖...

    android ApiDemo

    android ApiDemo android ApiDemo

    android Apidemo

    在动画特效方面,ApiDemo包含帧动画、属性动画和视图动画的实现,这些可以帮助开发者提升应用的用户体验。至于权限管理,随着Android权限模型的变化,ApiDemo也与时俱进,展示了如何在不同版本的Android系统上处理...

    android apidemo.apk

    android apidemo.apk

    Android官方apidemo

    ApiDemo项目按照功能模块进行划分,每个模块下都有对应的Activity和布局文件,以及相关的Java源码。例如,UI组件模块展示了ListView、GridView、Button等控件的使用,网络通信模块则包含HTTP请求、WebSocket通信等...

    Android ApiDemo

    ApiDemo涵盖了自定义View、动画效果、触摸事件处理等内容。 2. Layout:布局管理器,如LinearLayout、RelativeLayout等。ApiDemo展示了如何组合和设计复杂的布局。 3. Adapter:用于将数据绑定到视图,如ListView...

    学习Android Apidemo从这开始

    随着学习的深入,Apidemo会涉及更多高级API,如图形绘制、动画、网络通信、数据库操作、多媒体处理等。例如,我们可以学习如何使用Canvas和Bitmap进行自定义视图的绘制,或者使用ImageView显示图片。在动画部分,...

    Android1.5_ApiDemo

    在ApiDemo中,我们可以找到各种Activity的实例,如如何启动、切换和管理Activity,以及如何处理生命周期事件。 2. **Intent**:Intent是Android系统中实现组件间通信的核心机制。1.5版本的ApiDemo展示了Intent的...

    android 2.3 apidemo

    ApiDemo中展示了各种Activity的使用,如如何启动、切换和结束Activity。 - Intent用于在不同组件之间传递信息,包括启动Activity或Service。在ApiDemo中,你可以看到如何创建显式和隐式Intent。 2. **Layout和View...

    APIdemo源码

    - **动画**:Android 提供了多种动画类型,如属性动画、帧动画、补间动画等。API Demo 展示了如何创建和应用这些动画效果。 3. **数据存储** - **SharedPreferences**:用于轻量级的数据存储,常用于保存用户偏好...

    Android 5.0 ApiDemo+可运行源码项目

    1. **Material Design**: Android 5.0引入了全新的设计语言——Material Design,它强调层次感、响应式交互和动画效果。ApiDemo中会有相关例子展示如何创建遵循Material Design原则的UI组件。 2. **颜色主题**: ...

    android 示例源码 apidemo

    Apidemo 不仅包含基础功能,还涉及许多高级特性,如动画(Animation)、自定义视图(Custom Views)、多线程(Thread and Handler)、异步任务(AsyncTask)、Loader、碎片(Fragment)、通知(Notification)、权限管理...

    下载ApiDemo

    8. **动画与图形**:属性动画,帧动画,以及OpenGL ES的示例,展示2D和3D图形的绘制。 9. **多任务与后台服务**:IntentService,BroadcastReceiver,JobScheduler,以及Service的使用,这些都是实现后台运行任务的...

    ApiDemo:Android示例ApiDemo

    1. **Activity与Intent**:在ApiDemo中,你会看到如何创建和管理Activity,以及如何使用Intent进行Activity之间的通信。Intent是Android中用于启动服务或启动/传递信息到其他组件的主要手段。 2. **视图(View)和...

    Android的Apidemo 的代码分析

    这部分内容会详细解析Activity生命周期、界面跳转、状态保存与恢复、动画实现、自定义对话框、自定义标题、屏幕适配等方面的知识点。例如,在示例解析(3)中,通过Animation学习如何为应用添加交互动画,提升用户体验...

    Google官方API(Android-10 ApiDemo)

    在ApiDemo中,你可以找到关于视图动画(View Animation)和属性动画(Property Animation)的例子,这两种动画机制在Android 2.3.3中都有所体现。视图动画用于改变视图的位置、大小和透明度等,而属性动画则允许更...

    最新google官方ApiDemo源码

    1. **Material Design**:Android 4.4引入了Material Design设计语言,ApiDemo会展示如何使用新的UI组件和动画效果来提升应用的视觉和交互体验。 2. **Fragment**:在ApiDemo中,可以看到如何使用Fragment进行屏幕...

    android APIDemo

    - `Activity`:APIDemo展示了如何创建和管理Activity,包括生命周期回调、Intent的使用以及如何在不同Activity之间进行数据传递。 - `View`:包含各种标准UI组件如Button、TextView、EditText、ImageView等的使用...

Global site tag (gtag.js) - Google Analytics