diff options
author | Sergei Kozelko <KozelkoS@yandex.ru> | 2022-12-23 23:45:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 23:45:10 +0000 |
commit | befc6df1f0088dcee26fec0fb8f3cb614a9b74de (patch) | |
tree | 6914ac9d99814a162080df86375eb85e77663534 /app/src/main/java/ml/docilealligator | |
parent | 5786ac028d7ba2c5cdd98dc67db34036abb13e1b (diff) | |
download | infinity-for-reddit-befc6df1f0088dcee26fec0fb8f3cb614a9b74de.tar infinity-for-reddit-befc6df1f0088dcee26fec0fb8f3cb614a9b74de.tar.gz infinity-for-reddit-befc6df1f0088dcee26fec0fb8f3cb614a9b74de.tar.bz2 infinity-for-reddit-befc6df1f0088dcee26fec0fb8f3cb614a9b74de.tar.lz infinity-for-reddit-befc6df1f0088dcee26fec0fb8f3cb614a9b74de.tar.xz infinity-for-reddit-befc6df1f0088dcee26fec0fb8f3cb614a9b74de.tar.zst infinity-for-reddit-befc6df1f0088dcee26fec0fb8f3cb614a9b74de.zip |
Delete unused isSortingComments field (#1292)
Field value is always false
Diffstat (limited to 'app/src/main/java/ml/docilealligator')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java index c72aacf3..02e2bdd4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -226,7 +226,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic private String mSingleCommentId; private String mContextNumber; private boolean showToast = false; - private boolean isSortingComments = false; private boolean mIsSmoothScrolling = false; private boolean mLockFab; private boolean mSwipeUpToHideFab; @@ -821,7 +820,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic && mSharedPreferences.getBoolean(SharedPreferencesUtils.SAVE_SORT_TYPE, true)) { mSortTypeSharedPreferences.edit().putString(SharedPreferencesUtils.SORT_TYPE_POST_COMMENT, sortType.getType().name()).apply(); } - fetchCommentsRespectRecommendedSort(false, false, sortType.getType()); + fetchCommentsRespectRecommendedSort(false, sortType.getType()); } @NonNull @@ -1429,7 +1428,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic }); } - private void fetchCommentsRespectRecommendedSort(boolean changeRefreshState, boolean checkSortState, SortType.Type sortType) { + private void fetchCommentsRespectRecommendedSort(boolean changeRefreshState, SortType.Type sortType) { if (mRespectSubredditRecommendedSortType && mPost != null) { FetchSubredditData.fetchSubredditData(mOauthRetrofit, mRetrofit, mPost.getSubredditName(), mAccessToken, new FetchSubredditData.FetchSubredditDataListener() { @@ -1445,7 +1444,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } activity.setTitle(sortTypeType.fullName); ViewPostDetailFragment.this.sortType = sortTypeType; - fetchComments(changeRefreshState, checkSortState, ViewPostDetailFragment.this.sortType); + fetchComments(changeRefreshState, ViewPostDetailFragment.this.sortType); } @Override @@ -1457,11 +1456,11 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } }); } else { - fetchComments(changeRefreshState, checkSortState, sortType); + fetchComments(changeRefreshState, sortType); } } - private void fetchComments(boolean changeRefreshState, boolean checkSortState, SortType.Type sortType) { + private void fetchComments(boolean changeRefreshState, SortType.Type sortType) { isFetchingComments = true; mCommentsAdapter.setSingleComment(mSingleCommentId, isSingleCommentThreadMode); mCommentsAdapter.initiallyLoading(); @@ -1476,14 +1475,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic @Override public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, String parentId, ArrayList<String> children) { - if (checkSortState && isSortingComments) { - if (changeRefreshState) { - isRefreshing = false; - } - - return; - } - ViewPostDetailFragment.this.children = children; comments = expandedComments; @@ -1545,13 +1536,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic @Override public void onFetchCommentFailed() { isFetchingComments = false; - if (checkSortState && isSortingComments) { - if (changeRefreshState) { - isRefreshing = false; - } - - return; - } mCommentsAdapter.initiallyLoadCommentsFailed(); if (changeRefreshState) { @@ -1562,7 +1546,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic } private void fetchCommentsRespectRecommendedSort(boolean changeRefreshState) { - fetchCommentsRespectRecommendedSort(changeRefreshState, true, sortType); + fetchCommentsRespectRecommendedSort(changeRefreshState, sortType); } void fetchMoreComments() { |