add (empty so far) studylist browser and menu to invoke it

This commit is contained in:
Eric House 2014-01-28 06:50:27 -08:00
parent 9d19bed3b7
commit 4421472391
7 changed files with 88 additions and 2 deletions

View file

@ -125,6 +125,10 @@
android:theme="@android:style/Theme.Dialog"
/>
<activity android:name="StudyList"
android:configChanges="keyboardHidden|orientation|screenSize"
/>
<receiver android:name="RelayReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
>
<Spinner android:id="@+id/pick_language"
android:prompt="@string/pick_language_prompt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
/>
<ExpandableListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:drawSelectorOnTop="false"
/>
</LinearLayout>

View file

@ -26,6 +26,9 @@
android:icon="@drawable/dict__gen"
android:showAsAction="ifRoom"
/>
<item android:id="@+id/games_menu_study"
android:title="@string/gamel_menu_study"
/>
<item android:id="@+id/games_menu_email"
android:title="@string/board_menu_file_email"
android:icon="@drawable/email__gen"

View file

@ -2208,5 +2208,6 @@
<string name="title_studyon">Enable study lists</string>
<string name="summary_studyon">Offer to add to and display lists
of words to remember</string>
<string name="gamel_menu_study">Study list…</string>
<string name="pick_language_prompt">Choose list language</string>
</resources>

View file

@ -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;

View file

@ -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 );
}
}

View file

@ -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 );
}
}