get all word-click events and print contents -- setting up for lookup

This commit is contained in:
Eric House 2011-10-27 18:43:28 -07:00
parent 1741021c3c
commit 308720186d

View file

@ -64,8 +64,8 @@ public class DictBrowseActivity extends XWListActivity
TextView text = new TextView( DictBrowseActivity.this ); TextView text = new TextView( DictBrowseActivity.this );
String str = XwJNI.dict_iter_nthWord( m_dictClosure, position ); String str = XwJNI.dict_iter_nthWord( m_dictClosure, position );
if ( null != str ) { if ( null != str ) {
str = String.format( "%d %s", position, str );
text.setText( str ); text.setText( str );
text.setOnClickListener( DictBrowseActivity.this );
} }
return text; return text;
} }
@ -131,7 +131,12 @@ public class DictBrowseActivity extends XWListActivity
getListView().setFastScrollEnabled( true ); getListView().setFastScrollEnabled( true );
Button button = (Button)findViewById( R.id.search_button ); Button button = (Button)findViewById( R.id.search_button );
button.setOnClickListener( this ); button.setOnClickListener( new View.OnClickListener() {
public void onClick( View view )
{
findButtonClicked();
}
} );
} }
@Override @Override
@ -160,6 +165,13 @@ public class DictBrowseActivity extends XWListActivity
////////////////////////////////////////////////// //////////////////////////////////////////////////
@Override @Override
public void onClick( View view ) 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 ); EditText edit = (EditText)findViewById( R.id.word_edit );
String text = edit.getText().toString(); String text = edit.getText().toString();