account for feeds listview header when showing context menu
do not enable all articles entry for special categories
This commit is contained in:
parent
ef5ca11c43
commit
3ef8a660a8
@ -239,10 +239,11 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
|||||||
getActivity().getMenuInflater().inflate(R.menu.feed_menu, menu);
|
getActivity().getMenuInflater().inflate(R.menu.feed_menu, menu);
|
||||||
|
|
||||||
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
|
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
|
||||||
Feed feed = m_adapter.getItem(info.position);
|
|
||||||
|
|
||||||
if (feed != null)
|
ListView list = (ListView) getView().findViewById(R.id.feeds);
|
||||||
menu.setHeaderTitle(feed.display_title != null ? feed.display_title : feed.title);
|
Feed feed = (Feed) list.getItemAtPosition(info.position);
|
||||||
|
|
||||||
|
menu.setHeaderTitle(feed.display_title != null ? feed.display_title : feed.title);
|
||||||
|
|
||||||
if (!feed.is_cat) {
|
if (!feed.is_cat) {
|
||||||
menu.findItem(R.id.browse_feeds).setVisible(false);
|
menu.findItem(R.id.browse_feeds).setVisible(false);
|
||||||
@ -378,7 +379,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
|||||||
ListView list = (ListView)av;
|
ListView list = (ListView)av;
|
||||||
|
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
Feed feed = (Feed)list.getItemAtPosition(position);
|
Feed feed = (Feed)list.getItemAtPosition(position);
|
||||||
|
|
||||||
if (feed.is_cat) {
|
if (feed.is_cat) {
|
||||||
if (feed.always_display_as_feed) {
|
if (feed.always_display_as_feed) {
|
||||||
@ -548,13 +549,14 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
|||||||
|
|
||||||
sortFeeds();
|
sortFeeds();
|
||||||
|
|
||||||
if (m_enableParentBtn && m_activeCategory != null && m_activeCategory.id >= 0) {
|
if (m_enableParentBtn && m_activeCategory != null && m_activeCategory.id >= 0 && m_feeds.size() > 0) {
|
||||||
Feed feed = new Feed(m_activeCategory.id, m_activeCategory.title, true);
|
Feed feed = new Feed(m_activeCategory.id, m_activeCategory.title, true);
|
||||||
feed.unread = catUnread;
|
feed.unread = catUnread;
|
||||||
feed.always_display_as_feed = true;
|
feed.always_display_as_feed = true;
|
||||||
feed.display_title = getString(R.string.feed_all_articles);
|
feed.display_title = getString(R.string.feed_all_articles);
|
||||||
|
|
||||||
m_feeds.add(0, feed);
|
m_feeds.add(0, feed);
|
||||||
|
m_adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (m_feeds.size() == 0)
|
/*if (m_feeds.size() == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user