update support library
fix articlefragment link context menu
This commit is contained in:
parent
e2adb70fe0
commit
6f95c43765
Binary file not shown.
@ -44,10 +44,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
|
|||||||
private SharedPreferences m_prefs;
|
private SharedPreferences m_prefs;
|
||||||
private Article m_article;
|
private Article m_article;
|
||||||
private OnlineActivity m_activity;
|
private OnlineActivity m_activity;
|
||||||
//private Article m_nextArticle;
|
|
||||||
//private Article m_prevArticle;
|
|
||||||
private GestureDetector m_detector;
|
private GestureDetector m_detector;
|
||||||
private boolean m_visible = true;
|
|
||||||
|
|
||||||
public ArticleFragment() {
|
public ArticleFragment() {
|
||||||
super();
|
super();
|
||||||
@ -61,35 +58,6 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
|
|||||||
|
|
||||||
private View.OnTouchListener m_gestureListener;
|
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
|
@Override
|
||||||
public void onCreateContextMenu(ContextMenu menu, View v,
|
public void onCreateContextMenu(ContextMenu menu, View v,
|
||||||
ContextMenuInfo menuInfo) {
|
ContextMenuInfo menuInfo) {
|
||||||
|
@ -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
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
final HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
final HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||||
|
Loading…
Reference in New Issue
Block a user