Chinaunix首页 | 论坛 | 博客
  • 博客访问: 128717
  • 博文数量: 16
  • 博客积分: 355
  • 博客等级: 一等列兵
  • 技术积分: 237
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-01 22:01
文章分类

全部博文(16)

文章存档

2012年(16)

我的朋友

分类: 嵌入式

2012-07-03 10:24:50


点击(此处)折叠或打开

  1. android4.0/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java

  2. import com.android.systemui.R;

  3. public class BatteryController extends BroadcastReceiver {
  4.     private static final String TAG = "StatusBar.BatteryController";

  5.     private Context mContext;
  6.     private ArrayList<ImageView> mIconViews = new ArrayList<ImageView>();
  7.     private ArrayList<TextView> mLabelViews = new ArrayList<TextView>();

  8.     public BatteryController(Context context) {
  9.         mContext = context;

  10.         IntentFilter filter = new IntentFilter();
  11.         /* delete by Gary. start {{----------------------------------- */
  12.         /* 2012-4-5 */
  13.         /* hide the battery icon in the statusbar */
  14. // filter.addAction(Intent.ACTION_BATTERY_CHANGED);

  15.         /* delete by Gary. end -----------------------------------}} */
  16.         context.registerReceiver(this, filter);
  17.     }

  18.    public void addIconView(ImageView v) {
  19.         /* add by Gary. start {{----------------------------------- */
  20.         /* 2012-4-5 */
  21.         /* hide the battery icon in the statusbar */
  22.         v.setVisibility(View.GONE);
  23.         /* add by Gary. end -----------------------------------}} */
  24.         mIconViews.add(v);
  25.     }

  26.     public void addLabelView(TextView v) {
  27.         /* add by Gary. start {{----------------------------------- */
  28.         /* 2012-4-5 */
  29.         /* hide the battery icon in the statusbar */
  30.         v.setVisibility(View.GONE);
  31.         /* add by Gary. end -----------------------------------}} */
  32.         mLabelViews.add(v);
  33.     }

阅读(9395) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~