From 308720186dc7998e79d15f62561b8da6f1ac449f Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 27 Oct 2011 18:43:28 -0700 Subject: [PATCH] get all word-click events and print contents -- setting up for lookup --- .../eehouse/android/xw4/DictBrowseActivity.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseActivity.java index 6093c2760..7431899f1 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseActivity.java @@ -64,8 +64,8 @@ public class DictBrowseActivity extends XWListActivity TextView text = new TextView( DictBrowseActivity.this ); String str = XwJNI.dict_iter_nthWord( m_dictClosure, position ); if ( null != str ) { - str = String.format( "%d %s", position, str ); text.setText( str ); + text.setOnClickListener( DictBrowseActivity.this ); } return text; } @@ -131,7 +131,12 @@ public class DictBrowseActivity extends XWListActivity getListView().setFastScrollEnabled( true ); Button button = (Button)findViewById( R.id.search_button ); - button.setOnClickListener( this ); + button.setOnClickListener( new View.OnClickListener() { + public void onClick( View view ) + { + findButtonClicked(); + } + } ); } @Override @@ -160,6 +165,13 @@ public class DictBrowseActivity extends XWListActivity ////////////////////////////////////////////////// @Override public void onClick( View view ) + { + TextView text = (TextView)view; + String str = text.getText().toString(); + Utils.showf( this, "Not yet ready to lookup word %s", str ); + } + + private void findButtonClicked() { EditText edit = (EditText)findViewById( R.id.word_edit ); String text = edit.getText().toString();