From 4dec8b2b761a5135be749e557edd562463da775d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 18 Sep 2014 14:41:24 +0200 Subject: [PATCH] Stop refreshing after all keys have been updated --- .../sufficientlysecure/keychain/ui/KeyListFragment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index ffcb1955b..4891ab63a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -135,13 +135,14 @@ public class KeyListFragment extends LoaderFragment mSwipeRefreshLayout.setOnRefreshListener(new NoScrollableSwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { - KeyUpdateHelper updateHelper = new KeyUpdateHelper(); KeychainIntentServiceHandler finishedHandler = new KeychainIntentServiceHandler(getActivity()) { public void handleMessage(Message message) { - mSwipeRefreshLayout.setRefreshing(false); + if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { + mSwipeRefreshLayout.setRefreshing(false); + } } }; - updateHelper.updateAllKeys(getActivity(), finishedHandler); + new KeyUpdateHelper().updateAllKeys(getActivity(), finishedHandler); updateActionbarForSwipe(false); } }); @@ -158,7 +159,6 @@ public class KeyListFragment extends LoaderFragment updateActionbarForSwipe(true); } else { updateActionbarForSwipe(false); - mSwipeRefreshLayout.setRefreshing(false); } return false; }