Browse Source

Unread bug fix

pull/54/head
Ezerous 6 years ago
parent
commit
6a619ef878
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 18
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

18
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

@ -102,14 +102,11 @@ public class UnreadFragment extends BaseFragment {
if (rootView instanceof RelativeLayout) {
progressBar = rootView.findViewById(R.id.progressBar);
unreadAdapter = new UnreadAdapter(topicSummaries,
fragmentInteractionListener, new UnreadAdapter.MarkReadInteractionListener() {
@Override
public void onMarkReadInteraction(String markReadLinkUrl) {
fragmentInteractionListener, markReadLinkUrl -> {
if (markReadTask != null && markReadTask.getStatus() != AsyncTask.Status.RUNNING) {
markReadTask = new MarkReadTask();
markReadTask.execute(markReadLinkUrl);
}
}
});
CustomRecyclerView recyclerView = rootView.findViewById(R.id.list);
@ -124,9 +121,7 @@ public class UnreadFragment extends BaseFragment {
swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.primary);
swipeRefreshLayout.setColorSchemeResources(R.color.accent);
swipeRefreshLayout.setOnRefreshListener(
new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
() -> {
if (unreadTask != null && unreadTask.getStatus() != AsyncTask.Status.RUNNING) {
topicSummaries.clear();
numberOfPages = 0;
@ -136,8 +131,6 @@ public class UnreadFragment extends BaseFragment {
unreadTask.execute(SessionManager.unreadUrl.toString());
}
}
}
);
}
@ -237,7 +230,12 @@ public class UnreadFragment extends BaseFragment {
assert SessionManager.unreadUrl != null;
unreadTask.execute(SessionManager.unreadUrl.toString() + ";start=" + loadedPages * 20);
}
else {
progressBar.setVisibility(ProgressBar.INVISIBLE);
swipeRefreshLayout.setRefreshing(false);
}
}
else{
progressBar.setVisibility(ProgressBar.INVISIBLE);
swipeRefreshLayout.setRefreshing(false);
}

Loading…
Cancel
Save