Пример #1
0
  private static void updateAll() {
    try {
      // If nothing can see this, stop updating
      if (activeActivities == 0) {
        activeActivities--;
        return;
      }

      List<UpdateView> views = new ArrayList<UpdateView>();
      for (UpdateView view : INSTANCES.keySet()) {
        if (view.isShown()) {
          views.add(view);
        }
      }
      if (views.size() > 0) {
        updateAllLive(views);
      } else {
        uiHandler.postDelayed(updateRunnable, 2000L);
      }
    } catch (Throwable x) {
      Log.w(TAG, "Error when updating song views.", x);
    }
  }
Пример #2
0
  @Override
  protected void onResume() {
    super.onResume();
    Util.registerMediaButtonEventReceiver(this);

    // Make sure to update theme
    SharedPreferences prefs = Util.getPreferences(this);
    if (theme != null && !theme.equals(Util.getTheme(this))
        || fullScreen != prefs.getBoolean(Constants.PREFERENCES_KEY_FULL_SCREEN, false)
        || actionbarColored != prefs.getBoolean(Constants.PREFERENCES_KEY_COLOR_ACTION_BAR, true)) {
      restart();
      overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
      DrawableTint.wipeTintCache();
    }

    populateTabs();
    UpdateView.addActiveActivity();
  }
Пример #3
0
  @Override
  protected void onPause() {
    super.onPause();

    UpdateView.removeActiveActivity();
  }