From f1030b721e5919a7b00cdcb7cd5d7dfa5ec9874f Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sat, 4 Nov 2023 11:26:19 -0400 Subject: Continue deleting awards related components. --- .../activities/AccountPostsActivity.java | 2 -- .../infinityforreddit/activities/MainActivity.java | 15 +-------------- .../activities/ViewMultiRedditDetailActivity.java | 8 -------- .../activities/ViewSubredditDetailActivity.java | 8 -------- .../activities/ViewUserDetailActivity.java | 8 -------- .../navigationdrawer/PostSectionRecyclerViewAdapter.java | 10 +++------- .../infinityforreddit/post/PostPagingSource.java | 1 - .../settings/CreditsPreferenceFragment.java | 10 ---------- .../infinityforreddit/utils/SharedPreferencesUtils.java | 8 ++------ 9 files changed, 6 insertions(+), 64 deletions(-) (limited to 'app/src/main/java/ml/docilealligator') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountPostsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountPostsActivity.java index d3980735..e66bb9ea 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountPostsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountPostsActivity.java @@ -100,8 +100,6 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect binding.accountPostsToolbar.setTitle(R.string.downvoted); } else if (mUserWhere.equals(PostPagingSource.USER_WHERE_HIDDEN)) { binding.accountPostsToolbar.setTitle(R.string.hidden); - } else if (mUserWhere.equals(PostPagingSource.USER_WHERE_GILDED)) { - binding.accountPostsToolbar.setTitle(R.string.gilded); } setSupportActionBar(binding.accountPostsToolbar); 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 870eb985..8c3148ac 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -521,12 +521,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb startActivity(intent); break; } - case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GILDED: { - Intent intent = new Intent(this, AccountPostsActivity.class); - intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED); - startActivity(intent); - break; - } case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: { if (sectionsPagerAdapter != null) { sectionsPagerAdapter.goBackToTop(); @@ -577,8 +571,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb 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; case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: return R.drawable.ic_keyboard_double_arrow_up_24; default: @@ -809,9 +801,6 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_HIDDEN); } else if (stringId == R.string.account_saved_thing_activity_label) { intent = new Intent(MainActivity.this, AccountSavedThingActivity.class); - } else if (stringId == R.string.gilded) { - intent = new Intent(MainActivity.this, AccountPostsActivity.class); - intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED); } else if (stringId == R.string.light_theme) { mSharedPreferences.edit().putString(SharedPreferencesUtils.THEME_KEY, "0").apply(); AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO); @@ -1709,10 +1698,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb bundle.putString(PostFragment.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_DOWNVOTED); } else if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HIDDEN) { bundle.putString(PostFragment.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_HIDDEN); - } else if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_SAVED) { - bundle.putString(PostFragment.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_SAVED); } else { - bundle.putString(PostFragment.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED); + bundle.putString(PostFragment.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_SAVED); } fragment.setArguments(bundle); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java index 3d72c9cc..0b836895 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewMultiRedditDetailActivity.java @@ -518,12 +518,6 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT startActivity(intent); break; } - case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED: { - Intent intent = new Intent(this, AccountPostsActivity.class); - intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED); - startActivity(intent); - break; - } case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: { if (mFragment instanceof PostFragment) { ((PostFragment) mFragment).goBackToTop(); @@ -575,8 +569,6 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT 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; case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: return R.drawable.ic_keyboard_double_arrow_up_24; default: 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 164817bc..7917a662 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java @@ -702,12 +702,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp startActivity(intent); break; } - case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED: { - Intent intent = new Intent(this, AccountPostsActivity.class); - intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED); - startActivity(intent); - break; - } case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: { if (sectionsPagerAdapter != null) { sectionsPagerAdapter.goBackToTop(); @@ -759,8 +753,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp 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; case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: return R.drawable.ic_keyboard_double_arrow_up_24; default: diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java index 803e0ddf..febce817 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java @@ -993,12 +993,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele startActivity(intent); break; } - case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GILDED: { - Intent intent = new Intent(this, AccountPostsActivity.class); - intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostPagingSource.USER_WHERE_GILDED); - startActivity(intent); - break; - } case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: { if (sectionsPagerAdapter != null) { sectionsPagerAdapter.goBackToTop(); @@ -1050,8 +1044,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele 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; case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP: return R.drawable.ic_keyboard_double_arrow_up_24; default: diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostSectionRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostSectionRecyclerViewAdapter.java index 2d9f7406..82cd08d1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostSectionRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/PostSectionRecyclerViewAdapter.java @@ -22,7 +22,7 @@ public class PostSectionRecyclerViewAdapter extends RecyclerView.Adapter { if (collapsePostSection) { - collapsePostSection = !collapsePostSection; + collapsePostSection = false; notifyItemRangeInserted(holder.getBindingAdapterPosition() + 1, POST_SECTION_ITEMS); } else { - collapsePostSection = !collapsePostSection; + collapsePostSection = true; notifyItemRangeRemoved(holder.getBindingAdapterPosition() + 1, POST_SECTION_ITEMS); } notifyItemChanged(holder.getBindingAdapterPosition()); @@ -103,10 +103,6 @@ public class PostSectionRecyclerViewAdapter extends RecyclerView.Adapter public static final String USER_WHERE_DOWNVOTED = "downvoted"; public static final String USER_WHERE_HIDDEN = "hidden"; public static final String USER_WHERE_SAVED = "saved"; - public static final String USER_WHERE_GILDED = "gilded"; private Executor executor; private Retrofit retrofit; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CreditsPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CreditsPreferenceFragment.java index f6db3220..b56f2b68 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CreditsPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CreditsPreferenceFragment.java @@ -25,7 +25,6 @@ public class CreditsPreferenceFragment extends CustomFontPreferenceFragmentCompa Preference iconForegroundPreference = findPreference(SharedPreferencesUtils.ICON_FOREGROUND_KEY); Preference iconBackgroundPreference = findPreference(SharedPreferencesUtils.ICON_BACKGROUND_KEY); Preference errorImagePreference = findPreference(SharedPreferencesUtils.ERROR_IMAGE_KEY); - Preference gildedIconPreference = findPreference(SharedPreferencesUtils.GILDED_ICON_KEY); Preference crosspostIconPreference = findPreference(SharedPreferencesUtils.CROSSPOST_ICON_KEY); Preference thumbtackIconPreference = findPreference(SharedPreferencesUtils.THUMBTACK_ICON_KEY); Preference bestRocketIconPreference = findPreference(SharedPreferencesUtils.BEST_ROCKET_ICON_KEY); @@ -62,15 +61,6 @@ public class CreditsPreferenceFragment extends CustomFontPreferenceFragmentCompa }); } - if (gildedIconPreference != null) { - gildedIconPreference.setOnPreferenceClickListener(preference -> { - Intent intent = new Intent(activity, LinkResolverActivity.class); - intent.setData(Uri.parse("https://br.flaticon.com/icone-gratis/medalha_1007239")); - startActivity(intent); - return true; - }); - } - if (crosspostIconPreference != null) { crosspostIconPreference.setOnPreferenceClickListener(preference -> { Intent intent = new Intent(activity, LinkResolverActivity.class); 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 0fe8c0ce..56900dd3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -12,7 +12,6 @@ public class SharedPreferencesUtils { public static final String ICON_FOREGROUND_KEY = "icon_foreground"; public static final String ICON_BACKGROUND_KEY = "icon_background"; public static final String ERROR_IMAGE_KEY = "error_image"; - public static final String GILDED_ICON_KEY = "gilded_icon"; public static final String CROSSPOST_ICON_KEY = "crosspost_icon"; public static final String THUMBTACK_ICON_KEY = "thumbtack_icon"; public static final String BEST_ROCKET_ICON_KEY = "best_rocket_icon"; @@ -281,8 +280,7 @@ public class SharedPreferencesUtils { 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_OPTION_GO_TO_TOP = 19; + public static final int MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GO_TO_TOP = 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; @@ -315,9 +313,7 @@ public class SharedPreferencesUtils { 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_OPTION_GO_TO_TOP = 20; - + public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_OPTION_GO_TO_TOP = 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; public static final int OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE = 2; -- cgit v1.2.3