show drawer loading when refreshing fragment not initiated by swiping
This commit is contained in:
parent
7d47b16357
commit
a0bc87f85b
@ -337,7 +337,7 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
|
|||||||
m_swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
m_swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
refresh(false);
|
refresh(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -356,8 +356,6 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
|
|||||||
loadingBar.setVisibility(View.VISIBLE);
|
loadingBar.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//m_activity.m_pullToRefreshAttacher.addRefreshableView(list, this);
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,10 +388,18 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
|
|||||||
//out.putParcelable("cats", m_cats);
|
//out.putParcelable("cats", m_cats);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refresh(boolean background) {
|
public void refresh(boolean swipeRefresh) {
|
||||||
if (!isAdded()) return;
|
if (!isAdded()) return;
|
||||||
|
|
||||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(true);
|
if (m_swipeLayout != null && swipeRefresh) {
|
||||||
|
m_swipeLayout.setRefreshing(true);
|
||||||
|
} else {
|
||||||
|
View loadingBar = getView().findViewById(R.id.feeds_loading_bar);
|
||||||
|
|
||||||
|
if (loadingBar != null) {
|
||||||
|
loadingBar.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getLoaderManager().restartLoader(0, null, this).forceLoad();
|
getLoaderManager().restartLoader(0, null, this).forceLoad();
|
||||||
}
|
}
|
||||||
@ -529,8 +535,4 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt
|
|||||||
return m_selectedCat;
|
return m_selectedCat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @Override
|
|
||||||
public void onRefreshStarted(View view) {
|
|
||||||
refresh(false);
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
|
|||||||
m_swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
m_swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
refresh(false);
|
refresh(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -465,10 +465,18 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "serial" })
|
@SuppressWarnings({ "serial" })
|
||||||
public void refresh(boolean background) {
|
public void refresh(boolean swipeRefresh) {
|
||||||
if (!isAdded()) return;
|
if (!isAdded()) return;
|
||||||
|
|
||||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(true);
|
if (m_swipeLayout != null && swipeRefresh) {
|
||||||
|
m_swipeLayout.setRefreshing(true);
|
||||||
|
} else {
|
||||||
|
View loadingBar = getView().findViewById(R.id.feeds_loading_bar);
|
||||||
|
|
||||||
|
if (loadingBar != null) {
|
||||||
|
loadingBar.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getLoaderManager().restartLoader(0, null, this).forceLoad();
|
getLoaderManager().restartLoader(0, null, this).forceLoad();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user