headlines: add (disabled) code to fix height of all images to 0.5 * screenHeight

This commit is contained in:
Andrew Dolgov 2017-06-04 11:03:29 +03:00
parent b7b78767a2
commit a3f47ebeab

View File

@ -1173,11 +1173,10 @@ public class HeadlinesFragment extends Fragment {
} }
//Log.d(TAG, "IMG: " + article.flavorImageUri + " STREAM: " + article.flavorStreamUri); //Log.d(TAG, "IMG: " + article.flavorImageUri + " STREAM: " + article.flavorStreamUri);
//Log.d(TAG, "TAG:" + holder.flavorImageOverflow.getTag());
holder.flavorImageView.setVisibility(View.VISIBLE); holder.flavorImageView.setVisibility(View.VISIBLE);
//Log.d(TAG, "TAG:" + holder.flavorImageOverflow.getTag());
if (!article.flavorImageUri.equals(holder.flavorImageOverflow.getTag())) { if (!article.flavorImageUri.equals(holder.flavorImageOverflow.getTag())) {
//holder.flavorImageLoadingBar.setVisibility(View.VISIBLE); //holder.flavorImageLoadingBar.setVisibility(View.VISIBLE);
//holder.flavorImageLoadingBar.setIndeterminate(true); //holder.flavorImageLoadingBar.setIndeterminate(true);
@ -1185,6 +1184,14 @@ public class HeadlinesFragment extends Fragment {
holder.flavorImageView.setMaxHeight((int)(m_screenHeight * 0.8f)); holder.flavorImageView.setMaxHeight((int)(m_screenHeight * 0.8f));
holder.flavorProgressTarget.setModel(article.flavorImageUri); 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) Glide.with(HeadlinesFragment.this)
.load(article.flavorImageUri) .load(article.flavorImageUri)
.dontAnimate() .dontAnimate()
@ -1214,13 +1221,14 @@ public class HeadlinesFragment extends Fragment {
boolean forceDown = article.flavorImage != null && "video".equals(article.flavorImage.tagName().toLowerCase()); 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); adjustVideoKindView(holder, article);
return false; return false;
} else { } else {
holder.flavorImageOverflow.setVisibility(View.GONE); holder.flavorImageOverflow.setVisibility(View.GONE);
holder.flavorImageView.setVisibility(View.GONE);
return true; return true;
} }