From 815e40a698057cd8260d962bb7ec83d2bcf8d5ba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 6 Dec 2011 12:37:46 +0300 Subject: use setemptyview on online lists --- res/layout/feeds_fragment.xml | 4 ++-- res/layout/headlines_fragment.xml | 2 +- res/values/strings.xml | 6 ++++-- src/org/fox/ttrss/FeedsFragment.java | 7 ++++--- src/org/fox/ttrss/HeadlinesFragment.java | 7 ++++--- 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 @@ - + android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_feeds"> 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 @@ + android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/no_headlines"> 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 @@ Selected articles HTTP Authentication Logged in. - No unread feeds. - No unread headlines. + No unread feeds + No unread articles Loading, please wait... Show unread feeds Show all feeds @@ -94,4 +94,6 @@ Go online Preparing offline mode... Failed to prepare offline mode (see log) + No feeds to display + No articles to display \ 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)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; -- cgit v1.2.3-54-g00ecf