From ef07afec72e181e0b0cec06493c14daf443ea7b9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Apr 2013 12:54:51 +0400 Subject: [PATCH] various menu updates --- res/layout/feeds.xml | 1 + res/layout/headlines.xml | 1 + res/layout/headlines_row_unread.xml | 1 + res/menu/main_menu.xml | 36 +++++++++++---------------- src/org/fox/ttrss/ArticlePager.java | 4 +++ src/org/fox/ttrss/OnlineActivity.java | 9 ++++--- 6 files changed, 27 insertions(+), 25 deletions(-) diff --git a/res/layout/feeds.xml b/res/layout/feeds.xml index 102dd07e..72067ce0 100644 --- a/res/layout/feeds.xml +++ b/res/layout/feeds.xml @@ -1,5 +1,6 @@ diff --git a/res/layout/headlines.xml b/res/layout/headlines.xml index f00b8d38..9de7f87d 100644 --- a/res/layout/headlines.xml +++ b/res/layout/headlines.xml @@ -1,5 +1,6 @@ diff --git a/res/layout/headlines_row_unread.xml b/res/layout/headlines_row_unread.xml index 1e789f71..d7cb0e08 100644 --- a/res/layout/headlines_row_unread.xml +++ b/res/layout/headlines_row_unread.xml @@ -49,6 +49,7 @@ diff --git a/res/menu/main_menu.xml b/res/menu/main_menu.xml index d9a33b48..34190322 100644 --- a/res/menu/main_menu.xml +++ b/res/menu/main_menu.xml @@ -106,25 +106,17 @@ android:icon="@drawable/ic_menu_publish_light" android:showAsAction="ifRoom" android:title="@string/article_toggle_published"/> - - + android:title="@string/attachments_prompt"/> + android:id="@+id/share_article" + android:icon="@android:drawable/ic_menu_share" + android:showAsAction="ifRoom" + android:title="@string/share_article"/> + - + + + diff --git a/src/org/fox/ttrss/ArticlePager.java b/src/org/fox/ttrss/ArticlePager.java index 13105820..5ef74f25 100644 --- a/src/org/fox/ttrss/ArticlePager.java +++ b/src/org/fox/ttrss/ArticlePager.java @@ -316,4 +316,8 @@ public class ArticlePager extends Fragment { } } } + + public void notifyUpdated() { + m_adapter.notifyDataSetChanged(); + } } diff --git a/src/org/fox/ttrss/OnlineActivity.java b/src/org/fox/ttrss/OnlineActivity.java index bae056fe..874a6a13 100644 --- a/src/org/fox/ttrss/OnlineActivity.java +++ b/src/org/fox/ttrss/OnlineActivity.java @@ -874,11 +874,11 @@ public class OnlineActivity extends CommonActivity { } return true; case R.id.share_article: - if (android.os.Build.VERSION.SDK_INT < 14) { + //if (android.os.Build.VERSION.SDK_INT < 14) { if (ap != null) { shareArticle(ap.getSelectedArticle()); } - } + //} return true; case R.id.toggle_marked: if (ap != null & ap.getSelectedArticle() != null) { @@ -971,6 +971,7 @@ public class OnlineActivity extends CommonActivity { a.unread = true; saveArticleUnread(a); if (hf != null) hf.notifyUpdated(); + if (ap != null) ap.notifyUpdated(); } return true; case R.id.set_labels: @@ -1449,7 +1450,7 @@ public class OnlineActivity extends CommonActivity { MenuItem search = m_menu.findItem(R.id.search); search.setEnabled(getApiLevel() >= 2); - if (android.os.Build.VERSION.SDK_INT >= 14) { + /* if (android.os.Build.VERSION.SDK_INT >= 14) { ShareActionProvider shareProvider = (ShareActionProvider) m_menu.findItem(R.id.share_article).getActionProvider(); ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); @@ -1461,7 +1462,7 @@ public class OnlineActivity extends CommonActivity { m_menu.findItem(R.id.share_article).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); } } - } + } */ if (!isCompatMode()) { HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);