use of org.musicbrainz.android.api.data.WebLink in project musicbrainz-android by jdamcd.
the class LinksFragment method onListItemClick.
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
WebLink link = (WebLink) getListAdapter().getItem(position);
startBrowserLink(link.getUrl());
}
use of org.musicbrainz.android.api.data.WebLink in project musicbrainz-android by jdamcd.
the class ReleaseGroupLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("release-group")) {
releaseGroup.setMbid(atts.getValue("id"));
releaseGroup.setType(atts.getValue("type"));
} else if (localName.equals("title")) {
buildString();
} else if (localName.equals("first-release-date")) {
buildString();
} else if (localName.equals("artist")) {
artist = new ReleaseArtist();
artist.setMbid(atts.getValue("id"));
inArtist = true;
} else if (localName.equals("rating")) {
releaseGroup.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
} else if (localName.equals("name")) {
buildString();
} else if (localName.equals("tag")) {
inTag = true;
buildString();
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
} else if (localName.equals("relation")) {
link = new WebLink();
link.setType(atts.getValue("type"));
} else if (localName.equals("target")) {
buildString();
}
}
use of org.musicbrainz.android.api.data.WebLink in project musicbrainz-android by jdamcd.
the class WeblinkAdapter method getView.
public View getView(int position, View convertView, ViewGroup parent) {
View link = convertView;
LinkHolder holder;
if (link == null) {
LayoutInflater inflater = context.getLayoutInflater();
link = inflater.inflate(R.layout.list_link, parent, false);
holder = new LinkHolder(link);
link.setTag(holder);
} else {
holder = (LinkHolder) link.getTag();
}
WebLink linkData = links.get(position);
holder.getLinkTitle().setText(linkData.getPrettyType());
holder.getLink().setText(linkData.getPrettyUrl());
holder.getIcon().setImageResource(findIconForLink(linkData));
return link;
}
use of org.musicbrainz.android.api.data.WebLink in project musicbrainz-android by jdamcd.
the class ArtistLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("artist") && !inArtistRelations) {
artist.setMbid(atts.getValue("id"));
artist.setType(atts.getValue("type"));
} else if (localName.equals("name")) {
buildString();
} else if (localName.equals("tag")) {
inTag = true;
buildString();
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
} else if (localName.equals("rating")) {
artist.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
} else if (localName.equals("country")) {
buildString();
} else if (localName.equals("relation") && inUrlRelations) {
buildString();
link = new WebLink();
link.setType(atts.getValue("type"));
} else if (localName.equals("target")) {
buildString();
} else if (localName.equals("life-span")) {
inLifeSpan = true;
} else if (localName.equals("begin")) {
buildString();
} else if (localName.equals("end")) {
buildString();
} else if (localName.equals("relation-list")) {
setRelationStatus(atts.getValue("target-type"));
} else if (inUnsupported(localName)) {
inUnsupported = true;
}
}
use of org.musicbrainz.android.api.data.WebLink in project musicbrainz-android by jdamcd.
the class LabelLookupHandler method startElement.
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("label")) {
label.setMbid(atts.getValue("id"));
} else if (localName.equals("name") && !inTag) {
buildString();
} else if (localName.equals("tag")) {
inTag = true;
tag = new Tag();
tag.setCount(Integer.parseInt(atts.getValue("count")));
} else if (localName.equals("rating")) {
label.setRatingCount(Integer.parseInt(atts.getValue("votes-count")));
buildString();
} else if (localName.equals("country")) {
buildString();
} else if (localName.equals("begin")) {
buildString();
} else if (localName.equals("end")) {
buildString();
} else if (localName.equals("relation-list")) {
if (atts.getValue("target-type").equals("url")) {
inUrlRelations = true;
}
} else if (localName.equals("relation") && inUrlRelations) {
buildString();
link = new WebLink();
link.setType(atts.getValue("type"));
}
}
Aggregations