- 浏览: 1207854 次
- 性别:
- 来自: 荆州
文章分类
- 全部博客 (396)
- Android 基础 (72)
- Java 基础 (42)
- Android(动画效果) (26)
- Android(自定义组件) (13)
- Android(手机服务) (38)
- Android(网络相关) (27)
- Android(多媒体) (12)
- Android(小技巧) (30)
- Android(用户界面) (39)
- 基础概念 (24)
- Android组件学习 (21)
- Android数据库相关 (11)
- 生活杂谈 (10)
- 调试技巧部分 (8)
- Sql Server相关 (1)
- Android(xml相关) (2)
- Android 开发 (12)
- 韩语学习 (4)
- Mac添加环境变量的三种方法 (1)
- iPhone开发 (1)
- Android Studio (1)
最新评论
-
ppfbsar:
下载网络文件到SD卡上 -
851228082:
好文!彻底理解单类型导入与按需导入的区别了。还有一点可以通过 ...
谈java的导入(import) -
麦田的设计者:
老乡啊
sqlite 数据库保存图片 -
sf_dream:
我要是读写list、map之类的集合呢
ObjectOutputStream和ObjectInputStream类的学习 -
xfyunyun:
博主,请问webview加载html字符串时怎么进行缓存处理呢 ...
WebView使用总结2(加载HTML内容形式的String)
1. ScaleActivity.java文件
2.ScaleAnimationHelper.java文件
3. Activitya.java文件
4.main.xml文件
5.newq.xml文件
注意2个Activity都需要在Manifest文件中进行申明
package cn.com; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class ScaleActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); /* 以findViewById()取得Button对象,并添加onClickListener */ Button b1 = (Button) findViewById(R.id.Button01); b1.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub /* new一个Intent对象,并指定class */ Intent intent = new Intent(); intent.setClass(ScaleActivity.this, Activitya.class); /* 调用Activity EX03_10_1 */ startActivity(intent); } }); } }
2.ScaleAnimationHelper.java文件
package cn.com; import android.content.Context; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.ScaleAnimation; public class ScaleAnimationHelper { Context con; int order; public ScaleAnimationHelper(Context con, int order) { this.con = con; this.order = order; } AlphaAnimation myAnimation_Alpha; ScaleAnimation myAnimation_Scale; public void ScaleOutAnimation(View view) { myAnimation_Alpha = new AlphaAnimation(1.0f, 0.1f); myAnimation_Scale = new ScaleAnimation(0.1f, 1.0f, 0.1f, 1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); myAnimation_Scale.setInterpolator(new AccelerateInterpolator()); AnimationSet aa = new AnimationSet(true); aa.addAnimation(myAnimation_Alpha); aa.addAnimation(myAnimation_Scale); aa.setDuration(1000); view.startAnimation(aa); } public void ScaleInAnimation(View view) { myAnimation_Scale = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); myAnimation_Scale.setDuration(1000); myAnimation_Scale.setInterpolator(new AccelerateInterpolator()); AnimationSet aa = new AnimationSet(true); aa.addAnimation(myAnimation_Scale); // aa.setDuration(1000); view.startAnimation(aa); } }
3. Activitya.java文件
package cn.com; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.LinearLayout; import android.view.View.OnClickListener; public class Activitya extends Activity implements OnClickListener { ViewGroup v; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.newq); v = (LinearLayout) findViewById(R.id.news); Button Button01 = (Button) findViewById(R.id.Button01); Button01.setOnClickListener(this); // 显示layout进行缩放动画效果 ScaleAnimationHelper scaleHelper = new ScaleAnimationHelper(this, 1); scaleHelper.ScaleOutAnimation(v); } @Override public void onClick(View v) { // TODO Auto-generated method stub // 显示layout进行缩放动画效果 //ScaleAnimationHelper scaleHelper = new ScaleAnimationHelper(this, 1); //scaleHelper.ScaleInAnimation(v); } }
4.main.xml文件
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:text="StartActivity" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> </LinearLayout>
5.newq.xml文件
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="#123456" android:layout_height="fill_parent" android:id="@+id/news" android:orientation="vertical"> <TextView android:text="this is the second activity" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout>
注意2个Activity都需要在Manifest文件中进行申明
发表评论
-
自定义ProgressDialog
2013-04-21 15:58 1112就2段关键代码: <?xml version=&qu ... -
弹性 ScrollView
2013-04-21 15:14 1365CustomerScrollView.java: clas ... -
走马灯效果文字
2012-02-15 16:05 1856走马灯效果的代码,对Tex ... -
API DEMO中3D旋转Layout效果
2011-12-08 13:07 2983LayoutChange.java: package cn ... -
自定义Loading Dialog
2011-09-12 21:00 2685好久没有更新blog,这段时间忙着换工作的事情,现在赶紧的拾掇 ... -
关于旋转动画效果
2011-05-01 17:13 2226好久没有写过blog了,5.1还在继续劳动,:( 刚研究完一个 ... -
Dialog伸缩动画效果
2011-01-13 14:45 6570效果图: ViewScale.java: publ ... -
球体旋转Anim(主要学习点Matrix知识)
2010-12-09 20:20 2090这点Code主要对View重写进行球体旋转: 知识点: 1.重 ... -
Anim中实现Scale和Alpha操作ImageView
2010-12-09 19:51 2829针对这个动画效果的应用,可以了解如下几个知识点: 1.几种动画 ... -
Image的放大,缩小(zoom in,zoom out)
2010-09-15 10:51 3354package com.example; impor ... -
TextView中各种Interpolator的使用
2010-09-09 13:07 3537package net.blogjava.mobile.i ... -
点击button拖动效果
2010-09-09 10:05 1580这个简单的代码段可以熟悉getX(),getRawX()等方法 ... -
API中画arc的简单代码
2010-09-07 14:45 1478package com.test; import a ... -
文本抖动效果
2010-09-05 21:58 2814几句代码如下: Animation animation = ... -
球体运动效果
2010-08-14 22:42 1756看个效果图: 自定义的View: package ... -
关于Drawable动画效果的实现demo(参考ray的博客例子)
2010-08-12 23:09 3082直接上代码把,上面都写了很清楚的注释: package c ... -
一种动画2中不同实现方式(代码和xml)
2010-08-05 21:01 1443AnimTwo.java文件: package cn.co ... -
Activity之间切换的各种效果(遗憾没有3D的效果)
2010-08-05 19:25 7172下面的Demo是我找到的一个觉得用来在程序中进行Activit ... -
Layout之间3D切换效果Demo
2010-07-26 21:58 4063先上个效果图(跟自己Blog中的浏览图片的代码类似,不过是la ... -
ImageView点击透明度变化效果
2010-07-26 20:53 46071. ClickAlphaChange.java文件 pa ...
相关推荐
Android 是一个专门针对移动设备的软件集,它包括一个操作系统,中间件和一些重要的应用程序。 Beta 版 的 Android SDK 提供了在 Android 平台上使用 JaVa 语言进行 Android 应用开发必须的工具和 API 接口。 特性 ...
Activity Activity是一个应用程序组件,提供一个屏幕,用户可以用来交互为了完成某项任务,是一个负责与用户交互的组件 SSH 为 Struts+Spring+Hibernate的一个集成框架,是目前较流行的一种Web应用程序开源框架。...
9.31、把文件内容读出到一个字符串 245 9.32、扫描WIFI热点演示实例教程 246 9.33、调用GOOGLE搜索 249 9.34、调用浏览器 载入某网址 249 9.35、获取 IP地址 249 9.36、从输入流中获取数据并以字节数组返回 250 9.37...
9.31、把文件内容读出到一个字符串 245 9.32、扫描WIFI热点演示实例教程 246 9.33、调用GOOGLE搜索 249 9.34、调用浏览器 载入某网址 249 9.35、获取 IP地址 249 9.36、从输入流中获取数据并以字节数组返回 250 9.37...
《Android开发艺术探索》是一本Android进阶类书籍,采用理论、源码和实践相结合的方式来阐述高水准的Android应用开发要点。《Android开发艺术探索》从三个方面来组织内容。第一,介绍Android开发者不容易掌握的一些...
2.2.1 开启多进程模式 / 36 2.2.2 多进程模式的运行机制 / 39 2.3 IPC基础概念介绍 / 42 2.3.1 Serializable接口 / 42 2.3.2 Parcelable接口 / 45 2.3.3 Binder / 47 2.4 Android中的IPC方式 / 61 ...
startActivities : 启动多个 Activity startHomeActivity : 回到桌面 getActivityList : 获取 Activity 栈链表 getLauncherActivity : 获取启动项 Activity getTopActivity : 获取栈顶 Activity ...
2.7 ANR starting an Activity(运行一个活动,但是应用无相应) 2.8 ANR recriving a broadcast Intent(接收一个广播意图,但是应用无响应) 2.9 ANR staring a Service(运行一个服务,但是应用无响应) 2.10 System ...
android计步器的实现,自定义的一个弧形进度条,记步通过手机的传感器来实现,也就是说不支持传感器的机子(应该很老的了吧)就没有效果。看看效果图: 这里写图片描述这里写图片描述 自定义View public class ...
//CGAffineTransformMakeRotation 方法的作用就是传进去一个角度(计量单位不是度,是弧度),方法内部帮你生成一个这个角度所对应的旋转矩阵 //rotate 旋转 CGAffineTransform a = ...
1、打开AP6212的BT,关闭rtl8723bs的BT(其它都是按照比对软件的字母顺序了): [ 3.141273] Bluetooth: HCI UART driver ver 2.2 [ 3.146210] Bluetooth: HCI H4 protocol initialized [ 3.151563] Bluetooth: HCI ...
1、打开AP6212的BT,关闭rtl8723bs的BT: [ 3.141273] Bluetooth: HCI UART driver ver 2.2 [ 3.146210] Bluetooth: HCI H4 protocol initialized [ 3.151563] Bluetooth: HCI BCSP protocol initialized [ 3.157154...
1、打开AP6212的BT,关闭rtl8723bs的BT: [ 3.141273] Bluetooth: HCI UART driver ver 2.2 [ 3.146210] Bluetooth: HCI H4 protocol initialized [ 3.151563] Bluetooth: HCI BCSP protocol initialized [ 3.157154...
1、打开AP6212的BT,关闭rtl8723bs的BT: [ 3.141273] Bluetooth: HCI UART driver ver 2.2 [ 3.146210] Bluetooth: HCI H4 protocol initialized [ 3.151563] Bluetooth: HCI BCSP protocol initialized [ 3.157154...