mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Remove unnecessary DB fetch from FeedReading.
This commit is contained in:
parent
ad9525daf7
commit
c4265eee69
3 changed files with 6 additions and 10 deletions
|
@ -18,22 +18,18 @@ import com.newsblur.util.StoryOrder;
|
|||
|
||||
public class FeedReading extends Reading {
|
||||
|
||||
String feedId;
|
||||
Feed feed;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
feed = (Feed) getIntent().getSerializableExtra(EXTRA_FEED);
|
||||
super.onCreate(savedInstanceBundle);
|
||||
|
||||
feedId = getIntent().getStringExtra(Reading.EXTRA_FEED);
|
||||
|
||||
Uri classifierUri = FeedProvider.CLASSIFIER_URI.buildUpon().appendPath(feedId).build();
|
||||
Uri classifierUri = FeedProvider.CLASSIFIER_URI.buildUpon().appendPath(feed.feedId).build();
|
||||
Cursor feedClassifierCursor = contentResolver.query(classifierUri, null, null, null, null);
|
||||
Classifier classifier = Classifier.fromCursor(feedClassifierCursor);
|
||||
feedClassifierCursor.close();
|
||||
|
||||
Uri feedUri = FeedProvider.FEEDS_URI.buildUpon().appendPath(feedId).build();
|
||||
Cursor feedCursor = contentResolver.query(feedUri, null, null, null, null);
|
||||
Feed feed = Feed.fromCursor(feedCursor);
|
||||
feedCursor.close();
|
||||
setTitle(feed.title);
|
||||
|
||||
readingAdapter = new FeedReadingAdapter(fragmentManager, feed, classifier, defaultFeedView);
|
||||
|
|
|
@ -50,7 +50,7 @@ import com.newsblur.view.NonfocusScrollview.ScrollChangeListener;
|
|||
public abstract class Reading extends NbActivity implements OnPageChangeListener, OnSeekBarChangeListener, ScrollChangeListener, LoaderManager.LoaderCallbacks<Cursor> {
|
||||
|
||||
public static final String EXTRA_FEEDSET = "feed_set";
|
||||
public static final String EXTRA_FEED = "feed_selected";
|
||||
public static final String EXTRA_FEED = "feed";
|
||||
public static final String EXTRA_POSITION = "feed_position";
|
||||
public static final String EXTRA_USERID = "user_id";
|
||||
public static final String EXTRA_USERNAME = "username";
|
||||
|
|
|
@ -90,7 +90,7 @@ public class FeedItemListFragment extends ItemListFragment implements OnItemClic
|
|||
if (getActivity().isFinishing()) return;
|
||||
Intent i = new Intent(getActivity(), FeedReading.class);
|
||||
i.putExtra(Reading.EXTRA_FEEDSET, getFeedSet());
|
||||
i.putExtra(Reading.EXTRA_FEED, feed.feedId);
|
||||
i.putExtra(Reading.EXTRA_FEED, feed);
|
||||
i.putExtra(FeedReading.EXTRA_POSITION, position);
|
||||
i.putExtra(ItemsList.EXTRA_STATE, currentState);
|
||||
i.putExtra(Reading.EXTRA_DEFAULT_FEED_VIEW, defaultFeedView);
|
||||
|
|
Loading…
Add table
Reference in a new issue