use a standard list item for words rather than consing up a TextView

and having to worry about text size.
This commit is contained in:
Andy2 2011-11-21 07:20:12 -08:00
parent 1d13f7d1f2
commit aba4e02cac

View file

@ -1,4 +1,4 @@
/* -*- compile-command: "cd ../../../../../; ant install"; -*- */
/* -*- compile-command: "cd ../../../../../; ant debug install"; -*- */
/*
* Copyright 2009 - 2011 by Eric House (xwords@eehouse.org). All
* rights reserved.
@ -57,7 +57,6 @@ public class DictBrowseActivity extends XWListActivity
private int m_dictClosure = 0;
private int m_lang;
private String m_name;
private float m_textSize;
private Spinner m_minSpinner;
private Spinner m_maxSpinner;
private int m_minShown;
@ -93,12 +92,13 @@ public class DictBrowseActivity extends XWListActivity
public Object getItem( int position )
{
TextView text = new TextView( DictBrowseActivity.this );
TextView text =
(TextView)Utils.inflate( DictBrowseActivity.this,
android.R.layout.simple_list_item_1 );
String str = XwJNI.dict_iter_nthWord( m_dictClosure, position );
if ( null != str ) {
text.setText( str );
text.setOnClickListener( DictBrowseActivity.this );
text.setTextSize( m_textSize );
}
return text;
}
@ -153,8 +153,6 @@ public class DictBrowseActivity extends XWListActivity
m_name = name;
m_lang = DictLangCache.getDictLangCode( this, name );
m_textSize = 2.0f + new TextView( this ).getTextSize();
String[] names = { name };
DictUtils.DictPairs pairs = DictUtils.openDicts( this, names );
m_dictClosure = XwJNI.dict_iter_init( pairs.m_bytes[0],