fix indeterminate progressbar not completing if http request fails

This commit is contained in:
Andrew Dolgov 2013-10-16 15:28:59 +04:00
parent 060fef90fd
commit 85ef8d8d13
3 changed files with 7 additions and 13 deletions

View File

@ -296,6 +296,7 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
if (isDetached()) return;
m_activity.setProgressBarVisibility(false);
m_activity.m_pullToRefreshAttacher.setRefreshComplete();
if (getView() != null) {
ListView list = (ListView)getView().findViewById(R.id.feeds);
@ -335,10 +336,6 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
//m_adapter.notifyDataSetChanged(); (done by sortCats)
m_activity.setLoadingStatus(R.string.blank, false);
if (isAdded()) {
m_activity.m_pullToRefreshAttacher.setRefreshComplete();
}
return;
}

View File

@ -442,6 +442,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
}
m_activity.setProgressBarVisibility(false);
m_activity.m_pullToRefreshAttacher.setRefreshComplete();
if (result != null) {
try {
@ -469,10 +470,6 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
if (m_enableFeedIcons && !m_feedIconsChecked && Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()))
getFeedIcons();
if (isAdded()) {
m_activity.m_pullToRefreshAttacher.setRefreshComplete();
}
return;
}

View File

@ -409,7 +409,11 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
m_activity.setProgressBarVisibility(false);
super.onPostExecute(result);
if (isAdded()) {
m_activity.m_pullToRefreshAttacher.setRefreshComplete();
}
if (result != null) {
m_refreshInProgress = false;
@ -419,10 +423,6 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
m_adapter.notifyDataSetChanged();
m_listener.onHeadlinesLoaded(fappend);
if (isAdded()) {
m_activity.m_pullToRefreshAttacher.setRefreshComplete();
}
} else {
if (m_lastError == ApiError.LOGIN_FAILED) {
m_activity.login();