Ejemplo n.º 1
0
  void SetupCommonArtists(Tasteometer ts) {
    mMyRecentAdapter.resetList();

    if (ts != null) {
      for (String name : ts.getResults()) {
        String url = "lastfm://artist/" + Uri.encode(name) + "/similarartists";
        mMyRecentAdapter.putStation(name, url);
      }
    }

    mMyRecentAdapter.updateModel();
  }
Ejemplo n.º 2
0
  private void SetupMyStations() {
    SharedPreferences settings = getSharedPreferences(LastFm.PREFS, 0);

    Session session = LastFMApplication.getInstance().session;
    mMyStationsAdapter = new LastFMStreamAdapter(this);
    if (isAuthenticatedUser) {
      mMyStationsAdapter.putStation(
          getString(R.string.profile_mylibrary),
          "lastfm://user/" + Uri.encode(mUsername) + "/personal");
      if (!settings.getBoolean("remove_loved", false) && session.getSubscriber().equals("1"))
        mMyStationsAdapter.putStation(
            getString(R.string.profile_myloved),
            "lastfm://user/" + Uri.encode(mUsername) + "/loved");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_myrecs),
          "lastfm://user/" + Uri.encode(mUsername) + "/recommended");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_mymix), "lastfm://user/" + Uri.encode(mUsername) + "/mix");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_myneighborhood),
          "lastfm://user/" + Uri.encode(mUsername) + "/neighbours");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_myfriends),
          "lastfm://user/" + Uri.encode(mUsername) + "/friends");
    } else {
      mMyStationsAdapter.putStation(
          getString(R.string.profile_userlibrary, mUsername),
          "lastfm://user/" + Uri.encode(mUsername) + "/personal");
      if (!settings.getBoolean("remove_loved", false) && session.getSubscriber().equals("1"))
        mMyStationsAdapter.putStation(
            getString(R.string.profile_userloved, mUsername),
            "lastfm://user/" + Uri.encode(mUsername) + "/loved");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_myrecs),
          "lastfm://user/" + Uri.encode(mUsername) + "/recommended");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_usermix, mUsername),
          "lastfm://user/" + Uri.encode(mUsername) + "/mix");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_userneighborhood, mUsername),
          "lastfm://user/" + Uri.encode(mUsername) + "/neighbours");
      mMyStationsAdapter.putStation(
          getString(R.string.profile_userfriends, mUsername),
          "lastfm://user/" + Uri.encode(mUsername) + "/friends");
    }

    mMyStationsAdapter.updateModel();
  }
Ejemplo n.º 3
0
  private void SetupRecentStations() {
    if (!isAuthenticatedUser) return;
    SharedPreferences settings = getSharedPreferences(LastFm.PREFS, 0);
    mMyRecentAdapter.resetList();
    List<Station> stations = RecentStationsDao.getInstance().getRecentStations();
    if (stations != null) {
      for (Station station : stations) {
        String name = station.getName();
        String url = station.getUrl();

        if (url.startsWith("lastfm://playlist/") && settings.getBoolean("remove_playlists", false))
          continue;
        if (url.startsWith("lastfm://usertags/") && settings.getBoolean("remove_tags", false))
          continue;
        if (url.endsWith("/loved") && settings.getBoolean("remove_loved", false)) continue;
        mMyRecentAdapter.putStation(name, url);
      }
    }
    mMyRecentAdapter.updateModel();
  }