mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
#1458 Story thumbnail previews
This commit is contained in:
parent
d0179945b3
commit
103e92b14c
3 changed files with 11 additions and 7 deletions
|
@ -41,7 +41,6 @@
|
|||
android:layout_marginTop="1dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
|
@ -51,7 +50,6 @@
|
|||
android:layout_marginTop="1dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:layout_toRightOf="@id/story_item_favicon_borderbar_2"
|
||||
android:layout_centerVertical="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="thumbnails_small_size">50dp</dimen>
|
||||
<dimen name="thumbnails_size">90dp</dimen>
|
||||
<dimen name="thumbnails_small_size">54dp</dimen>
|
||||
<dimen name="thumbnails_size">120dp</dimen>
|
||||
<dimen name="extra_line_spacing">4dp</dimen>
|
||||
</resources>
|
|
@ -557,14 +557,16 @@ public class StoryViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
// the view will display a stale, recycled thumb before the new one loads if the old is not cleared
|
||||
if (thumbnailStyle == ThumbnailStyle.LEFT_LARGE || thumbnailStyle == ThumbnailStyle.LEFT_SMALL) {
|
||||
int thumbSizeGuess = vh.thumbViewLeft.getMeasuredHeight();
|
||||
boolean roundCorners = thumbnailStyle == ThumbnailStyle.LEFT_SMALL;
|
||||
vh.thumbViewLeft.setImageDrawable(null);
|
||||
vh.thumbLoader = FeedUtils.thumbnailLoader.displayImage(story.thumbnailUrl, vh.thumbViewLeft, 0, true, thumbSizeGuess, true);
|
||||
vh.thumbLoader = FeedUtils.thumbnailLoader.displayImage(story.thumbnailUrl, vh.thumbViewLeft, roundCorners, true, thumbSizeGuess, true);
|
||||
vh.thumbViewRight.setVisibility(View.GONE);
|
||||
vh.thumbViewLeft.setVisibility(View.VISIBLE);
|
||||
} else if (thumbnailStyle == ThumbnailStyle.RIGHT_LARGE || thumbnailStyle == ThumbnailStyle.RIGHT_SMALL) {
|
||||
int thumbSizeGuess = vh.thumbViewRight.getMeasuredHeight();
|
||||
boolean roundCorners = thumbnailStyle == ThumbnailStyle.RIGHT_SMALL;
|
||||
vh.thumbViewRight.setImageDrawable(null);
|
||||
vh.thumbLoader = FeedUtils.thumbnailLoader.displayImage(story.thumbnailUrl, vh.thumbViewRight, 0, true, thumbSizeGuess, true);
|
||||
vh.thumbLoader = FeedUtils.thumbnailLoader.displayImage(story.thumbnailUrl, vh.thumbViewRight, roundCorners, true, thumbSizeGuess, true);
|
||||
vh.thumbViewLeft.setVisibility(View.GONE);
|
||||
vh.thumbViewRight.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
@ -598,7 +600,7 @@ public class StoryViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
|
||||
// lists with mixed feeds get added info, but single feeds do not
|
||||
if (!singleFeed) {
|
||||
FeedUtils.iconLoader.displayImage(story.extern_faviconUrl, vh.feedIconView, 0, false);
|
||||
FeedUtils.iconLoader.displayImage(story.extern_faviconUrl, vh.feedIconView, false, false);
|
||||
vh.feedTitleView.setText(story.extern_feedTitle);
|
||||
vh.feedIconView.setVisibility(View.VISIBLE);
|
||||
vh.feedTitleView.setVisibility(View.VISIBLE);
|
||||
|
@ -699,6 +701,10 @@ public class StoryViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold
|
|||
params.height = sizeDp;
|
||||
params.width = sizeDp;
|
||||
}
|
||||
if (params != null && (thumbnailStyle == ThumbnailStyle.RIGHT_SMALL || thumbnailStyle == ThumbnailStyle.LEFT_SMALL)) {
|
||||
params.addRule(RelativeLayout.CENTER_VERTICAL);
|
||||
params.setMarginStart(UIUtils.dp2px(context, 8));
|
||||
}
|
||||
|
||||
if (this.ignoreReadStatus || (! story.read)) {
|
||||
vh.storyAuthor.setAlpha(1.0f);
|
||||
|
|
Loading…
Add table
Reference in a new issue