- 浏览: 236669 次
- 性别:
- 来自: 广州
最新评论
-
Janne:
你好 有源代码?可以发到我的邮箱里学学吗?2731049993 ...
achartengine画出动态折线图的效果 -
anbo724:
我的邮箱 anbo724@gmail.com谢谢@
achartengine画出动态折线图的效果 -
anbo724:
你好 请问有源码没《?谢谢
achartengine画出动态折线图的效果 -
weiday123:
额,觉得这个会不会占堆内存?
AdapterView、Adapter优化 -
wen742538485:
为什么没有呢?权限没加还是发创建了给你删了再想创建?是不允许重 ...
Android中为你的应用程序添加桌面快捷方式
MyAnimation.java
Java代码
package com.ljp.youku;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
public class MyAnimation {
// 图标的动画(入动画)
public static void startAnimationsIn(ViewGroup viewgroup, int durationMillis) {
viewgroup.setVisibility(0);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(0);
viewgroup.getChildAt(i).setClickable(true);
viewgroup.getChildAt(i).setFocusable(true);
}
Animation animation;
animation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
viewgroup.startAnimation(animation);
}
// 图标的动画(出动画)
public static void startAnimationsOut(final ViewGroup viewgroup,
int durationMillis, int startOffset) {
Animation animation;
animation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
animation.setStartOffset(startOffset);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation arg0) {}
@Override
public void onAnimationRepeat(Animation arg0) {}
@Override
public void onAnimationEnd(Animation arg0) {
viewgroup.setVisibility(8);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(8);
viewgroup.getChildAt(i).setClickable(false);
viewgroup.getChildAt(i).setFocusable(false);
}
}
});
viewgroup.startAnimation(animation);
}
}
package com.ljp.youku;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
public class MyAnimation {
// 图标的动画(入动画)
public static void startAnimationsIn(ViewGroup viewgroup, int durationMillis) {
viewgroup.setVisibility(0);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(0);
viewgroup.getChildAt(i).setClickable(true);
viewgroup.getChildAt(i).setFocusable(true);
}
Animation animation;
animation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
viewgroup.startAnimation(animation);
}
// 图标的动画(出动画)
public static void startAnimationsOut(final ViewGroup viewgroup,
int durationMillis, int startOffset) {
Animation animation;
animation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
animation.setStartOffset(startOffset);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation arg0) {}
@Override
public void onAnimationRepeat(Animation arg0) {}
@Override
public void onAnimationEnd(Animation arg0) {
viewgroup.setVisibility(8);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(8);
viewgroup.getChildAt(i).setClickable(false);
viewgroup.getChildAt(i).setFocusable(false);
}
}
});
viewgroup.startAnimation(animation);
}
}
TestYoukuActivity.java
Java代码
package com.ljp.youku;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
public class TestYoukuActivity extends Activity {
/** Called when the activity is first created. */
private boolean areLevel2Showing = true, areLevel3Showing = true;
private RelativeLayout relate_level2, relate_level3;
private ImageButton home, menu;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
findViews();
setListener();
}
private void findViews() {
relate_level2 = (RelativeLayout) findViewById(R.id.relate_level2);
relate_level3 = (RelativeLayout) findViewById(R.id.relate_level3);
home = (ImageButton) findViewById(R.id.home);
menu = (ImageButton) findViewById(R.id.menu);
}
private void setListener() {
// 给大按钮设置点击事件
home.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!areLevel2Showing) {
MyAnimation.startAnimationsIn(relate_level2, 500);
} else {
if (areLevel3Showing) {
MyAnimation.startAnimationsOut(relate_level2, 500, 500);
MyAnimation.startAnimationsOut(relate_level3, 500, 0);
areLevel3Showing = !areLevel3Showing;
} else {
MyAnimation.startAnimationsOut(relate_level2, 500, 0);
}
}
areLevel2Showing = !areLevel2Showing;
}
});
menu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!areLevel3Showing) {
MyAnimation.startAnimationsIn(relate_level3, 500);
} else {
MyAnimation.startAnimationsOut(relate_level3, 500, 0);
}
areLevel3Showing = !areLevel3Showing;
}
});
}
}
Java代码
package com.ljp.youku;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
public class MyAnimation {
// 图标的动画(入动画)
public static void startAnimationsIn(ViewGroup viewgroup, int durationMillis) {
viewgroup.setVisibility(0);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(0);
viewgroup.getChildAt(i).setClickable(true);
viewgroup.getChildAt(i).setFocusable(true);
}
Animation animation;
animation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
viewgroup.startAnimation(animation);
}
// 图标的动画(出动画)
public static void startAnimationsOut(final ViewGroup viewgroup,
int durationMillis, int startOffset) {
Animation animation;
animation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
animation.setStartOffset(startOffset);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation arg0) {}
@Override
public void onAnimationRepeat(Animation arg0) {}
@Override
public void onAnimationEnd(Animation arg0) {
viewgroup.setVisibility(8);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(8);
viewgroup.getChildAt(i).setClickable(false);
viewgroup.getChildAt(i).setFocusable(false);
}
}
});
viewgroup.startAnimation(animation);
}
}
package com.ljp.youku;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
public class MyAnimation {
// 图标的动画(入动画)
public static void startAnimationsIn(ViewGroup viewgroup, int durationMillis) {
viewgroup.setVisibility(0);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(0);
viewgroup.getChildAt(i).setClickable(true);
viewgroup.getChildAt(i).setFocusable(true);
}
Animation animation;
animation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
viewgroup.startAnimation(animation);
}
// 图标的动画(出动画)
public static void startAnimationsOut(final ViewGroup viewgroup,
int durationMillis, int startOffset) {
Animation animation;
animation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
animation.setFillAfter(true);
animation.setDuration(durationMillis);
animation.setStartOffset(startOffset);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation arg0) {}
@Override
public void onAnimationRepeat(Animation arg0) {}
@Override
public void onAnimationEnd(Animation arg0) {
viewgroup.setVisibility(8);
for (int i = 0; i < viewgroup.getChildCount(); i++) {
viewgroup.getChildAt(i).setVisibility(8);
viewgroup.getChildAt(i).setClickable(false);
viewgroup.getChildAt(i).setFocusable(false);
}
}
});
viewgroup.startAnimation(animation);
}
}
TestYoukuActivity.java
Java代码
package com.ljp.youku;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
public class TestYoukuActivity extends Activity {
/** Called when the activity is first created. */
private boolean areLevel2Showing = true, areLevel3Showing = true;
private RelativeLayout relate_level2, relate_level3;
private ImageButton home, menu;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
findViews();
setListener();
}
private void findViews() {
relate_level2 = (RelativeLayout) findViewById(R.id.relate_level2);
relate_level3 = (RelativeLayout) findViewById(R.id.relate_level3);
home = (ImageButton) findViewById(R.id.home);
menu = (ImageButton) findViewById(R.id.menu);
}
private void setListener() {
// 给大按钮设置点击事件
home.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!areLevel2Showing) {
MyAnimation.startAnimationsIn(relate_level2, 500);
} else {
if (areLevel3Showing) {
MyAnimation.startAnimationsOut(relate_level2, 500, 500);
MyAnimation.startAnimationsOut(relate_level3, 500, 0);
areLevel3Showing = !areLevel3Showing;
} else {
MyAnimation.startAnimationsOut(relate_level2, 500, 0);
}
}
areLevel2Showing = !areLevel2Showing;
}
});
menu.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!areLevel3Showing) {
MyAnimation.startAnimationsIn(relate_level3, 500);
} else {
MyAnimation.startAnimationsOut(relate_level3, 500, 0);
}
areLevel3Showing = !areLevel3Showing;
}
});
}
}
- TestYouku.zip (239.5 KB)
- 下载次数: 59
发表评论
-
Android Tween动画之RotateAnimation实现图片不停旋转
2012-11-26 22:38 1089本文主要介绍Android中如何使用rotate实现图片不停旋 ... -
Android实现widget定时更新
2012-11-04 20:20 926在开发Android的widget时,第一个需要解决的问题就是 ... -
来自腾讯、谷歌、百度等名企的精选面试五十题
2012-10-07 23:08 939http://www.apkway.com/thread-90 ... -
Android 中Parcelable的作用
2012-09-24 09:53 879android提供了一种新的类型:Parcel。本类被用作封装 ... -
[Android算法] 【eoeAndroid索引】史上最牛最全android开发知识汇总
2012-09-13 09:33 1126http://www.eoeandroid.com/threa ... -
安卓航班推荐70个具有商业实战性的精品Android源码
2012-08-01 00:00 945http://www.apkway.com/thread-58 ... -
Android测试教程汇总
2012-08-02 14:51 1148http://www.apkway.com/thread-67 ... -
Service 与 Thread 的区别
2012-07-26 00:10 924Service 与 Thread 的区别 很多时候,你可能 ... -
android 使用百度地图画轨迹
2012-07-26 00:08 2642import android.content.Context ... -
android百度地图半径画圆
2012-07-26 00:07 2795Java代码 import android.content ... -
Android下获取开机时间
2012-07-26 00:05 1337我的思路是:程序里注册个广播接收器,接收开机启动的广播,当程序 ... -
android 3D 转盘效果(附源码)
2012-07-25 23:41 1813一个仿3D的转盘效果,有倒影特效,旋转图标还可自动放大缩小。由 ... -
Android Thread
2012-07-23 10:47 1056创建新线程的常用方式: 1. 直接使用Thread创建 ... -
Android 通过手说tts中文语音包实现中文朗读
2012-07-22 17:09 1815Android 通过手说tts中文语音包实现中文朗读 ... -
Android 使用HTTPClient调用Web请求(查询手机号码区域)
2012-07-21 00:33 1257Android通过Apache HttpClient调用网上提 ... -
Android+struts2+JSON方式的手机开发
2012-07-21 00:14 1168http://topmanopensource.iteye.c ... -
android九宫格实现
2012-07-21 00:03 1008android九宫格实现,开始以为很复杂,其实只要知道了如何布 ... -
Android ListView圆角实现
2012-07-20 23:59 1226在android上开发项目,如 ... -
Android 将一个Activity转化为View显示出来
2012-07-19 10:27 2096最近看到好多opengl牛人写了些立方体,卷页之类的华丽的代码 ... -
Android EditText 为空提示 密码隐藏
2012-07-17 23:39 1140EditText为空时提示方法: 1.xml文件中设置,如: ...
相关推荐
Android高仿优酷圆盘旋转菜单的实现.zip
高仿优酷圆盘旋转菜单的实现.zip
摘要:Java源码,Android,旋转菜单,Android源码 Android高仿【优酷】圆盘旋转菜单的源码下载,Android的调试环境现还没有配置起来,暂时无法抓图,代码也没有测试,大家自己下载测试吧,当初是花了高分下载来的。
Android 高仿【优酷】圆盘旋转菜单的实现.rar
Android 高仿【优酷】圆盘旋转菜单 的实现
高仿【优酷】圆盘旋转菜单 的实现
Android 高仿【优酷】圆盘旋转菜单的实现.zip源码资源下载Android 高仿【优酷】圆盘旋转菜单的实现.zip源码资源下载
android高仿【优酷】圆盘旋转菜单 的实现
Android 高仿【优酷】圆盘旋转菜单的实现.zip
优酷圆旋转菜单的实现,本软件是高仿【优酷】圆盘旋转菜单的实现。希望给大家带来帮助。
Android 高仿【优酷】圆盘旋转菜单的实现.zip项目安卓应用源码下载Android 高仿【优酷】圆盘旋转菜单的实现.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术...
高仿优酷三级导航圆盘旋转菜单
源码参考,欢迎下载
Android圆盘旋转菜单 的实现
Android项目高仿【优酷】圆盘旋转菜单 的实现.rar
高仿【优酷】圆盘旋转菜单 的实现_Android
Android源码——高仿【优酷】圆盘旋转菜单的实现.zip