From b6a89fd8c11693acd74776ad1954da884032a12c Mon Sep 17 00:00:00 2001 From: eehouse Date: Tue, 4 May 2010 12:31:29 +0000 Subject: [PATCH] inherit from XWListAdapter and so get rid of one-line methods --- .../eehouse/android/xw4/GameListAdapter.java | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java index 29ba55b4b..e3c448d9d 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java @@ -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;