summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-02-27 10:39:23 +0400
committerAndrew Dolgov <[email protected]>2013-02-27 10:39:23 +0400
commit72975a9a030d1b5d3c36789fa8d1f5159f91170d (patch)
tree86fb3e379353f68f0db10431193182f32d45b822
parentd381abd82a4925e93fa48ddea36ef0f251150df4 (diff)
properly report when feeds/cats list is empty, bump version
-rw-r--r--AndroidManifest.xml4
-rw-r--r--res/layout/cats_fragment.xml43
-rw-r--r--res/layout/feeds_fragment.xml51
-rw-r--r--src/org/fox/ttrss/FeedCategoriesFragment.java9
-rw-r--r--src/org/fox/ttrss/FeedsFragment.java11
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 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
- android:versionCode="138"
- android:versionName="1.16" >
+ android:versionCode="139"
+ android:versionName="1.17" >
<uses-sdk
android:minSdkVersion="8"
diff --git a/res/layout/cats_fragment.xml b/res/layout/cats_fragment.xml
index b47f9595..5f057688 100644
--- a/res/layout/cats_fragment.xml
+++ b/res/layout/cats_fragment.xml
@@ -1,12 +1,37 @@
-<?xml version="1.0" encoding="utf-8" ?>
- <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cats_fragment.xml"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
-
- <LinearLayout android:id="@+id/loading_container" android:gravity="center" android:layout_height="match_parent" android:layout_width="match_parent">
- <TextView android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/loading_message" android:layout_height="wrap_content" ></TextView>
- </LinearLayout>
- <ListView android:id="@+id/feeds" android:layout_height="match_parent" android:layout_width="match_parent"></ListView>
-
- </FrameLayout>
+
+ <LinearLayout
+ android:id="@+id/loading_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center" >
+
+ <TextView
+ android:id="@+id/loading_message"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge" >
+ </TextView>
+ </LinearLayout>
+
+ <ListView
+ android:id="@+id/feeds"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+ </ListView>
+
+ <TextView
+ android:id="@+id/no_feeds"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="@string/no_feeds"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:visibility="invisible" >
+ </TextView>
+
+</FrameLayout> \ 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 @@
-<?xml version="1.0" encoding="utf-8" ?>
-
+<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-
- android:layout_height="fill_parent" android:layout_width="match_parent" android:id="@+id/feeds_fragment">
- <LinearLayout android:id="@+id/loading_container" android:gravity="center" android:layout_height="match_parent" android:layout_width="match_parent">
- <TextView android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/loading_message" android:layout_height="wrap_content" ></TextView>
- </LinearLayout>
- <ListView android:id="@+id/feeds" android:layout_height="match_parent" android:layout_width="match_parent"></ListView>
-
- <TextView android:id="@+id/no_feeds"
- android:visibility="invisible"
- android:layout_gravity="center" android:color="#909090"
- android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_feeds"></TextView>
-
- </FrameLayout>
+ android:id="@+id/feeds_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent" >
+
+ <LinearLayout
+ android:id="@+id/loading_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center" >
+
+ <TextView
+ android:id="@+id/loading_message"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge" >
+ </TextView>
+ </LinearLayout>
+
+ <ListView
+ android:id="@+id/feeds"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+ </ListView>
+
+ <TextView
+ android:id="@+id/no_feeds"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="@string/no_feeds"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:visibility="invisible" >
+ </TextView>
+
+</FrameLayout> \ 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();