예제 #1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    MergedProvider provider = MergedProvider.getInstance(getActivity());
    mAlbumList = provider.getKnownAlbums();

    Collections.sort(
        mAlbumList,
        new Comparator<Album>() {
          @Override
          public int compare(Album lhs, Album rhs) {
            return lhs.getAlbumName()
                .toUpperCase()
                .replaceAll("^(?i)The ", "")
                .compareTo(rhs.getAlbumName().toUpperCase().replaceAll("^(?i)The ", ""));
          }
        });
    mAdapter = new AlbumAdapter(getActivity(), mAlbumList);
  }
예제 #2
0
 private List<Track> getAlbumSongs(Album album) {
   MergedProvider provider = MergedProvider.getInstance(getActivity());
   List<Track> trackList = provider.getTracksForAlbum(album.getArtist().getArtistName(), album);
   return trackList;
 }