mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Fix post refreshing bug
Fix bug where the whole post disappears after refreshing it.
This commit is contained in:
parent
9d6e15edb7
commit
2fc4020b72
@ -1937,4 +1937,8 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
((TextView) itemView).setTextColor(mColorAccent);
|
((TextView) itemView).setTextColor(mColorAccent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearLoadedComments() {
|
||||||
|
loadedComments.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1408,16 +1408,11 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
public void onFetchSubredditDataSuccess(SubredditData subredditData, int nCurrentOnlineSubscribers) {
|
public void onFetchSubredditDataSuccess(SubredditData subredditData, int nCurrentOnlineSubscribers) {
|
||||||
String suggestedCommentSort = "top";
|
String suggestedCommentSort = "top";
|
||||||
SortType.Type sortTypeType;
|
SortType.Type sortTypeType;
|
||||||
if (suggestedCommentSort == null || suggestedCommentSort.equals("null") || suggestedCommentSort.equals("")) {
|
try {
|
||||||
mRespectSubredditRecommendedSortType = false;
|
sortTypeType = SortType.Type.fromValue(suggestedCommentSort);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
sortTypeType = loadSortType();
|
sortTypeType = loadSortType();
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
sortTypeType = SortType.Type.valueOf(suggestedCommentSort.toUpperCase(Locale.US));
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
sortTypeType = loadSortType();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
activity.setTitle(sortTypeType.fullName);
|
activity.setTitle(sortTypeType.fullName);
|
||||||
ViewPostDetailFragment.this.sortType = sortTypeType;
|
ViewPostDetailFragment.this.sortType = sortTypeType;
|
||||||
@ -1582,6 +1577,8 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
|||||||
mSwipeRefreshLayout.setRefreshing(false);
|
mSwipeRefreshLayout.setRefreshing(false);
|
||||||
|
|
||||||
if (fetchComments) {
|
if (fetchComments) {
|
||||||
|
pages_loaded = 0;
|
||||||
|
mCommentsAdapter.clearLoadedComments();
|
||||||
fetchCommentsRespectRecommendedSort(true);
|
fetchCommentsRespectRecommendedSort(true);
|
||||||
} else {
|
} else {
|
||||||
isRefreshing = false;
|
isRefreshing = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user