summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-12-06 12:37:46 +0300
committerAndrew Dolgov <[email protected]>2011-12-06 12:37:46 +0300
commit815e40a698057cd8260d962bb7ec83d2bcf8d5ba (patch)
tree5360ed2c90e0993d39ea7b3969e754c1879b7328
parentd8da03554f2c3e1bbbed34758493e5576d9f28ea (diff)
use setemptyview on online lists
-rw-r--r--res/layout/feeds_fragment.xml4
-rw-r--r--res/layout/headlines_fragment.xml2
-rw-r--r--res/values/strings.xml6
-rw-r--r--src/org/fox/ttrss/FeedsFragment.java7
-rw-r--r--src/org/fox/ttrss/HeadlinesFragment.java7
5 files changed, 15 insertions, 11 deletions
diff --git a/res/layout/feeds_fragment.xml b/res/layout/feeds_fragment.xml
index b5651dd6..853df1d8 100644
--- a/res/layout/feeds_fragment.xml
+++ b/res/layout/feeds_fragment.xml
@@ -8,9 +8,9 @@
</LinearLayout>
<ListView android:id="@+id/feeds" android:layout_height="match_parent" android:layout_width="match_parent"></ListView>
- <TextView android:id="@+id/no_unread_feeds"
+ <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_unread_feeds"></TextView>
+ android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_feeds"></TextView>
</FrameLayout>
diff --git a/res/layout/headlines_fragment.xml b/res/layout/headlines_fragment.xml
index 2fb8ffde..5b4a5bcd 100644
--- a/res/layout/headlines_fragment.xml
+++ b/res/layout/headlines_fragment.xml
@@ -11,6 +11,6 @@
<TextView android:id="@+id/no_headlines"
android:visibility="invisible"
android:layout_gravity="center"
- android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_unread_headlines"></TextView>
+ android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_headlines"></TextView>
</FrameLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 77dbb3e8..c2637c9d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -26,8 +26,8 @@
<string name="headline_context_multiple">Selected articles</string>
<string name="http_authentication">HTTP Authentication</string>
<string name="login_success">Logged in.</string>
- <string name="no_unread_feeds">No unread feeds.</string>
- <string name="no_unread_headlines">No unread headlines.</string>
+ <string name="no_unread_feeds">No unread feeds</string>
+ <string name="no_unread_headlines">No unread articles</string>
<string name="loading_message">Loading, please wait...</string>
<string name="menu_unread_feeds">Show unread feeds</string>
<string name="menu_all_feeds">Show all feeds</string>
@@ -94,4 +94,6 @@
<string name="go_online">Go online</string>
<string name="offline_downloading">Preparing offline mode...</string>
<string name="offline_switch_error">Failed to prepare offline mode (see log)</string>
+ <string name="no_feeds">No feeds to display</string>
+ <string name="no_headlines">No articles to display</string>
</resources> \ No newline at end of file
diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java
index c82010d9..47d66198 100644
--- a/src/org/fox/ttrss/FeedsFragment.java
+++ b/src/org/fox/ttrss/FeedsFragment.java
@@ -127,6 +127,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
ListView list = (ListView)view.findViewById(R.id.feeds);
m_adapter = new FeedListAdapter(getActivity(), R.layout.feeds_row, (ArrayList<Feed>)m_feeds);
list.setAdapter(m_adapter);
+ list.setEmptyView(view.findViewById(R.id.no_feeds));
list.setOnItemClickListener(this);
registerForContextMenu(list);
@@ -307,9 +308,9 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
sortFeeds();
- if (m_feeds.size() == 0)
- setLoadingStatus(R.string.no_feeds_to_display, false);
- else
+ //if (m_feeds.size() == 0)
+ // setLoadingStatus(R.string.no_feeds_to_display, false);
+ //else
setLoadingStatus(R.string.blank, false);
if (m_enableFeedIcons && !m_feedIconsChecked) getFeedIcons();
diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java
index 95ba1f9a..cf437258 100644
--- a/src/org/fox/ttrss/HeadlinesFragment.java
+++ b/src/org/fox/ttrss/HeadlinesFragment.java
@@ -127,6 +127,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
list.setAdapter(m_adapter);
list.setOnItemClickListener(this);
list.setOnScrollListener(this);
+ list.setEmptyView(view.findViewById(R.id.no_headlines));
registerForContextMenu(list);
Log.d(TAG, "onCreateView, feed=" + m_feed);
@@ -278,9 +279,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
m_adapter.notifyDataSetChanged();
- if (m_articles.size() == 0)
- setLoadingStatus(R.string.no_headlines_to_display, false);
- else
+ //if (m_articles.size() == 0)
+ // setLoadingStatus(R.string.no_headlines_to_display, false);
+ //else
setLoadingStatus(R.string.blank, false);
m_refreshInProgress = false;