Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 655e86b4 authored by cketti's avatar cketti
Browse files

Move swipe refresh animation workaround from onPause() to onStop()

onPause() is also called when we don't want the animation to stop, e.g.
when changing the focus to another window in multi window mode.
However, adding a new Fragment will stop the old one. So onStop() is a
better place to cancel the animation.
parent 7c89108c
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -664,13 +664,6 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
        localBroadcastManager.unregisterReceiver(cacheBroadcastReceiver);
        activityListener.onPause(getActivity());
        messagingController.removeListener(activityListener);

        // Workaround for Android bug https://issuetracker.google.com/issues/37008170
        if (swipeRefreshLayout != null) {
            swipeRefreshLayout.setRefreshing(false);
            swipeRefreshLayout.destroyDrawingCache();
            swipeRefreshLayout.clearAnimation();
        }
    }

    /**
@@ -2267,6 +2260,14 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
                Timber.e(e, "Could not abort remote search before going back");
            }
        }

        // Workaround for Android bug https://issuetracker.google.com/issues/37008170
        if (swipeRefreshLayout != null) {
            swipeRefreshLayout.setRefreshing(false);
            swipeRefreshLayout.destroyDrawingCache();
            swipeRefreshLayout.clearAnimation();
        }

        super.onStop();
    }