From 72975a9a030d1b5d3c36789fa8d1f5159f91170d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 27 Feb 2013 10:39:23 +0400 Subject: [PATCH] properly report when feeds/cats list is empty, bump version --- AndroidManifest.xml | 4 +- res/layout/cats_fragment.xml | 43 ++++++++++++---- res/layout/feeds_fragment.xml | 51 +++++++++++++------ src/org/fox/ttrss/FeedCategoriesFragment.java | 9 ++++ src/org/fox/ttrss/FeedsFragment.java | 11 +++- 5 files changed, 91 insertions(+), 27 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 06a915dd..6234d0bc 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="139" + android:versionName="1.17" > - + - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/feeds_fragment.xml b/res/layout/feeds_fragment.xml index 2204feb8..c3840059 100644 --- a/res/layout/feeds_fragment.xml +++ b/res/layout/feeds_fragment.xml @@ -1,16 +1,37 @@ - - + - - - - - - - - + android:id="@+id/feeds_fragment" + android:layout_width="match_parent" + android:layout_height="fill_parent" > + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/org/fox/ttrss/FeedCategoriesFragment.java b/src/org/fox/ttrss/FeedCategoriesFragment.java index 7db81a4e..a60bf617 100644 --- a/src/org/fox/ttrss/FeedCategoriesFragment.java +++ b/src/org/fox/ttrss/FeedCategoriesFragment.java @@ -258,6 +258,14 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe m_activity.setProgressBarVisibility(false); + if (getView() != null) { + ListView list = (ListView)getView().findViewById(R.id.feeds); + + if (list != null) { + list.setEmptyView(getView().findViewById(R.id.no_feeds)); + } + } + if (result != null) { try { JsonArray content = result.getAsJsonArray(); @@ -285,6 +293,7 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe setLoadingStatus(R.string.no_feeds_to_display, false); else */ + m_adapter.notifyDataSetInvalidated(); m_activity.setLoadingStatus(R.string.blank, false); return; diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index 62f0669e..8dc28787 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -391,6 +391,14 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh @Override protected void onPostExecute(JsonElement result) { if (isDetached()) return; + + if (getView() != null) { + ListView list = (ListView)getView().findViewById(R.id.feeds); + + if (list != null) { + list.setEmptyView(getView().findViewById(R.id.no_feeds)); + } + } m_activity.setProgressBarVisibility(false); @@ -415,7 +423,8 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh else */ m_activity.setLoadingStatus(R.string.blank, false); - + m_adapter.notifyDataSetInvalidated(); + if (m_enableFeedIcons && !m_feedIconsChecked && Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) getFeedIcons();