Search in sources :

Example 1 with ReleaseGroupInfo

use of org.musicbrainz.android.api.data.ReleaseGroupInfo in project musicbrainz-android by jdamcd.

the class ReleaseGroupBrowseHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("release-group")) {
        releaseGroup = new ReleaseGroupInfo();
        String mbid = atts.getValue("id");
        releaseGroup.setMbid(mbid);
        releaseGroup.setType(atts.getValue("type"));
    } else if (localName.equals("title")) {
        buildString();
    } else if (localName.equals("first-release-date")) {
        buildString();
    } else if (localName.equals("release-group-list")) {
        total = Integer.parseInt(atts.getValue("count"));
    }
}
Also used : ReleaseGroupInfo(org.musicbrainz.android.api.data.ReleaseGroupInfo)

Example 2 with ReleaseGroupInfo

use of org.musicbrainz.android.api.data.ReleaseGroupInfo in project musicbrainz-android by jdamcd.

the class ReleaseGroupSearchHandler method startElement.

public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
    if (localName.equals("release-group")) {
        rg = new ReleaseGroupInfo();
        rg.setMbid(atts.getValue("id"));
        rg.setType(atts.getValue("type"));
    } else if (localName.equals("title")) {
        buildString();
    } else if (localName.equals("artist")) {
        inArtist = true;
        releaseArtist = new ReleaseArtist();
        releaseArtist.setMbid(atts.getValue("id"));
    } else if (localName.equals("name") && inArtist) {
        buildString();
    } else if (localName.equals("release")) {
        rg.addReleaseMbid(atts.getValue("id"));
    }
}
Also used : ReleaseArtist(org.musicbrainz.android.api.data.ReleaseArtist) ReleaseGroupInfo(org.musicbrainz.android.api.data.ReleaseGroupInfo)

Example 3 with ReleaseGroupInfo

use of org.musicbrainz.android.api.data.ReleaseGroupInfo in project musicbrainz-android by jdamcd.

the class ArtistRGAdapter method getView.

public View getView(int position, View convertView, ViewGroup parent) {
    View release = convertView;
    ArtistReleaseGroupHolder holder = null;
    if (release == null) {
        LayoutInflater inflater = context.getLayoutInflater();
        release = inflater.inflate(R.layout.list_release_group, parent, false);
        holder = new ArtistReleaseGroupHolder(release);
        release.setTag(holder);
    } else {
        holder = (ArtistReleaseGroupHolder) release.getTag();
    }
    ReleaseGroupInfo rData = releaseGroups.get(position);
    holder.getReleaseTitle().setText(rData.getTitle());
    holder.getReleaseYear().setText(rData.getReleaseYear());
    holder.getReleaseType().setText(StringMapper.mapRGTypeString(getContext(), rData.getType()));
    return release;
}
Also used : LayoutInflater(android.view.LayoutInflater) ReleaseGroupInfo(org.musicbrainz.android.api.data.ReleaseGroupInfo) TextView(android.widget.TextView) View(android.view.View)

Example 4 with ReleaseGroupInfo

use of org.musicbrainz.android.api.data.ReleaseGroupInfo in project musicbrainz-android by jdamcd.

the class MusicBrainzWebClient method searchReleaseGroup.

@Override
public LinkedList<ReleaseGroupInfo> searchReleaseGroup(String searchTerm) throws IOException {
    HttpEntity entity = get(QueryBuilder.releaseGroupSearch(searchTerm));
    LinkedList<ReleaseGroupInfo> releaseGroups = responseParser.parseReleaseGroupSearch(entity.getContent());
    entity.consumeContent();
    return releaseGroups;
}
Also used : HttpEntity(org.apache.http.HttpEntity) ReleaseGroupInfo(org.musicbrainz.android.api.data.ReleaseGroupInfo)

Example 5 with ReleaseGroupInfo

use of org.musicbrainz.android.api.data.ReleaseGroupInfo in project musicbrainz-android by jdamcd.

the class MusicBrainzWebClient method browseArtistReleaseGroups.

private ArrayList<ReleaseGroupInfo> browseArtistReleaseGroups(String mbid) throws IOException {
    HttpEntity entity = get(QueryBuilder.artistReleaseGroupBrowse(mbid, 0));
    ArrayList<ReleaseGroupInfo> releases = responseParser.parseReleaseGroupBrowse(entity.getContent());
    entity.consumeContent();
    Collections.sort(releases);
    return releases;
}
Also used : HttpEntity(org.apache.http.HttpEntity) ReleaseGroupInfo(org.musicbrainz.android.api.data.ReleaseGroupInfo)

Aggregations

ReleaseGroupInfo (org.musicbrainz.android.api.data.ReleaseGroupInfo)7 LayoutInflater (android.view.LayoutInflater)2 View (android.view.View)2 TextView (android.widget.TextView)2 HttpEntity (org.apache.http.HttpEntity)2 ReleaseArtist (org.musicbrainz.android.api.data.ReleaseArtist)1