From ae20f7ba7799c8cd773e0f101afeb2ba73609a1c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Nov 2014 20:04:03 +0400 Subject: [PATCH] consider img size attributes when choosing flavor image --- org.fox.ttrss/src/main/AndroidManifest.xml | 2 +- .../java/org/fox/ttrss/HeadlinesFragment.java | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index 88bc3cbd..3ca478ba 100644 --- a/org.fox.ttrss/src/main/AndroidManifest.xml +++ b/org.fox.ttrss/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ FLAVOR_IMG_MIN_WIDTH && Integer.valueOf(tmp.attr("width")) > FLAVOR_IMG_MIN_HEIGHT) { + img = tmp; + break; + } + } catch (NumberFormatException e) { + // + } + } + + if (img == null) + img = imgs.first(); if (img != null) { String imgSrc = img.attr("src"); @@ -879,7 +896,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, flavorImageLoadingBar.setVisibility(View.INVISIBLE); - if (arg2.getWidth() > 128 && arg2.getHeight() > 128) { + if (arg2.getWidth() > FLAVOR_IMG_MIN_WIDTH && arg2.getHeight() > FLAVOR_IMG_MIN_HEIGHT) { if (!m_activity.isCompatMode() && weNeedAnimation) { ObjectAnimator anim = ObjectAnimator.ofFloat(flavorImageView, "alpha", 0f, 1f);