本文整理匯總了Java中io.plaidapp.data.api.dribbble.model.Images類的典型用法代碼示例。如果您正苦於以下問題:Java Images類的具體用法?Java Images怎麽用?Java Images使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Images類屬於io.plaidapp.data.api.dribbble.model包,在下文中一共展示了Images類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseShot
import io.plaidapp.data.api.dribbble.model.Images; //導入依賴的package包/類
private static Shot parseShot(Element element, SimpleDateFormat dateFormat) {
final Element descriptionBlock = element.select("a.dribbble-over").first();
// API responses wrap description in a <p> tag. Do the same for consistent display.
String description = descriptionBlock.select("span.comment").text().trim();
if (!TextUtils.isEmpty(description)) {
description = "<p>" + description + "</p>";
}
String imgUrl = element.select("img").first().attr("src");
if (imgUrl.contains("_teaser.")) {
imgUrl = imgUrl.replace("_teaser.", ".");
}
Date createdAt = null;
try {
createdAt = dateFormat.parse(descriptionBlock.select("em.timestamp").first().text());
} catch (ParseException e) { }
return new Shot.Builder()
.setId(Long.parseLong(element.id().replace("screenshot-", "")))
.setHtmlUrl(HOST + element.select("a.dribbble-link").first().attr("href"))
.setTitle(descriptionBlock.select("strong").first().text())
.setDescription(description)
.setImages(new Images(null, imgUrl, null))
.setAnimated(element.select("div.gif-indicator").first() != null)
.setCreatedAt(createdAt)
.setLikesCount(Long.parseLong(element.select("li.fav").first().child(0).text()
.replaceAll(",", "")))
.setCommentsCount(Long.parseLong(element.select("li.cmnt").first().child(0).text
().replaceAll(",", "")))
.setViewsCount(Long.parseLong(element.select("li.views").first().child(0)
.text().replaceAll(",", "")))
.setUser(parsePlayer(element.select("h2").first()))
.build();
}