mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
fix getStrings() calls for studylists
This commit is contained in:
parent
1eea5bfed5
commit
85ffd0cad9
2 changed files with 15 additions and 12 deletions
|
@ -30,6 +30,8 @@ import android.view.MenuItem;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.eehouse.android.xw4.loc.LocUtils;
|
||||||
|
|
||||||
public class StudyListActivity extends ListActivity {
|
public class StudyListActivity extends ListActivity {
|
||||||
|
|
||||||
private StudyListDelegate m_dlgt;
|
private StudyListDelegate m_dlgt;
|
||||||
|
@ -85,11 +87,11 @@ public class StudyListActivity extends ListActivity {
|
||||||
{
|
{
|
||||||
String msg = null;
|
String msg = null;
|
||||||
if ( 0 == DBUtils.studyListLangs( context ).length ) {
|
if ( 0 == DBUtils.studyListLangs( context ).length ) {
|
||||||
msg = context.getString( R.string.study_no_lists );
|
msg = LocUtils.getString( context, R.string.study_no_lists );
|
||||||
} else if ( StudyListDelegate.NO_LANG != lang &&
|
} else if ( StudyListDelegate.NO_LANG != lang &&
|
||||||
0 == DBUtils.studyListWords( context, lang ).length ) {
|
0 == DBUtils.studyListWords( context, lang ).length ) {
|
||||||
String langname = DictLangCache.getLangName( context, lang );
|
String langname = DictLangCache.getLangName( context, lang );
|
||||||
msg = context.getString( R.string.study_no_lang_fmt, langname );
|
msg = LocUtils.getString( context, R.string.study_no_lang_fmt, langname );
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent( context, StudyListActivity.class );
|
Intent intent = new Intent( context, StudyListActivity.class );
|
||||||
if ( StudyListDelegate.NO_LANG != lang ) {
|
if ( StudyListDelegate.NO_LANG != lang ) {
|
||||||
|
|
|
@ -44,6 +44,7 @@ import junit.framework.Assert;
|
||||||
|
|
||||||
import org.eehouse.android.xw4.DlgDelegate.Action;
|
import org.eehouse.android.xw4.DlgDelegate.Action;
|
||||||
import org.eehouse.android.xw4.jni.GameSummary;
|
import org.eehouse.android.xw4.jni.GameSummary;
|
||||||
|
import org.eehouse.android.xw4.loc.LocUtils;
|
||||||
|
|
||||||
public class StudyListDelegate extends DelegateBase
|
public class StudyListDelegate extends DelegateBase
|
||||||
implements OnItemSelectedListener, SelectableItem,
|
implements OnItemSelectedListener, SelectableItem,
|
||||||
|
@ -100,8 +101,8 @@ public class StudyListDelegate extends DelegateBase
|
||||||
Utils.setItemVisible( menu, R.id.slmenu_deselect_all, 0 < nSel );
|
Utils.setItemVisible( menu, R.id.slmenu_deselect_all, 0 < nSel );
|
||||||
boolean enable = 1 == nSel;
|
boolean enable = 1 == nSel;
|
||||||
if ( enable ) {
|
if ( enable ) {
|
||||||
String title =
|
String title = getString( R.string.button_lookup_fmt,
|
||||||
m_activity.getString( R.string.button_lookup_fmt, getSelWords()[0] );
|
getSelWords()[0] );
|
||||||
menu.findItem( R.id.slmenu_lookup_sel ).setTitle( title );
|
menu.findItem( R.id.slmenu_lookup_sel ).setTitle( title );
|
||||||
}
|
}
|
||||||
Utils.setItemVisible( menu, R.id.slmenu_lookup_sel, enable );
|
Utils.setItemVisible( menu, R.id.slmenu_lookup_sel, enable );
|
||||||
|
@ -118,9 +119,8 @@ public class StudyListDelegate extends DelegateBase
|
||||||
Action.SL_COPY_ACTION );
|
Action.SL_COPY_ACTION );
|
||||||
break;
|
break;
|
||||||
case R.id.slmenu_clear_sel:
|
case R.id.slmenu_clear_sel:
|
||||||
String msg =
|
String msg = getString( R.string.confirm_studylist_clear_fmt,
|
||||||
m_activity.getString( R.string.confirm_studylist_clear_fmt,
|
m_checkeds.size() );
|
||||||
m_checkeds.size() );
|
|
||||||
showConfirmThen( msg, Action.SL_CLEAR_ACTION );
|
showConfirmThen( msg, Action.SL_CLEAR_ACTION );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -167,8 +167,8 @@ public class StudyListDelegate extends DelegateBase
|
||||||
m_activity.getSystemService( Context.CLIPBOARD_SERVICE );
|
m_activity.getSystemService( Context.CLIPBOARD_SERVICE );
|
||||||
clipboard.setText( TextUtils.join( "\n", selWords ) );
|
clipboard.setText( TextUtils.join( "\n", selWords ) );
|
||||||
|
|
||||||
String msg = m_activity.getString( R.string.paste_done_fmt,
|
String msg = getString( R.string.paste_done_fmt,
|
||||||
selWords.length );
|
selWords.length );
|
||||||
Utils.showToast( m_activity, msg );
|
Utils.showToast( m_activity, msg );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -306,7 +306,7 @@ public class StudyListDelegate extends DelegateBase
|
||||||
if ( 0 == nSels ) {
|
if ( 0 == nSels ) {
|
||||||
newTitle = m_origTitle;
|
newTitle = m_origTitle;
|
||||||
} else {
|
} else {
|
||||||
newTitle = m_activity.getString( R.string.sel_items_fmt, nSels );
|
newTitle = getString( R.string.sel_items_fmt, nSels );
|
||||||
}
|
}
|
||||||
setTitle( newTitle );
|
setTitle( newTitle );
|
||||||
|
|
||||||
|
@ -341,11 +341,12 @@ public class StudyListDelegate extends DelegateBase
|
||||||
{
|
{
|
||||||
String msg = null;
|
String msg = null;
|
||||||
if ( 0 == DBUtils.studyListLangs( context ).length ) {
|
if ( 0 == DBUtils.studyListLangs( context ).length ) {
|
||||||
msg = context.getString( R.string.study_no_lists );
|
msg = LocUtils.getString( context, R.string.study_no_lists );
|
||||||
} else if ( NO_LANG != lang &&
|
} else if ( NO_LANG != lang &&
|
||||||
0 == DBUtils.studyListWords( context, lang ).length ) {
|
0 == DBUtils.studyListWords( context, lang ).length ) {
|
||||||
String langname = DictLangCache.getLangName( context, lang );
|
String langname = DictLangCache.getLangName( context, lang );
|
||||||
msg = context.getString( R.string.study_no_lang_fmt, langname );
|
msg = LocUtils.getString( context, R.string.study_no_lang_fmt,
|
||||||
|
langname );
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent( context, StudyListActivity.class );
|
Intent intent = new Intent( context, StudyListActivity.class );
|
||||||
if ( NO_LANG != lang ) {
|
if ( NO_LANG != lang ) {
|
||||||
|
|
Loading…
Reference in a new issue