diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapterNew.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapterNew.java index 32c7a038..5655b492 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapterNew.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapterNew.java @@ -476,7 +476,7 @@ public class PostDetailRecyclerViewAdapterNew extends RecyclerView.Adapter if (loadParams.getKey() == null) { boolean savePostFeedScrolledPosition = sortType != null && sortType.getType() == SortType.Type.BEST && sharedPreferences.getBoolean(SharedPreferencesUtils.SAVE_FRONT_PAGE_SCROLLED_POSITION, false); if (savePostFeedScrolledPosition) { - String accountNameForCache = accountName.equals(Account.ANONYMOUS_ACCOUNT) ? SharedPreferencesUtils.FRONT_PAGE_SCROLLED_POSITION_ANONYMOUS : accountName; + String accountNameForCache = Account.ANONYMOUS_ACCOUNT.equals(accountName) ? SharedPreferencesUtils.FRONT_PAGE_SCROLLED_POSITION_ANONYMOUS : accountName; afterKey = postFeedScrolledPositionSharedPreferences.getString(accountNameForCache + SharedPreferencesUtils.FRONT_PAGE_SCROLLED_POSITION_FRONT_PAGE_BASE, null); } else { afterKey = null; @@ -334,7 +334,7 @@ public class PostPagingSource extends ListenableFuturePagingSource private ListenableFuture> loadSubredditPosts(@NonNull LoadParams loadParams, RedditAPI api) { ListenableFuture> subredditPost; - if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) { + if (Account.ANONYMOUS_ACCOUNT.equals(accountName)) { subredditPost = api.getSubredditBestPostsListenableFuture(subredditOrUserName, sortType.getType(), sortType.getTime(), loadParams.getKey(), APIUtils.subredditAPICallLimit(subredditOrUserName)); } else { @@ -355,7 +355,7 @@ public class PostPagingSource extends ListenableFuturePagingSource private ListenableFuture> loadUserPosts(@NonNull LoadParams loadParams, RedditAPI api) { ListenableFuture> userPosts; - if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) { + if (Account.ANONYMOUS_ACCOUNT.equals(accountName)) { userPosts = api.getUserPostsListenableFuture(subredditOrUserName, loadParams.getKey(), sortType.getType(), sortType.getTime()); } else { @@ -376,7 +376,7 @@ public class PostPagingSource extends ListenableFuturePagingSource private ListenableFuture> loadSearchPosts(@NonNull LoadParams loadParams, RedditAPI api) { ListenableFuture> searchPosts; if (subredditOrUserName == null) { - if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) { + if (Account.ANONYMOUS_ACCOUNT.equals(accountName)) { searchPosts = api.searchPostsListenableFuture(query, loadParams.getKey(), sortType.getType(), sortType.getTime(), trendingSource); } else { @@ -384,7 +384,7 @@ public class PostPagingSource extends ListenableFuturePagingSource sortType.getTime(), trendingSource, APIUtils.getOAuthHeader(accessToken)); } } else { - if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) { + if (Account.ANONYMOUS_ACCOUNT.equals(accountName)) { searchPosts = api.searchPostsInSpecificSubredditListenableFuture(subredditOrUserName, query, sortType.getType(), sortType.getTime(), loadParams.getKey()); } else { @@ -406,7 +406,7 @@ public class PostPagingSource extends ListenableFuturePagingSource private ListenableFuture> loadMultiRedditPosts(@NonNull LoadParams loadParams, RedditAPI api) { ListenableFuture> multiRedditPosts; - if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) { + if (Account.ANONYMOUS_ACCOUNT.equals(accountName)) { if (query != null && !query.isEmpty()) { multiRedditPosts = api.searchMultiRedditPostsListenableFuture(multiRedditPath, query, loadParams.getKey(), sortType.getType(), sortType.getTime());