Exemplo n.º 1
0
  private void RebuildMainMenu() {
    SetupMyStations();

    mMainAdapter = new SeparatedListAdapter(this);
    mMyStationsAdapter.container = mMainAdapter;
    mMyRecentAdapter.container = mMainAdapter;
    if (isAuthenticatedUser) {
      mMainAdapter.addSection(getString(R.string.profile_mystations), mMyStationsAdapter);
      if (mMyRecentAdapter.getCount() > 0) {
        mMainAdapter.addSection(getString(R.string.profile_recentstations), mMyRecentAdapter);
      }
    } else {
      mMainAdapter.addSection(
          getString(R.string.profile_userstations, mUsername), mMyStationsAdapter);
      mMainAdapter.addSection(getString(R.string.profile_commonartists), mMyRecentAdapter);
    }
    if (mMyStationsAdapter != null && mMyStationsAdapter.getCount() > 0)
      mMyStationsAdapter.updateNowPlaying();
    if (mMyRecentAdapter != null && mMyRecentAdapter.getCount() > 0)
      mMyRecentAdapter.updateNowPlaying();
    setListAdapter(mMainAdapter);
    mMainAdapter.notifyDataSetChanged();
  }
 /** Disables load bar */
 public void disableLoadBar() {
   this.mLoadingBar = -1;
   updateNowPlaying();
 }
 public void updateModel() {
   updateNowPlaying();
 }