Пример #1
0
 public void updateCurrentBgInfo() {
   final TextView notificationText = (TextView) findViewById(R.id.notices);
   if (BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
     notificationText.setTextSize(40);
   }
   notificationText.setText("");
   notificationText.setTextColor(Color.RED);
   isBTWixel = CollectionServiceStarter.isBTWixel(getApplicationContext());
   isDexbridgeWixel = CollectionServiceStarter.isDexbridgeWixel(getApplicationContext());
   isBTShare = CollectionServiceStarter.isBTShare(getApplicationContext());
   isWifiWixel = CollectionServiceStarter.isWifiWixel(getApplicationContext());
   if (isBTShare) {
     updateCurrentBgInfoForBtShare(notificationText);
   }
   if (isBTWixel || isDexbridgeWixel) {
     updateCurrentBgInfoForBtBasedWixel(notificationText);
   }
   if (isWifiWixel) {
     updateCurrentBgInfoForWifiWixel(notificationText);
   }
   if (prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()) {
     notificationText.append("\n ALERTS CURRENTLY DISABLED");
   }
   mNavigationDrawerFragment =
       (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
   mNavigationDrawerFragment.setUp(
       R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
 }
Пример #2
0
 private void updateCurrentBgInfo() {
   setupCharts();
   final TextView notificationText = (TextView) findViewById(R.id.notices);
   if (BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
     notificationText.setTextSize(40);
   }
   notificationText.setText("");
   notificationText.setTextColor(Color.RED);
   boolean isBTWixel = CollectionServiceStarter.isBTWixel(getApplicationContext());
   boolean isDexbridgeWixel = CollectionServiceStarter.isDexbridgeWixel(getApplicationContext());
   boolean isWifiBluetoothWixel =
       CollectionServiceStarter.isWifiandBTWixel(getApplicationContext());
   isBTShare = CollectionServiceStarter.isBTShare(getApplicationContext());
   boolean isWifiWixel = CollectionServiceStarter.isWifiWixel(getApplicationContext());
   alreadyDisplayedBgInfoCommon = false; // reset flag
   if (isBTShare) {
     updateCurrentBgInfoForBtShare(notificationText);
   }
   if (isBTWixel || isDexbridgeWixel || isWifiBluetoothWixel) {
     updateCurrentBgInfoForBtBasedWixel(notificationText);
   }
   if (isWifiWixel || isWifiBluetoothWixel) {
     updateCurrentBgInfoForWifiWixel(notificationText);
   }
   if (prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()) {
     notificationText.append("\n ALL ALERTS CURRENTLY DISABLED");
   } else if (prefs.getLong("low_alerts_disabled_until", 0) > new Date().getTime()
       && prefs.getLong("high_alerts_disabled_until", 0) > new Date().getTime()) {
     notificationText.append("\n LOW AND HIGH ALERTS CURRENTLY DISABLED");
   } else if (prefs.getLong("low_alerts_disabled_until", 0) > new Date().getTime()) {
     notificationText.append("\n LOW ALERTS CURRENTLY DISABLED");
   } else if (prefs.getLong("high_alerts_disabled_until", 0) > new Date().getTime()) {
     notificationText.append("\n HIGH ALERTS CURRENTLY DISABLED");
   }
   NavigationDrawerFragment navigationDrawerFragment =
       (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
   navigationDrawerFragment.setUp(
       R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), menu_name, this);
 }