Android 台灣中文網
標題:
请问如何在apk游戏或软件里加入开启画面
[打印本頁]
作者:
J骑士0821
時間:
2012-10-1 08:38
標題:
请问如何在apk游戏或软件里加入开启画面
如题,请各位大侠帮助...........
作者:
wind8894
時間:
2012-10-1 22:30
是進入介面前的加載進度動畫嗎?
如果是的話,這裡有一個仿UC進入介面加載進度條,可以試試看
CircularProgressDemo.zip
(932.3 KB, 下載次數: 4)
2012-10-1 22:29 上傳
點擊文件名下載附件
package com.panda.circular;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Window;
import android.widget.ImageView;
public class CircularProgressDemoActivity extends Activity {
int [] progress_dot_array = {
R.id.dot1,R.id.dot2,R.id.dot3,R.id.dot4,R.id.dot5,R.id.dot6
};
Handler handler;
ImageView dotBtn1,dotBtn2,dotBtn3;
int position1,position2,position3;
MyThread myThread;
boolean flag;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
flag = true;
handler = new Handler(){
@Override
public void handleMessage(Message msg) {
int position = msg.what;
// TODO Auto-generated method stub
if (position == 100) {
flag = false;
return;
}
position1 = position-1;
position2 = position;
position3 = position+1;
if (position1 == -1) {
position1 = 5;
}
if (position3 == 6) {
position3 = 0;
}
dotBtn1 = (ImageView)findViewById(progress_dot_array[position1]);
dotBtn2 = (ImageView)findViewById(progress_dot_array[position2]);
dotBtn3 = (ImageView)findViewById(progress_dot_array[position3]);
dotBtn1.setBackgroundDrawable(getResources().getDrawable(R.drawable.initdot1));
dotBtn2.setBackgroundDrawable(getResources().getDrawable(R.drawable.initdot2));
dotBtn3.setBackgroundDrawable(getResources().getDrawable(R.drawable.initdot3));
}
};
myThread = new MyThread(handler);
myThread.start();
handler.sendEmptyMessageDelayed(100, 15000);
}
/**
*
* @author xiongwei
* @date Jul 6, 2012
* @describe 负责更新的线程
*/
class MyThread extends Thread{
Handler handler;
int key;
public MyThread(Handler handler){
this.handler = handler;
key = 5;
}
@Override
public void run() {
// TODO Auto-generated method stub
while(flag){
if (key == 6) {
key = 0;
}
handler.sendEmptyMessage(key);
try {
sleep(180);
} catch (Exception e) {
// TODO: handle exception
}
key ++;
}
}
}
}
複製代碼
歡迎光臨 Android 台灣中文網 (https://apk.tw/)
Powered by Discuz! X3.1