From 77617ba9bf532aa0721c926ffe415ed98e93a953 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Mon, 25 Jun 2018 18:20:45 +0200 Subject: [PATCH] fix crash on timeline reloading --- .../tusky/fragment/TimelineFragment.java | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index 2315821a..e5c7a71a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -136,8 +136,6 @@ public class TimelineFragment extends SFragment implements private boolean filterRemoveRegex; private Matcher filterRemoveRegexMatcher; private boolean hideFab; - private boolean topLoading; - private int topFetches; private boolean bottomLoading; @Nullable @@ -222,12 +220,9 @@ public class TimelineFragment extends SFragment implements setupTimelinePreferences(); setupNothingView(); - topLoading = false; - topFetches = 0; bottomId = null; topId = null; - if (statuses.isEmpty()) { progressBar.setVisibility(View.VISIBLE); bottomLoading = true; @@ -701,7 +696,8 @@ public class TimelineFragment extends SFragment implements private void fullyRefresh() { statuses.clear(); updateAdapter(); - sendFetchTimelineRequest(null, null, FetchEnd.TOP, -1); + bottomLoading = true; + sendFetchTimelineRequest(null, null, FetchEnd.BOTTOM, -1); } private boolean jumpToTopAllowed() { @@ -745,12 +741,6 @@ public class TimelineFragment extends SFragment implements private void sendFetchTimelineRequest(@Nullable String fromId, @Nullable String uptoId, final FetchEnd fetchEnd, final int pos) { - /* If there is a fetch already ongoing, record however many fetches are requested and - * fulfill them after it's complete. */ - if (fetchEnd == FetchEnd.TOP && topLoading) { - topFetches++; - return; - } Callback> callback = new Callback>() { @Override @@ -862,14 +852,6 @@ public class TimelineFragment extends SFragment implements bottomLoading = false; break; } - case TOP: { - topLoading = false; - if (topFetches > 0) { - topFetches--; - onRefresh(); - } - break; - } } }