use of org.musicbrainz.android.api.data.ArtistSearchResult in project musicbrainz-android by jdamcd.
the class ArtistSearchAdapter method getView.
public View getView(int position, View convertView, ViewGroup parent) {
View artist = convertView;
ArtistSearchHolder holder = null;
if (artist == null) {
LayoutInflater inflater = context.getLayoutInflater();
artist = inflater.inflate(R.layout.list_search_artist, parent, false);
holder = new ArtistSearchHolder(artist);
artist.setTag(holder);
} else {
holder = (ArtistSearchHolder) artist.getTag();
}
ArtistSearchResult artistData = resultData.get(position);
holder.getArtistName().setText(artistData.getName());
TextView option = holder.getDisambiguation();
String disambiguation = artistData.getDisambiguation();
option.setText(disambiguation);
if (disambiguation != null) {
option.setVisibility(View.VISIBLE);
} else {
option.setVisibility(View.GONE);
}
return artist;
}
use of org.musicbrainz.android.api.data.ArtistSearchResult in project musicbrainz-android by jdamcd.
the class MusicBrainzWebClient method searchArtist.
@Override
public LinkedList<ArtistSearchResult> searchArtist(String searchTerm) throws IOException {
HttpEntity entity = get(QueryBuilder.artistSearch(searchTerm));
LinkedList<ArtistSearchResult> artists = responseParser.parseArtistSearch(entity.getContent());
entity.consumeContent();
return artists;
}
use of org.musicbrainz.android.api.data.ArtistSearchResult in project musicbrainz-android by jdamcd.
the class ArtistSearchHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("artist")) {
result = new ArtistSearchResult();
result.setMbid(atts.getValue("id"));
} else if (localName.equals("name") && !inTag && !inUnsupported) {
buildString();
} else if (localName.equals("disambiguation")) {
buildString();
} else if (localName.equals("tag")) {
inTag = true;
} else if (isUnsupported(localName)) {
inUnsupported = true;
}
}
Aggregations