コード例 #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();
  }
コード例 #2
0
 /** Disables load bar */
 public void disableLoadBar() {
   this.mLoadingBar = -1;
   updateNowPlaying();
 }
コード例 #3
0
 public void updateModel() {
   updateNowPlaying();
 }