mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
add newbie tip for studylist copy feature
This commit is contained in:
parent
426b5b59b2
commit
c40cef2101
3 changed files with 17 additions and 6 deletions
|
@ -107,6 +107,7 @@
|
||||||
<string name="key_na_browse">key_na_browse</string>
|
<string name="key_na_browse">key_na_browse</string>
|
||||||
<string name="key_na_browseall">key_na_browseall</string>
|
<string name="key_na_browseall">key_na_browseall</string>
|
||||||
<string name="key_na_values">key_na_values</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_debug">key_enable_debug</string>
|
||||||
<string name="key_enable_dup_invite">key_enable_dup_invite</string>
|
<string name="key_enable_dup_invite">key_enable_dup_invite</string>
|
||||||
<string name="key_download_path">key_download_path</string>
|
<string name="key_download_path">key_download_path</string>
|
||||||
|
|
|
@ -2224,4 +2224,8 @@
|
||||||
<string name="study_no_lists">You have not yet saved any words
|
<string name="study_no_lists">You have not yet saved any words
|
||||||
into a studylist.</string>
|
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>
|
</resources>
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class StudyList extends XWListActivity
|
||||||
public static final int NO_LANG = -1;
|
public static final int NO_LANG = -1;
|
||||||
|
|
||||||
private static final int CLEAR_ACTION = 1;
|
private static final int CLEAR_ACTION = 1;
|
||||||
|
private static final int COPY_ACTION = 2;
|
||||||
private static final String START_LANG = "START_LANG";
|
private static final String START_LANG = "START_LANG";
|
||||||
|
|
||||||
private Spinner m_spinner;
|
private Spinner m_spinner;
|
||||||
|
@ -81,12 +82,9 @@ public class StudyList extends XWListActivity
|
||||||
boolean handled = true;
|
boolean handled = true;
|
||||||
switch ( item.getItemId() ) {
|
switch ( item.getItemId() ) {
|
||||||
case R.id.copy_all:
|
case R.id.copy_all:
|
||||||
ClipboardManager clipboard = (ClipboardManager)
|
showNotAgainDlgThen( R.string.not_again_studycopy,
|
||||||
getSystemService(Context.CLIPBOARD_SERVICE);
|
R.string.key_na_studycopy,
|
||||||
clipboard.setText( TextUtils.join( "\n", m_words ) );
|
COPY_ACTION );
|
||||||
|
|
||||||
String msg = getString( R.string.paste_donef, m_words.length );
|
|
||||||
Utils.showToast( this, msg );
|
|
||||||
break;
|
break;
|
||||||
case R.id.clear_all:
|
case R.id.clear_all:
|
||||||
showConfirmThen( R.string.confirm_studylist_clear, CLEAR_ACTION );
|
showConfirmThen( R.string.confirm_studylist_clear, CLEAR_ACTION );
|
||||||
|
@ -109,6 +107,14 @@ public class StudyList extends XWListActivity
|
||||||
DBUtils.studyListClear( this, m_langCodes[m_position] );
|
DBUtils.studyListClear( this, m_langCodes[m_position] );
|
||||||
initOrFinish( null );
|
initOrFinish( null );
|
||||||
break;
|
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:
|
default:
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue