minor thumbnail fixes
This commit is contained in:
parent
8207b3a1f8
commit
3599b91766
@ -860,20 +860,30 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
if (showFlavorImage && article.flavorImage == null) {
|
if (showFlavorImage && article.flavorImage == null) {
|
||||||
|
|
||||||
Elements imgs = article.articleDoc.select("img");
|
Elements imgs = article.articleDoc.select("img");
|
||||||
|
Element firstImg = null;
|
||||||
|
|
||||||
for (Element tmp : imgs) {
|
for (Element tmp : imgs) {
|
||||||
try {
|
try {
|
||||||
|
if (tmp.attr("src") != null && tmp.attr("src").indexOf("data:") == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (firstImg != null) firstImg = tmp;
|
||||||
|
|
||||||
if (Integer.valueOf(tmp.attr("width")) > FLAVOR_IMG_MIN_WIDTH && Integer.valueOf(tmp.attr("width")) > FLAVOR_IMG_MIN_HEIGHT) {
|
if (Integer.valueOf(tmp.attr("width")) > FLAVOR_IMG_MIN_WIDTH && Integer.valueOf(tmp.attr("width")) > FLAVOR_IMG_MIN_HEIGHT) {
|
||||||
article.flavorImage = tmp;
|
article.flavorImage = tmp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.d(TAG, "" + firstImg);
|
||||||
|
|
||||||
if (article.flavorImage == null)
|
if (article.flavorImage == null)
|
||||||
article.flavorImage = imgs.first();
|
article.flavorImage = firstImg;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.textImage != null) {
|
if (holder.textImage != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user