diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar index feaf44f8..6080877d 100644 Binary files a/libs/android-support-v4.jar and b/libs/android-support-v4.jar differ diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 479463b0..0f85b335 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -44,10 +44,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl private SharedPreferences m_prefs; private Article m_article; private OnlineActivity m_activity; - //private Article m_nextArticle; - //private Article m_prevArticle; private GestureDetector m_detector; - private boolean m_visible = true; public ArticleFragment() { super(); @@ -61,35 +58,6 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl private View.OnTouchListener m_gestureListener; - @Override - public boolean onContextItemSelected(MenuItem item) { - /* AdapterContextMenuInfo info = (AdapterContextMenuInfo) item - .getMenuInfo(); */ - - switch (item.getItemId()) { - case R.id.article_link_share: - if (m_visible) { - ((OnlineActivity) getActivity()).shareArticle(m_article); - } - return true; - case R.id.article_link_copy: - if (m_visible) { - ((OnlineActivity) getActivity()).copyToClipboard(m_article.link); - } - return true; - default: - Log.d(TAG, "onContextItemSelected, unhandled id=" + item.getItemId()); - return super.onContextItemSelected(item); - } - } - - @Override - public void setUserVisibleHint(boolean visible) { - super.setUserVisibleHint(visible); - - m_visible = visible; - } - @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { diff --git a/src/org/fox/ttrss/OnlineActivity.java b/src/org/fox/ttrss/OnlineActivity.java index e7a9dac5..ef94131b 100644 --- a/src/org/fox/ttrss/OnlineActivity.java +++ b/src/org/fox/ttrss/OnlineActivity.java @@ -527,6 +527,31 @@ public class OnlineActivity extends CommonActivity { } } + @Override + public boolean onContextItemSelected(MenuItem item) { + /* AdapterContextMenuInfo info = (AdapterContextMenuInfo) item + .getMenuInfo(); */ + + final ArticlePager ap = (ArticlePager)getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); + + switch (item.getItemId()) { + case R.id.article_link_share: + if (ap != null && ap.getSelectedArticle() != null) { + shareArticle(ap.getSelectedArticle()); + } + return true; + case R.id.article_link_copy: + Log.d(TAG, "article_link_copy"); + if (ap != null && ap.getSelectedArticle() != null) { + copyToClipboard(ap.getSelectedArticle().link); + } + return true; + default: + Log.d(TAG, "onContextItemSelected, unhandled id=" + item.getItemId()); + return super.onContextItemSelected(item); + } + } + @Override public boolean onOptionsItemSelected(MenuItem item) { final HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);