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"));
}
}
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"));
}
}
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;
}
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;
}
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;
}
Aggregations