mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fix rendering of saved stories in story lists.
This commit is contained in:
parent
625b7a7642
commit
b95e0228bf
5 changed files with 49 additions and 4 deletions
|
@ -54,11 +54,24 @@
|
|||
android:textColor="@color/lightgray"
|
||||
android:textSize="14dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/row_item_saved_icon"
|
||||
android:src="@drawable/clock"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_below="@id/row_item_feedtitle"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/row_item_sidebar"
|
||||
android:layout_toLeftOf="@id/row_item_saved_icon"
|
||||
android:layout_below="@id/row_item_feedicon"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="4dp"
|
||||
|
|
|
@ -35,11 +35,24 @@
|
|||
android:layout_marginRight="7dp"
|
||||
android:layout_centerVertical="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/row_item_saved_icon"
|
||||
android:src="@drawable/clock"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/row_item_sidebar"
|
||||
android:layout_toLeftOf="@id/row_item_saved_icon"
|
||||
android:layout_marginTop="2dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
|
|
|
@ -49,7 +49,9 @@ public class FeedItemsAdapter extends StoryItemsAdapter {
|
|||
borderTwo.setBackgroundColor(Color.LTGRAY);
|
||||
}
|
||||
|
||||
if (! Story.fromCursor(cursor).read) {
|
||||
Story story = Story.fromCursor(cursor);
|
||||
|
||||
if (! story.read) {
|
||||
((TextView) v.findViewById(R.id.row_item_author)).setTextColor(storyAuthorUnread);
|
||||
((TextView) v.findViewById(R.id.row_item_date)).setTextColor(storyDateUnread);
|
||||
((TextView) v.findViewById(R.id.row_item_title)).setTextColor(storyTitleUnread);
|
||||
|
@ -75,6 +77,12 @@ public class FeedItemsAdapter extends StoryItemsAdapter {
|
|||
borderTwo.getBackground().setAlpha(125);
|
||||
}
|
||||
|
||||
if (story.starred) {
|
||||
v.findViewById(R.id.row_item_saved_icon).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
v.findViewById(R.id.row_item_saved_icon).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!PrefsUtils.isShowContentPreviews(context)) {
|
||||
v.findViewById(R.id.row_item_content).setVisibility(View.GONE);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,9 @@ public class MultipleFeedItemsAdapter extends StoryItemsAdapter {
|
|||
borderTwo.setBackgroundColor(Color.LTGRAY);
|
||||
}
|
||||
|
||||
if (this.ignoreReadStatus || (! Story.fromCursor(cursor).read)) {
|
||||
Story story = Story.fromCursor(cursor);
|
||||
|
||||
if (this.ignoreReadStatus || (! story.read)) {
|
||||
((TextView) v.findViewById(R.id.row_item_author)).setTextColor(storyAuthorUnread);
|
||||
((TextView) v.findViewById(R.id.row_item_date)).setTextColor(storyDateUnread);
|
||||
((TextView) v.findViewById(R.id.row_item_feedtitle)).setTextColor(storyFeedUnread);
|
||||
|
@ -95,6 +97,12 @@ public class MultipleFeedItemsAdapter extends StoryItemsAdapter {
|
|||
borderTwo.getBackground().setAlpha(125);
|
||||
}
|
||||
|
||||
if (story.starred) {
|
||||
v.findViewById(R.id.row_item_saved_icon).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
v.findViewById(R.id.row_item_saved_icon).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!PrefsUtils.isShowContentPreviews(context)) {
|
||||
v.findViewById(R.id.row_item_content).setVisibility(View.GONE);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import android.view.View;
|
|||
import com.newsblur.R;
|
||||
import com.newsblur.database.DatabaseConstants;
|
||||
import com.newsblur.database.MultipleFeedItemsAdapter;
|
||||
import com.newsblur.util.FeedUtils;
|
||||
import com.newsblur.view.SocialItemViewBinder;
|
||||
|
||||
public class SavedStoriesItemListFragment extends ItemListFragment {
|
||||
|
@ -34,8 +35,10 @@ public class SavedStoriesItemListFragment extends ItemListFragment {
|
|||
adapter = new MultipleFeedItemsAdapter(getActivity(), R.layout.row_folderitem, cursor, groupFrom, groupTo, true);
|
||||
adapter.setViewBinder(new SocialItemViewBinder(getActivity(), true));
|
||||
itemList.setAdapter(adapter);
|
||||
}
|
||||
super.onLoadFinished(loader, cursor);
|
||||
}
|
||||
super.onLoadFinished(loader, cursor);
|
||||
// every time we see a set of saved stories, tag them so they don't disappear during this reading session
|
||||
FeedUtils.dbHelper.markSavedReadingSession();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue