当前位置:  编程技术>移动开发
本页文章导读:
    ▪Animation(3)        Animation(三)   继续上篇的animation,本篇用到的是AnimationListener,参考自iteye上的一个朋友的翻牌动画。AnimationListener主要是用来监听animation的,它接受animation的通知,每个通知声明了一个.........
    ▪ 写了一个多线程,看似写的不好。        写了一个多线程,貌似写的不好。。。 public class TestAppPageThread extends Thread { private static GameCenterService gameCenterService; public TestAppPageThread() { } public static void main(String[] args) throws IOException { i.........
    ▪ jquery mobile 初记       jquery mobile 小记 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> &.........

[1]Animation(3)
    来源: 互联网  发布时间: 2014-02-18
Animation(三)
  继续上篇的animation,本篇用到的是AnimationListener,参考自iteye上的一个朋友的翻牌动画。AnimationListener主要是用来监听animation的,它接受animation的通知,每个通知声明了一个相关的事件。话不多说,上代码:
package com.kevin.animation;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class AnimationDemo extends Activity {
	private ImageView img;
	private boolean isFront = false;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        img = (ImageView)findViewById(R.id.imageView1);
        // bind onclick event
        img.setOnClickListener(new ImgOnClickListener());
    }
    class ImgOnClickListener implements OnClickListener{

		@Override
		public void onClick(View v) {
			// load back animation  config
			Animation animation = AnimationUtils.loadAnimation(AnimationDemo.this, R.anim.back_scale);
			// bind AnimationListener
			animation.setAnimationListener(new AnimationListener() {	
				// Notifies the start of the animation.
				@Override
				public void onAnimationStart(Animation animation) {
					System.out.println("onAnimationStart.");
				}
				// Notifies the repetition of the animation.
				@Override
				public void onAnimationRepeat(Animation animation) {
					System.out.println("onAnimationRepeat");
				}
				// Notifies the end of the animation.
				@Override
				public void onAnimationEnd(Animation animation) {
					System.out.println("onAnimationEnd");
					if(isFront){
						img.setImageResource(R.drawable.back);
						isFront = false;
					}else{
						img.setImageResource(R.drawable.front);
						isFront = true;
					}
					// load front animation config
					img.setAnimation(AnimationUtils.loadAnimation(AnimationDemo.this, R.anim.front_scale));				
				}
			});
			// invoke animation immediately
			img.startAnimation(animation);
		}
    	
    }
}

    
[2] 写了一个多线程,看似写的不好。
    来源: 互联网  发布时间: 2014-02-18
写了一个多线程,貌似写的不好。。。
public class TestAppPageThread extends Thread {

private static GameCenterService gameCenterService;

public TestAppPageThread() {

}

public static void main(String[] args) throws IOException {
int threadCount = 10;
ServiceFactory fact = ServiceFactories.getFactory();
gameCenterService = fact.getService(GameCenterService.class);

System.out.println("threadCount:" + threadCount);

testMutiThread(threadCount);
}

public static void testMutiThread(int threadCount)
throws IOException {
read();
        //循环调用线程
for(int i=0; i< threadCount; i++){
//必须调用Thread的start()函数,该函数再调用run()
Thread t = new TestAppPageThread();
t.start();
}
}

@Override
//必须覆盖Thread的run()函数来完成有用的工作
public void run(){

try {
System.out.println("offset:" );
System.out.println("limit:");
       
//ServiceFuture<AppPage> f = gameCenterService.getPage(1, 2);
//ServiceFuture<AppPage[]> f = gameCenterService.getAppPageListByKeyword("僵尸", 0, 10);
        //ServiceFuture<AppPage[]> f =  gameCenterService.getAppPageListByStatus(1, 10);
        ServiceFuture<AppPage[]> f = gameCenterService.getAppPageCategoryList(1, 2, 1,10);
System.out.println(f);
System.out.println(11);
f.submit();


if (f.await(2300)) {
if (f.isSuccess()) {
System.out.println(14);
System.out.println(f.getContent());
AppPage[] pagelist  =  f.getContent();
System.out.print(pagelist.length);
for(AppPage page : pagelist){
long start = System.currentTimeMillis();
System.out.println(page.getId()+"  "+page.getPageName() + "  " + page.getAddTime()
+" time used:" + (System.currentTimeMillis()- start) + "ms");
}

} else {
System.out.println("not success");
}
}
      

} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}


}

public static void read() throws IOException {

System.out.println(9);
}

}

    
[3] jquery mobile 初记
    来源: 互联网  发布时间: 2014-02-18
jquery mobile 小记

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="/blog_article/<%=basePath%>/index.html">
   
    <title>My JSP 'index.jsp' starting page</title>
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <link rel="stylesheet" href="/blog_article/jquerymobile/jquery.mobile-1.0b1.min.css" />
 <script src="/blog_article/jquerymobile/jquery-1.6.1.js"></script>
 <script src="/blog_article/jquerymobile/jquery.mobile-1.0b1.min.js"></script>       
  </head>
 
  <body>
   <div  data-role="page">
  <div  data-role="header">
   ---
  </div>
  <div  data-role="content">
   <div data-role="fieldcontain">
       <label for="name">Text Input:</label>
       <input type="text" name="name" id="name" value="" />
   </div> 
   <a href="/blog_article/index.html" data-role="button" data-icon="delete">Delete</a>
  </div>
  <div data-role="button">
   <input type="text" name="name" id="name2" value="" />
   <a  id="cha" data-role="button" data-icon="arrow-d" data-iconpos="notext"></a>
  <select  name="selectchoice" id="selectchoice"  data-native-menu="false">
   <option value="standard">Standard: 7 day</option>
   <option value="rush">Rush: 3 days</option>
   <option value="express">Express: next day</option>
   <option value="overnight">Overnight</option>
  </select>
  </div>
  
  
  <div  data-role="footer">...</div>
 </div>
 <script type="text/javascript">
  setTimeout(function (){
   $("#cha").click(function (){
    $(".ui-select").find("a").trigger("click");
    var position =$("#cha").offset();
    $(".ui-selectmenu").css("top",""+position.top);
    $(".ui-selectmenu").css("left",""+position.left-($("#name").width()/2));
    $(".ui-selectmenu").find("ul").find("li").find("div").find("div").append("xxx");
    $(".ui-selectmenu").click(function (){
     $("#name2").val($("#selectchoice").val());
    });
   });
   $(".ui-select").hide();
  },100);
 </script>
  </body>
</html>


    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,