From a3f47ebeab0c4e298aa9d9343f1a44ef8aac18c3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 4 Jun 2017 11:03:29 +0300 Subject: [PATCH] headlines: add (disabled) code to fix height of all images to 0.5 * screenHeight --- .../main/java/org/fox/ttrss/HeadlinesFragment.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index a3e58bb9..3ecce44a 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -1173,11 +1173,10 @@ public class HeadlinesFragment extends Fragment { } //Log.d(TAG, "IMG: " + article.flavorImageUri + " STREAM: " + article.flavorStreamUri); + //Log.d(TAG, "TAG:" + holder.flavorImageOverflow.getTag()); holder.flavorImageView.setVisibility(View.VISIBLE); - //Log.d(TAG, "TAG:" + holder.flavorImageOverflow.getTag()); - if (!article.flavorImageUri.equals(holder.flavorImageOverflow.getTag())) { //holder.flavorImageLoadingBar.setVisibility(View.VISIBLE); //holder.flavorImageLoadingBar.setIndeterminate(true); @@ -1185,6 +1184,14 @@ public class HeadlinesFragment extends Fragment { holder.flavorImageView.setMaxHeight((int)(m_screenHeight * 0.8f)); holder.flavorProgressTarget.setModel(article.flavorImageUri); + /* TODO: maybe an option? force height for all images to reduce list jumping around + + RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) holder.flavorImageView.getLayoutParams(); + lp.height = (int)(m_screenHeight * 0.5f); + lp.addRule(RelativeLayout.BELOW, R.id.headline_header); + holder.flavorImageView.setLayoutParams(lp); + */ + Glide.with(HeadlinesFragment.this) .load(article.flavorImageUri) .dontAnimate() @@ -1214,13 +1221,14 @@ public class HeadlinesFragment extends Fragment { boolean forceDown = article.flavorImage != null && "video".equals(article.flavorImage.tagName().toLowerCase()); - maybeRepositionFlavorImage(holder.flavorImageView, resource, holder, forceDown); + //maybeRepositionFlavorImage(holder.flavorImageView, resource, holder, forceDown); adjustVideoKindView(holder, article); return false; } else { holder.flavorImageOverflow.setVisibility(View.GONE); + holder.flavorImageView.setVisibility(View.GONE); return true; }