国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > 建站經(jīng)驗(yàn) > 正文

一種_Android 類似電影倒計(jì)時(shí)效果

2019-11-02 15:20:50
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

 一種Android 類似電影倒計(jì)時(shí)效果 電腦高手

  1、Activity

  import java.util.Timer;

  import java.util.TimerTask;

  import android.annotation.SuppressLint;

  import android.app.Activity;

  import android.os.Bundle;

  import android.os.Handler;

  import android.os.Message;

  import android.view.View;

  import android.view.View.OnClickListener;

  import android.view.animation.Animation;

  import android.view.animation.RotateAnimation;

  import android.widget.Button;

  import android.widget.ImageView;

  import android.widget.TextView;

  public class Test extends Activity {

  private long mlCount = 50;

  private long mCount = 0;

  TextView tvTime;

  private Button startbuttondaoji;

  private Timer timer = null;

  private TimerTask task = null;

  private Handler handler = null;

  private Message msg = null;

  private ImageView min_progress, min_progress_hand;

  Animation rotateAnimation;

  float predegree = 0;

  boolean okclear = false;

  @SuppressLint("HandlerLeak")

  @Override

  public void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  init();

  }

  private void init() {

  setContentView(R.layout.test);

  tvTime = (TextView) findViewById(R.id.duocitvTime);

  startbuttondaoji = (Button) findViewById(R.id.startbuttonduoci);

  min_progress = (ImageView) this.findViewById(R.id.duocimin_progress);

  min_progress_hand = (ImageView) this

  .findViewById(R.id.duocimin_progress_hand);

  tvTime.setText("4");

  SaveRun.setisjishi(false);

  handler = new Handler() {

  @Override

  public void handleMessage(Message msg) {

  switch (msg.what) {

  case 1:

  if(mlCount>1){

  mlCount--;

  mCount++;

  }else{

  break;

  }

  int totalSec = 0;

  totalSec = (int) (mlCount / 10);

  int sec = (totalSec % 60);

  try {

  rotateAnimation = new RotateAnimation(predegree,

  (float) (36 * mCount),

  Animation.RELATIVE_TO_SELF, 0.5f,

  Animation.RELATIVE_TO_SELF, 0.5f);

  rotateAnimation.setDuration(100);

  rotateAnimation.setFillAfter(false);

  min_progress_hand.startAnimation(rotateAnimation);

  min_progress.startAnimation(rotateAnimation);

  tvTime.setText(String.format("%1$2d",

  sec));

  predegree = (float) (36 * mCount);

  } catch (Exception e) {

  tvTime.setText( sec +"");

  e.printStackTrace();

  }

  break;

  default:

  break;

  }

  super.handleMessage(msg);

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 济宁市| 博野县| 乳山市| 葫芦岛市| 巍山| 黔西县| 九台市| 亚东县| 雷山县| 瑞金市| 金堂县| 京山县| 新宾| 治多县| 陕西省| 惠安县| 永寿县| 新田县| 襄樊市| 通辽市| 绥宁县| 洞头县| 海南省| 南部县| 巴林右旗| 嘉峪关市| 连江县| 灌南县| 梧州市| 亚东县| 工布江达县| 望奎县| 安远县| 杭锦后旗| 方正县| 岢岚县| 大厂| 鹤峰县| 新闻| 饶河县| 舟山市|