mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-21 05:45:13 +00:00
Fixes for navigating to saved story.
This commit is contained in:
parent
f350f81187
commit
ac79788e45
2 changed files with 10 additions and 7 deletions
|
@ -133,7 +133,11 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
|
||||||
startingUnreadCount = savedInstanceBundle.getInt(BUNDLE_STARTING_UNREAD);
|
startingUnreadCount = savedInstanceBundle.getInt(BUNDLE_STARTING_UNREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only use the storyHash the first time the activity is loaded. Ignore when
|
||||||
|
// recreated due to rotation etc.
|
||||||
|
if (savedInstanceBundle == null) {
|
||||||
storyHash = getIntent().getStringExtra(EXTRA_STORY_HASH);
|
storyHash = getIntent().getStringExtra(EXTRA_STORY_HASH);
|
||||||
|
}
|
||||||
|
|
||||||
currentState = (StateFilter) getIntent().getSerializableExtra(ItemsList.EXTRA_STATE);
|
currentState = (StateFilter) getIntent().getSerializableExtra(ItemsList.EXTRA_STATE);
|
||||||
storyOrder = PrefsUtils.getStoryOrder(this, fs);
|
storyOrder = PrefsUtils.getStoryOrder(this, fs);
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.newsblur.network.domain.ActivitiesResponse;
|
||||||
import com.newsblur.util.DefaultFeedView;
|
import com.newsblur.util.DefaultFeedView;
|
||||||
import com.newsblur.util.FeedSet;
|
import com.newsblur.util.FeedSet;
|
||||||
import com.newsblur.util.FeedUtils;
|
import com.newsblur.util.FeedUtils;
|
||||||
|
import com.newsblur.util.PrefConstants;
|
||||||
import com.newsblur.util.PrefsUtils;
|
import com.newsblur.util.PrefsUtils;
|
||||||
import com.newsblur.view.ActivitiesAdapter;
|
import com.newsblur.view.ActivitiesAdapter;
|
||||||
import com.newsblur.view.ProgressThrobber;
|
import com.newsblur.view.ProgressThrobber;
|
||||||
|
@ -118,13 +119,12 @@ public class ProfileActivityFragment extends Fragment implements AdapterView.OnI
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
|
||||||
ActivityDetails activity = adapter.getItem(position);
|
ActivityDetails activity = adapter.getItem(position);
|
||||||
if (activity.category == Category.FOLLOW) {
|
|
||||||
Context context = getActivity();
|
Context context = getActivity();
|
||||||
|
if (activity.category == Category.FOLLOW) {
|
||||||
Intent i = new Intent(context, Profile.class);
|
Intent i = new Intent(context, Profile.class);
|
||||||
i.putExtra(Profile.USER_ID, activity.id);
|
i.putExtra(Profile.USER_ID, activity.id);
|
||||||
context.startActivity(i);
|
context.startActivity(i);
|
||||||
} else if (activity.category == Category.FEED_SUBSCRIPTION) {
|
} else if (activity.category == Category.FEED_SUBSCRIPTION) {
|
||||||
Context context = getActivity();
|
|
||||||
Feed feed = FeedUtils.getFeed(activity.feedId);
|
Feed feed = FeedUtils.getFeed(activity.feedId);
|
||||||
if (feed == null) {
|
if (feed == null) {
|
||||||
Toast.makeText(context, R.string.profile_feed_not_available, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.profile_feed_not_available, Toast.LENGTH_SHORT).show();
|
||||||
|
@ -135,13 +135,12 @@ public class ProfileActivityFragment extends Fragment implements AdapterView.OnI
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
} else if (activity.category == Category.STAR) {
|
} else if (activity.category == Category.STAR) {
|
||||||
Intent i = new Intent(getActivity(), SavedStoriesReading.class);
|
Intent i = new Intent(context, SavedStoriesReading.class);
|
||||||
i.putExtra(Reading.EXTRA_FEEDSET, FeedSet.allSaved());
|
i.putExtra(Reading.EXTRA_FEEDSET, FeedSet.allSaved());
|
||||||
// TODO what if story doesn't exist?
|
// TODO what if story doesn't exist?
|
||||||
i.putExtra(Reading.EXTRA_STORY_HASH, activity.storyHash);
|
i.putExtra(Reading.EXTRA_STORY_HASH, activity.storyHash);
|
||||||
//TODO real DefaultFeedView
|
i.putExtra(Reading.EXTRA_DEFAULT_FEED_VIEW, PrefsUtils.getDefaultFeedViewForFolder(context, PrefConstants.SAVED_STORIES_FOLDER_NAME));
|
||||||
i.putExtra(Reading.EXTRA_DEFAULT_FEED_VIEW, DefaultFeedView.STORY);
|
context.startActivity(i);
|
||||||
startActivity(i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue