fix so at least games list and board work. Required finishing the list view implementation.

This commit is contained in:
Eric House 2016-03-12 14:29:16 -08:00
parent aa4f4e0e99
commit 04144213d5
3 changed files with 23 additions and 18 deletions

View file

@ -96,6 +96,7 @@ public class DelegateBase implements DlgClickNotify,
int layoutID = getLayoutID(); int layoutID = getLayoutID();
if ( 0 < layoutID ) { if ( 0 < layoutID ) {
view = inflater.inflate( layoutID, container, false ); view = inflater.inflate( layoutID, container, false );
LocUtils.xlateView( m_activity, view );
setContentView( view ); setContentView( view );
} }
return view; return view;

View file

@ -57,15 +57,6 @@ public class GamesListFrag extends XWFragment implements GamesListDelegator {
super.onCreate( m_dlgt, savedInstanceState ); super.onCreate( m_dlgt, savedInstanceState );
} }
@Override
public View onCreateView( LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState )
{
View root = inflater.inflate( R.layout.game_list, container, false );
LocUtils.xlateView( getActivity(), root );
return root;
}
@Override @Override
public void onActivityCreated( Bundle savedInstanceState ) public void onActivityCreated( Bundle savedInstanceState )
{ {

View file

@ -35,12 +35,13 @@ import junit.framework.Assert;
import org.eehouse.android.xw4.loc.LocUtils; import org.eehouse.android.xw4.loc.LocUtils;
public class XWFragment extends Fragment { public class XWFragment extends Fragment implements Delegator {
private DelegateBase m_dlgt; private DelegateBase m_dlgt;
public void onCreate( DelegateBase dlgt, Bundle sis ) public void onCreate( DelegateBase dlgt, Bundle sis )
{ {
DbgUtils.logdf( "%s.onCreate() called", this.getClass().getName() );
super.onCreate( sis ); super.onCreate( sis );
m_dlgt = dlgt; m_dlgt = dlgt;
} }
@ -49,14 +50,14 @@ public class XWFragment extends Fragment {
public View onCreateView( LayoutInflater inflater, ViewGroup container, public View onCreateView( LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState ) Bundle savedInstanceState )
{ {
DbgUtils.logf( "%s.onCreateView() called", this.getClass().getName() ); DbgUtils.logdf( "%s.onCreateView() called", this.getClass().getName() );
return m_dlgt.inflateView( inflater, container ); return m_dlgt.inflateView( inflater, container );
} }
@Override @Override
public void onActivityCreated( Bundle savedInstanceState ) public void onActivityCreated( Bundle savedInstanceState )
{ {
DbgUtils.logf( "%s.onActivityCreated() called", this.getClass().getName() ); DbgUtils.logdf( "%s.onActivityCreated() called", this.getClass().getName() );
m_dlgt.init( savedInstanceState ); m_dlgt.init( savedInstanceState );
super.onActivityCreated( savedInstanceState ); super.onActivityCreated( savedInstanceState );
} }
@ -64,7 +65,7 @@ public class XWFragment extends Fragment {
@Override @Override
public void onPause() public void onPause()
{ {
DbgUtils.logf( "%s.onPause() called", this.getClass().getName() ); DbgUtils.logdf( "%s.onPause() called", this.getClass().getName() );
m_dlgt.onPause(); m_dlgt.onPause();
super.onPause(); super.onPause();
} }
@ -79,7 +80,7 @@ public class XWFragment extends Fragment {
@Override @Override
public void onStart() public void onStart()
{ {
DbgUtils.logf( "%s.onStart() called", this.getClass().getName() ); DbgUtils.logdf( "%s.onStart() called", this.getClass().getName() );
super.onStart(); super.onStart();
m_dlgt.onStart(); m_dlgt.onStart();
} }
@ -87,7 +88,7 @@ public class XWFragment extends Fragment {
@Override @Override
public void onStop() public void onStop()
{ {
DbgUtils.logf( "%s.onStop() called", this.getClass().getName() ); DbgUtils.logdf( "%s.onStop() called", this.getClass().getName() );
m_dlgt.onStop(); m_dlgt.onStop();
super.onStop(); super.onStop();
} }
@ -122,9 +123,21 @@ public class XWFragment extends Fragment {
Assert.fail(); Assert.fail();
} }
public void setListAdapter( ListAdapter adapter ) {} public ListView getListView()
public ListAdapter getListAdapter() { return null; } {
public ListView getListView() { return null; } ListView view = (ListView)m_dlgt.findViewById( android.R.id.list );
return view;
}
public void setListAdapter( ListAdapter adapter )
{
getListView().setAdapter( adapter );
}
public ListAdapter getListAdapter()
{
return getListView().getAdapter();
}
} }