add newbie tip for studylist copy feature

This commit is contained in:
Eric House 2014-01-30 21:31:14 -08:00
parent 426b5b59b2
commit c40cef2101
3 changed files with 17 additions and 6 deletions

View file

@ -107,6 +107,7 @@
<string name="key_na_browse">key_na_browse</string>
<string name="key_na_browseall">key_na_browseall</string>
<string name="key_na_values">key_na_values</string>
<string name="key_na_studycopy">key_na_studycopy</string>
<string name="key_enable_debug">key_enable_debug</string>
<string name="key_enable_dup_invite">key_enable_dup_invite</string>
<string name="key_download_path">key_download_path</string>

View file

@ -2224,4 +2224,8 @@
<string name="study_no_lists">You have not yet saved any words
into a studylist.</string>
<string name="not_again_studycopy">The words in this list will be
copied to the system clipboard. You can then paste them into any
app that supports pasting text, e.g. an email app.</string>
</resources>

View file

@ -43,6 +43,7 @@ public class StudyList extends XWListActivity
public static final int NO_LANG = -1;
private static final int CLEAR_ACTION = 1;
private static final int COPY_ACTION = 2;
private static final String START_LANG = "START_LANG";
private Spinner m_spinner;
@ -81,12 +82,9 @@ public class StudyList extends XWListActivity
boolean handled = true;
switch ( item.getItemId() ) {
case R.id.copy_all:
ClipboardManager clipboard = (ClipboardManager)
getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText( TextUtils.join( "\n", m_words ) );
String msg = getString( R.string.paste_donef, m_words.length );
Utils.showToast( this, msg );
showNotAgainDlgThen( R.string.not_again_studycopy,
R.string.key_na_studycopy,
COPY_ACTION );
break;
case R.id.clear_all:
showConfirmThen( R.string.confirm_studylist_clear, CLEAR_ACTION );
@ -109,6 +107,14 @@ public class StudyList extends XWListActivity
DBUtils.studyListClear( this, m_langCodes[m_position] );
initOrFinish( null );
break;
case COPY_ACTION:
ClipboardManager clipboard = (ClipboardManager)
getSystemService( Context.CLIPBOARD_SERVICE );
clipboard.setText( TextUtils.join( "\n", m_words ) );
String msg = getString( R.string.paste_donef, m_words.length );
Utils.showToast( this, msg );
break;
default:
Assert.fail();
break;