add copy article text to combined mode article context menu (refs #437)
This commit is contained in:
parent
bca4979935
commit
bbb4b2c36e
@ -6,7 +6,7 @@
|
||||
android:title="@string/share_article"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/article_link_save"
|
||||
android:id="@+id/article_link_copy"
|
||||
android:showAsAction=""
|
||||
android:title="@string/article_link_copy"/>
|
||||
|
||||
|
@ -22,6 +22,11 @@
|
||||
android:showAsAction=""
|
||||
android:title="@string/share_article"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/article_link_copy"
|
||||
android:showAsAction=""
|
||||
android:title="@string/article_link_copy"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/catchup_above"
|
||||
android:showAsAction=""
|
||||
|
@ -1818,19 +1818,29 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
.findFragmentById(R.id.cats_fragment);
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.article_link_save:
|
||||
if (m_selectedArticle != null) {
|
||||
if (android.os.Build.VERSION.SDK_INT < 11) {
|
||||
@SuppressWarnings("deprecation")
|
||||
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
clipboard.setText(m_selectedArticle.link);
|
||||
} else {
|
||||
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
clipboard.setText(m_selectedArticle.link);
|
||||
case R.id.article_link_copy:
|
||||
if (true) {
|
||||
Article article = null;
|
||||
|
||||
if (m_selectedArticle != null) {
|
||||
article = m_selectedArticle;
|
||||
} else if (info != null) {
|
||||
article = hf.getArticleAtPosition(info.position);
|
||||
}
|
||||
|
||||
Toast toast = Toast.makeText(MainActivity.this, R.string.text_copied_to_clipboard, Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
if (article != null) {
|
||||
if (android.os.Build.VERSION.SDK_INT < 11) {
|
||||
@SuppressWarnings("deprecation")
|
||||
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
clipboard.setText(article.link);
|
||||
} else {
|
||||
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
clipboard.setText(article.link);
|
||||
}
|
||||
|
||||
Toast toast = Toast.makeText(MainActivity.this, R.string.text_copied_to_clipboard, Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case R.id.article_link_share:
|
||||
|
@ -854,9 +854,15 @@ public class OfflineActivity extends FragmentActivity implements
|
||||
.findFragmentById(R.id.feeds_fragment);
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.article_link_save:
|
||||
case R.id.article_link_copy:
|
||||
if (m_selectedArticleId != 0) {
|
||||
Cursor article = getArticleById(m_selectedArticleId);
|
||||
Cursor article = null;
|
||||
|
||||
if (m_selectedArticleId != 0) {
|
||||
article = getArticleById(m_selectedArticleId);
|
||||
} else if (info != null) {
|
||||
article = hf.getArticleAtPosition(info.position);
|
||||
}
|
||||
|
||||
if (article != null) {
|
||||
if (android.os.Build.VERSION.SDK_INT < 11) {
|
||||
|
Loading…
Reference in New Issue
Block a user