inherit from XWListAdapter and so get rid of one-line methods

This commit is contained in:
eehouse 2010-05-04 12:31:29 +00:00
parent 3c7d972d85
commit b6a89fd8c1

View file

@ -33,22 +33,15 @@ import junit.framework.Assert;
import org.eehouse.android.xw4.jni.*;
import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole;
public class GameListAdapter implements ListAdapter {
public class GameListAdapter extends XWListAdapter {
Context m_context;
LayoutInflater m_factory;
public GameListAdapter( Context context ) {
super( context, Utils.gamesList(context).length );
m_context = context;
m_factory = LayoutInflater.from( context );
}
public boolean areAllItemsEnabled() {
return true;
}
public boolean isEnabled( int position ) {
return true;
}
public int getCount() {
return Utils.gamesList(m_context).length;
@ -73,33 +66,10 @@ public class GameListAdapter implements ListAdapter {
return layout;
}
public long getItemId( int position ) {
return position;
}
public int getItemViewType( int position ) {
return 0;
}
public View getView( int position, View convertView, ViewGroup parent ) {
return (View)getItem( position );
}
public int getViewTypeCount() {
return 1;
}
public boolean hasStableIds() {
return true;
}
public boolean isEmpty() {
return getCount() == 0;
}
public void registerDataSetObserver(DataSetObserver observer) {}
public void unregisterDataSetObserver(DataSetObserver observer) {}
private byte[] open( String file )
{
byte[] stream = null;