diff --git a/xwords4/android/XWords4/AndroidManifest.xml b/xwords4/android/XWords4/AndroidManifest.xml index 821c729db..323983694 100644 --- a/xwords4/android/XWords4/AndroidManifest.xml +++ b/xwords4/android/XWords4/AndroidManifest.xml @@ -125,6 +125,10 @@ android:theme="@android:style/Theme.Dialog" /> + + diff --git a/xwords4/android/XWords4/res/layout/studylist.xml b/xwords4/android/XWords4/res/layout/studylist.xml new file mode 100644 index 000000000..e45e783b0 --- /dev/null +++ b/xwords4/android/XWords4/res/layout/studylist.xml @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/xwords4/android/XWords4/res/menu/games_list_menu.xml b/xwords4/android/XWords4/res/menu/games_list_menu.xml index 4af9b6ea4..b8a78afcf 100644 --- a/xwords4/android/XWords4/res/menu/games_list_menu.xml +++ b/xwords4/android/XWords4/res/menu/games_list_menu.xml @@ -26,6 +26,9 @@ android:icon="@drawable/dict__gen" android:showAsAction="ifRoom" /> + Enable study lists Offer to add to and display lists of words to remember - + Study list… + Choose list language diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index 2d3f00999..86f29ac7e 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -717,6 +717,9 @@ public class GamesList extends XWExpandableListActivity enable = nothingSelected && Utils.isGooglePlayApp( this ); Utils.setItemVisible( menu, R.id.games_menu_rateme, enable ); + enable = nothingSelected && 0 < DBUtils.studyListLangCount( this ); + Utils.setItemVisible( menu, R.id.games_menu_study, enable ); + m_menuPrepared = super.onPrepareOptionsMenu( menu ); } else { DbgUtils.logf( "onPrepareOptionsMenu: incomplete so bailing" ); @@ -785,6 +788,10 @@ public class GamesList extends XWExpandableListActivity } break; + case R.id.games_menu_study: + StudyList.launch( this ); + break; + case R.id.games_menu_about: showAboutDialog(); break; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/LookupActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/LookupActivity.java index de7ddd31a..3d008e271 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/LookupActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/LookupActivity.java @@ -132,7 +132,7 @@ public class LookupActivity extends XWListActivity if ( view == m_doneButton ) { switchState( -1 ); } else if ( view == m_studyButton ) { - DBUtils.addToStudyList( this, word, s_lang ); + DBUtils.addToStudyList( this, m_words[m_wordIndex], s_lang ); } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyList.java new file mode 100644 index 000000000..f092a5be6 --- /dev/null +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyList.java @@ -0,0 +1,46 @@ +/* -*- compile-command: "cd ../../../../../; ant debug install"; -*- */ +/* + * Copyright 2014 by Eric House (xwords@eehouse.org). All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package org.eehouse.android.xw4; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.widget.Spinner; + +public class StudyList extends XWListActivity { + private Spinner mSpinner; + + @Override + protected void onCreate( Bundle savedInstanceState ) + { + super.onCreate( savedInstanceState ); + + setContentView( R.layout.studylist ); + + mSpinner = (Spinner)findViewById( R.id.pick_language ); + + } + + public static void launch( Context context ) + { + Intent intent = new Intent( context, StudyList.class ); + context.startActivity( intent ); + } +}