diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java index 1c6d35276..c67b859e2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java @@ -96,6 +96,7 @@ public class DelegateBase implements DlgClickNotify, int layoutID = getLayoutID(); if ( 0 < layoutID ) { view = inflater.inflate( layoutID, container, false ); + LocUtils.xlateView( m_activity, view ); setContentView( view ); } return view; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListFrag.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListFrag.java index 059218515..ee7c4d4b7 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListFrag.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListFrag.java @@ -57,15 +57,6 @@ public class GamesListFrag extends XWFragment implements GamesListDelegator { 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 public void onActivityCreated( Bundle savedInstanceState ) { diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWFragment.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWFragment.java index c60fb80f0..9b994c882 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWFragment.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWFragment.java @@ -35,12 +35,13 @@ import junit.framework.Assert; import org.eehouse.android.xw4.loc.LocUtils; -public class XWFragment extends Fragment { +public class XWFragment extends Fragment implements Delegator { private DelegateBase m_dlgt; public void onCreate( DelegateBase dlgt, Bundle sis ) { + DbgUtils.logdf( "%s.onCreate() called", this.getClass().getName() ); super.onCreate( sis ); m_dlgt = dlgt; } @@ -49,14 +50,14 @@ public class XWFragment extends Fragment { public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) { - DbgUtils.logf( "%s.onCreateView() called", this.getClass().getName() ); + DbgUtils.logdf( "%s.onCreateView() called", this.getClass().getName() ); return m_dlgt.inflateView( inflater, container ); } @Override 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 ); super.onActivityCreated( savedInstanceState ); } @@ -64,7 +65,7 @@ public class XWFragment extends Fragment { @Override public void onPause() { - DbgUtils.logf( "%s.onPause() called", this.getClass().getName() ); + DbgUtils.logdf( "%s.onPause() called", this.getClass().getName() ); m_dlgt.onPause(); super.onPause(); } @@ -79,7 +80,7 @@ public class XWFragment extends Fragment { @Override public void onStart() { - DbgUtils.logf( "%s.onStart() called", this.getClass().getName() ); + DbgUtils.logdf( "%s.onStart() called", this.getClass().getName() ); super.onStart(); m_dlgt.onStart(); } @@ -87,7 +88,7 @@ public class XWFragment extends Fragment { @Override public void onStop() { - DbgUtils.logf( "%s.onStop() called", this.getClass().getName() ); + DbgUtils.logdf( "%s.onStop() called", this.getClass().getName() ); m_dlgt.onStop(); super.onStop(); } @@ -122,9 +123,21 @@ public class XWFragment extends Fragment { Assert.fail(); } - public void setListAdapter( ListAdapter adapter ) {} - public ListAdapter getListAdapter() { return null; } - public ListView getListView() { return null; } + public ListView getListView() + { + 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(); + } }