aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java45
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java45
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java10
-rw-r--r--app/src/main/res/values/arrays.xml10
4 files changed, 110 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 1cf15575..0ea37503 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java
@@ -469,6 +469,41 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
sectionsPagerAdapter.filterPosts();
}
break;
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_UPVOTED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(MainActivity.this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_UPVOTED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_DOWNVOTED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(MainActivity.this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_DOWNVOTED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_HIDDEN: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(MainActivity.this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_HIDDEN);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SAVED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(MainActivity.this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_SAVED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GILDED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(MainActivity.this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_GILDED);
+ startActivity(intent);
+ break;
+ }
default:
PostTypeBottomSheetFragment postTypeBottomSheetFragment = new PostTypeBottomSheetFragment();
postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag());
@@ -505,6 +540,16 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
return R.drawable.ic_hide_read_posts_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_FILTER_POSTS:
return R.drawable.ic_filter_24dp;
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_UPVOTED:
+ return R.drawable.ic_arrow_upward_black_24dp;
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_DOWNVOTED:
+ return R.drawable.ic_arrow_downward_black_24dp;
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_HIDDEN:
+ return R.drawable.ic_outline_lock_24dp;
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SAVED:
+ return R.drawable.ic_outline_bookmarks_24dp;
+ case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GILDED:
+ return R.drawable.ic_star_border_24dp;
default:
return R.drawable.ic_account_circle_24dp;
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
index e0a9ab7a..981f4d75 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
@@ -599,6 +599,41 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
sectionsPagerAdapter.filterPosts();
}
break;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_UPVOTED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_UPVOTED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_DOWNVOTED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_DOWNVOTED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDDEN: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_HIDDEN);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SAVED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_SAVED);
+ startActivity(intent);
+ break;
+ }
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED: {
+ Intent intent = new Intent(this, AccountPostsActivity.class);
+ intent = new Intent(this, AccountPostsActivity.class);
+ intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_GILDED);
+ startActivity(intent);
+ break;
+ }
default:
PostTypeBottomSheetFragment postTypeBottomSheetFragment = new PostTypeBottomSheetFragment();
postTypeBottomSheetFragment.show(getSupportFragmentManager(), postTypeBottomSheetFragment.getTag());
@@ -636,6 +671,16 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
return R.drawable.ic_hide_read_posts_24dp;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_FILTER_POSTS:
return R.drawable.ic_filter_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_UPVOTED:
+ return R.drawable.ic_arrow_upward_black_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_DOWNVOTED:
+ return R.drawable.ic_arrow_downward_black_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDDEN:
+ return R.drawable.ic_outline_lock_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SAVED:
+ return R.drawable.ic_outline_bookmarks_24dp;
+ case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED:
+ return R.drawable.ic_star_border_24dp;
default:
return R.drawable.ic_account_circle_24dp;
}
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 48714674..2aeb34c6 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
@@ -232,6 +232,11 @@ public class SharedPreferencesUtils {
public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_RANDOM = 11;
public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_HIDE_READ_POSTS = 12;
public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_FILTER_POSTS = 13;
+ public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_UPVOTED = 14;
+ public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_DOWNVOTED = 15;
+ public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_HIDDEN = 16;
+ public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SAVED = 17;
+ public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GILDED = 18;
public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS = 0;
public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_REFRESH = 1;
@@ -259,6 +264,11 @@ public class SharedPreferencesUtils {
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_RANDOM = 12;
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDE_READ_POSTS = 13;
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_FILTER_POSTS = 14;
+ public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_UPVOTED = 15;
+ public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_DOWNVOTED = 16;
+ public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_HIDDEN = 17;
+ public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_SAVED = 18;
+ public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED = 19;
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS = 0;
public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH = 1;
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 38311b43..8ce201ef 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -261,6 +261,11 @@
<item>@string/random</item>
<item>@string/hide_read_posts</item>
<item>@string/filter_posts</item>
+ <item>@string/upvoted</item>
+ <item>@string/downvoted</item>
+ <item>@string/hidden</item>
+ <item>@string/saved</item>
+ <item>@string/gilded</item>
</string-array>
<string-array name="settings_other_activities_bottom_app_bar_options">
@@ -279,6 +284,11 @@
<item>@string/random</item>
<item>@string/hide_read_posts</item>
<item>@string/filter_posts</item>
+ <item>@string/upvoted</item>
+ <item>@string/downvoted</item>
+ <item>@string/hidden</item>
+ <item>@string/saved</item>
+ <item>@string/gilded</item>
</string-array>
<string-array name="settings_bottom_app_bar_fab_options">