limit maximum height of flavor images within headlines list
This commit is contained in:
parent
bc380ba3d1
commit
2c370a4d0b
@ -69,6 +69,7 @@ import com.shamanland.fab.ShowHideOnScroll;
|
||||
import org.fox.ttrss.types.Article;
|
||||
import org.fox.ttrss.types.ArticleList;
|
||||
import org.fox.ttrss.types.Feed;
|
||||
import org.fox.ttrss.util.EnlargingImageView;
|
||||
import org.fox.ttrss.util.HeadlinesRequest;
|
||||
import org.jsoup.Jsoup;
|
||||
|
||||
@ -773,6 +774,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
boolean showFlavorImage;
|
||||
private int m_minimumHeightToEmbed;
|
||||
boolean m_youtubeInstalled;
|
||||
private int m_maxFlavorImageHeight;
|
||||
|
||||
public ArticleListAdapter(Context context, int textViewResourceId, ArrayList<Article> items) {
|
||||
super(context, textViewResourceId, items);
|
||||
@ -783,6 +785,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
display.getSize(size);
|
||||
m_minimumHeightToEmbed = size.y/3;
|
||||
|
||||
m_maxFlavorImageHeight = (int)(size.y * 0.8f);
|
||||
|
||||
String headlineMode = m_prefs.getString("headline_mode", "HL_DEFAULT");
|
||||
showFlavorImage = "HL_DEFAULT".equals(headlineMode) || "HL_COMPACT".equals(headlineMode);
|
||||
|
||||
@ -957,6 +961,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
holder.topChangedMessage = v.findViewById(R.id.headlines_row_top_changed);
|
||||
holder.flavorImageOverflow = v.findViewById(R.id.flavor_image_overflow);
|
||||
|
||||
if (holder.flavorImageView != null) {
|
||||
holder.flavorImageView.setMaxHeight(m_maxFlavorImageHeight);
|
||||
}
|
||||
|
||||
v.setTag(holder);
|
||||
|
||||
// http://code.google.com/p/android/issues/detail?id=3414
|
||||
|
Loading…
Reference in New Issue
Block a user