diff options
author | Andrew Dolgov <[email protected]> | 2017-06-04 20:03:39 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-06-04 20:03:39 +0300 |
commit | 6212efd82a29923756cdcbd9956cbd62ae863878 (patch) | |
tree | 8f43361c277889aee4d5c8cde53416e25a429a4b /org.fox.ttrss/src | |
parent | af67ce49d7cbf74fa3244782060ae51bcf5b0c56 (diff) |
drawer progressbar seems redundant
Diffstat (limited to 'org.fox.ttrss/src')
6 files changed, 10 insertions, 68 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java index 05f02e95..4220450d 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/BaseFeedlistFragment.java @@ -21,7 +21,7 @@ import java.net.MalformedURLException; import java.net.URL; public abstract class BaseFeedlistFragment extends Fragment { - abstract public void refresh(boolean background); + abstract public void refresh(); public void initDrawerHeader(LayoutInflater inflater, View view, ListView list, final CommonActivity activity, final SharedPreferences prefs, boolean isRoot) { @@ -99,7 +99,7 @@ public abstract class BaseFeedlistFragment extends Fragment { @Override public void onCheckedChanged(CompoundButton button, boolean isChecked) { activity.setUnreadOnly(isChecked); - refresh(true); + refresh(); } }); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java index 45568c92..13633ac7 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java @@ -82,12 +82,6 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false); - View loadingBar = getView().findViewById(R.id.feeds_loading_bar); - - if (loadingBar != null) { - loadingBar.setVisibility(View.INVISIBLE); - } - if (result != null) { try { JsonArray content = result.getAsJsonArray(); @@ -337,7 +331,7 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt m_swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { - refresh(true); + refresh(); } }); @@ -350,12 +344,6 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt m_list.setOnItemClickListener(this); registerForContextMenu(m_list); - View loadingBar = (View) view.findViewById(R.id.feeds_loading_bar); - - if (loadingBar != null) { - loadingBar.setVisibility(View.VISIBLE); - } - return view; } @@ -388,17 +376,11 @@ public class FeedCategoriesFragment extends BaseFeedlistFragment implements OnIt //out.putParcelable("cats", m_cats); } - public void refresh(boolean swipeRefresh) { + public void refresh() { if (!isAdded()) return; - if (m_swipeLayout != null && swipeRefresh) { + if (m_swipeLayout != null) { 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(); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java index dad91460..4fa165b4 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java @@ -93,12 +93,6 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi public void onLoadFinished(Loader<JsonElement> loader, JsonElement result) { if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false); - View loadingBar = getView().findViewById(R.id.feeds_loading_bar); - - if (loadingBar != null) { - loadingBar.setVisibility(View.INVISIBLE); - } - if (result != null) { try { JsonArray content = result.getAsJsonArray(); @@ -366,7 +360,7 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi m_swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { - refresh(true); + refresh(); } }); @@ -393,12 +387,6 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi registerForContextMenu(m_list); - View loadingBar = view.findViewById(R.id.feeds_loading_bar); - - if (loadingBar != null) { - loadingBar.setVisibility(View.VISIBLE); - } - return view; } @@ -464,17 +452,11 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi } @SuppressWarnings({ "serial" }) - public void refresh(boolean swipeRefresh) { + public void refresh() { if (!isAdded()) return; - if (m_swipeLayout != null && swipeRefresh) { + if (m_swipeLayout != null) { 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(); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java index 38ea7ef4..48c20e15 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java @@ -1506,13 +1506,13 @@ public class OnlineActivity extends CommonActivity { FeedCategoriesFragment cf = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS); if (cf != null) { - cf.refresh(false); + cf.refresh(); } FeedsFragment ff = (FeedsFragment) getSupportFragmentManager().findFragmentByTag(FRAG_FEEDS); if (ff != null) { - ff.refresh(false); + ff.refresh(); } if (includeHeadlines) { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java index f1827d21..d8c7cfff 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedCategoriesFragment.java @@ -202,11 +202,6 @@ public class OfflineFeedCategoriesFragment extends BaseFeedlistFragment implemen } } - @Override - public void refresh(boolean background) { - refresh(); - } - /* public void setLoadingStatus(int status, boolean showProgress) { if (getView() != null) { TextView tv = (TextView)getView().findViewById(R.id.loading_message); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java index 97f4880e..5e771d7b 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsFragment.java @@ -228,23 +228,6 @@ public class OfflineFeedsFragment extends BaseFeedlistFragment implements OnItem } } - @Override - public void refresh(boolean background) { - refresh(); - } - - /* public void setLoadingStatus(int status, boolean showProgress) { - if (getView() != null) { - TextView tv = (TextView)getView().findViewById(R.id.loading_message); - - if (tv != null) { - tv.setText(status); - } - } - - getActivity().setProgressBarIndeterminateVisibility(showProgress); - } */ - private class FeedListAdapter extends SimpleCursorAdapter { |