Beispiel #1
0
 @Override
 public void onSaveInstanceState(final Bundle outState) {
   if (mGenre != null) {
     outState.putParcelable(Genre.EXTRA, mGenre);
   }
   super.onSaveInstanceState(outState);
 }
Beispiel #2
0
 @Override
 public void onDestroyView() {
   headerArtist = null;
   headerInfo = null;
   coverArtProgress = null;
   coverArt.setImageResource(R.drawable.no_cover_art);
   coverArt = null;
   if (coverBitmap != null) coverBitmap.recycle();
   coverBitmap = null;
   super.onDestroyView();
 }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_player);
   if (savedInstanceState == null) {
     getFragmentManager()
         .beginTransaction()
         .add(R.id.container, BrowseFragment.newInstance(null))
         .commit();
   }
 }
Beispiel #4
0
  @Override
  public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final Bundle bundle;
    if (savedInstanceState == null) {
      bundle = getArguments();
    } else {
      bundle = savedInstanceState;
    }

    if (bundle != null) {
      mGenre = bundle.getParcelable(Genre.EXTRA);
    }
  }
 @Override
 public void onMediaItemSelected(MediaBrowser.MediaItem item) {
   if (item.isPlayable()) {
     getMediaController().getTransportControls().playFromMediaId(item.getMediaId(), null);
     QueueFragment queueFragment = QueueFragment.newInstance();
     getFragmentManager()
         .beginTransaction()
         .replace(R.id.container, queueFragment)
         .addToBackStack(null)
         .commit();
   } else if (item.isBrowsable()) {
     getFragmentManager()
         .beginTransaction()
         .replace(R.id.container, BrowseFragment.newInstance(item.getMediaId()))
         .addToBackStack(null)
         .commit();
   }
 }
Beispiel #6
0
 @Override
 public void updateFromItems() {
   super.updateFromItems();
   if (items != null) {
     Music song;
     String lastArtist = null;
     for (Item item : items) {
       song = (Music) item;
       if (lastArtist == null) {
         lastArtist = song.getArtist();
         continue;
       }
     }
     if (lastArtist == null) {
       for (Item item : items) {
         song = (Music) item;
         if (lastArtist == null) {
           lastArtist = song.getArtist();
           continue;
         }
       }
     }
     String artistName = getArtistForTrackList();
     headerArtist.setText(artistName);
     headerInfo.setText(getHeaderInfoString());
     if (coverHelper != null) {
       String filename = null;
       String path = null;
       if (items.size() > 0) {
         song = (Music) items.get(0);
         filename = song.getFilename();
         path = song.getPath();
         artistName = song.getArtist();
       }
       coverArtProgress.setVisibility(ProgressBar.VISIBLE);
       coverHelper.downloadCover(artistName, album.getName(), path, filename);
     } else {
       coverArtListener.onCoverNotFound();
     }
   }
 }
Beispiel #7
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   registerForContextMenu(getListView());
   UpdateList();
 }
Beispiel #8
0
 @Override
 public void onCreate(Bundle icicle) {
   super.onCreate(icicle);
 }
Beispiel #9
0
 @Override
 public void onDetach() {
   coverHelper = null;
   super.onDetach();
 }
Beispiel #10
0
 @Override
 public void onCreate(Bundle icicle) {
   super.onCreate(icicle);
   if (icicle != null)
     init((Artist) icicle.getParcelable(EXTRA_ARTIST), (Album) icicle.getParcelable(EXTRA_ALBUM));
 }
Beispiel #11
0
 @Override
 public void onSaveInstanceState(Bundle outState) {
   outState.putParcelable(EXTRA_ALBUM, album);
   outState.putParcelable(EXTRA_ARTIST, artist);
   super.onSaveInstanceState(outState);
 }