当前位置:操作系统 > 安卓/Android >>

Android动画效果Widget

请参照前面的飞行模式widget和wifi widget,不同代码:

 

private void handStateChanged(int state){

  Message msg = mHandler.obtainMessage(BluetoothDefinition.START_ANIMATION);

  msg.arg1 = 0;

  switch (state) {

  case BluetoothAdapter.STATE_TURNING_ON:

      if (sIsOnClick) {

          BluetoothDefinition.mRunAnimation = true;

             mHandler.sendMessage(msg);

             sIsOnClick = false;

      }

   break;

  case BluetoothAdapter.STATE_ON:

   BluetoothDefinition.mRunAnimation = false;

   mHandler.sendEmptyMessage(BluetoothDefinition.END_ANIMATION);

   break;

  case BluetoothAdapter.STATE_TURNING_OFF:

      if (sIsOnClick) {

             mHandler.sendMessage(msg);

             sIsOnClick = false;

      }

   break;

  case BluetoothAdapter.STATE_OFF:

   mHandler.sendEmptyMessage(BluetoothDefinition.END_ANIMATION);

   break;

  default:

  }

 }

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,