mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
inherit from XWListAdapter and so get rid of one-line methods
This commit is contained in:
parent
3c7d972d85
commit
b6a89fd8c1
1 changed files with 2 additions and 32 deletions
|
@ -33,22 +33,15 @@ import junit.framework.Assert;
|
||||||
import org.eehouse.android.xw4.jni.*;
|
import org.eehouse.android.xw4.jni.*;
|
||||||
import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole;
|
import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole;
|
||||||
|
|
||||||
public class GameListAdapter implements ListAdapter {
|
public class GameListAdapter extends XWListAdapter {
|
||||||
Context m_context;
|
Context m_context;
|
||||||
LayoutInflater m_factory;
|
LayoutInflater m_factory;
|
||||||
|
|
||||||
public GameListAdapter( Context context ) {
|
public GameListAdapter( Context context ) {
|
||||||
|
super( context, Utils.gamesList(context).length );
|
||||||
m_context = context;
|
m_context = context;
|
||||||
m_factory = LayoutInflater.from( context );
|
m_factory = LayoutInflater.from( context );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean areAllItemsEnabled() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabled( int position ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return Utils.gamesList(m_context).length;
|
return Utils.gamesList(m_context).length;
|
||||||
|
@ -73,33 +66,10 @@ public class GameListAdapter implements ListAdapter {
|
||||||
return layout;
|
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 ) {
|
public View getView( int position, View convertView, ViewGroup parent ) {
|
||||||
return (View)getItem( position );
|
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 )
|
private byte[] open( String file )
|
||||||
{
|
{
|
||||||
byte[] stream = null;
|
byte[] stream = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue