diff options
3 files changed, 37 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index 18955498..98e2306b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -1457,6 +1457,33 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb bundle.putString(PostFragment.EXTRA_ACCOUNT_NAME, mAccountName); fragment.setArguments(bundle); return fragment; + } else if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_UPVOTED + || postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_DOWNVOTED + || postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HIDDEN + || postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SAVED + || postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_GILDED) { + PostFragment fragment = new PostFragment(); + Bundle bundle = new Bundle(); + bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostDataSource.TYPE_USER); + bundle.putString(PostFragment.EXTRA_USER_NAME, mAccountName); + bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken); + bundle.putString(PostFragment.EXTRA_ACCOUNT_NAME, mAccountName); + bundle.putBoolean(PostFragment.EXTRA_DISABLE_READ_POSTS, true); + + if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_UPVOTED) { + bundle.putString(PostFragment.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_UPVOTED); + } else if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_DOWNVOTED) { + bundle.putString(PostFragment.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_DOWNVOTED); + } else if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HIDDEN) { + bundle.putString(PostFragment.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_HIDDEN); + } else if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SAVED) { + bundle.putString(PostFragment.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_SAVED); + } else { + bundle.putString(PostFragment.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_GILDED); + } + + fragment.setArguments(bundle); + return fragment; } else { PostFragment fragment = new PostFragment(); Bundle bundle = new Bundle(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java index be8489a9..5670b82f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -188,6 +188,11 @@ public class SharedPreferencesUtils { public static final int MAIN_PAGE_TAB_POST_TYPE_SUBREDDIT = 3; public static final int MAIN_PAGE_TAB_POST_TYPE_MULTIREDDIT = 4; public static final int MAIN_PAGE_TAB_POST_TYPE_USER = 5; + public static final int MAIN_PAGE_TAB_POST_TYPE_UPVOTED = 6; + public static final int MAIN_PAGE_TAB_POST_TYPE_DOWNVOTED = 7; + public static final int MAIN_PAGE_TAB_POST_TYPE_HIDDEN = 8; + public static final int MAIN_PAGE_TAB_POST_TYPE_SAVED = 9; + public static final int MAIN_PAGE_TAB_POST_TYPE_GILDED = 10; public static final String MAIN_PAGE_SHOW_SUBSCRIBED_SUBREDDITS = "_main_page_show_subscribed_subreddits"; public static final String MAIN_PAGE_SHOW_FAVORITE_SUBSCRIBED_SUBREDDITS = "_main_page_show_favorite_subscribed_subreddits"; diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 132c8cbc..cb475059 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -172,6 +172,11 @@ <item>Subreddit</item> <item>MultiReddit</item> <item>User</item> + <item>Upvoted</item> + <item>Downvoted</item> + <item>Hidden</item> + <item>Saved</item> + <item>Gilded</item> </string-array> <string-array name="settings_time_format"> |