diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTInviteDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTInviteDelegate.java index 35d2e09c8..553c8c9f7 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTInviteDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTInviteDelegate.java @@ -57,14 +57,13 @@ public class BTInviteDelegate extends InviteDelegate protected BTInviteDelegate( ListDelegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.btinviter ); m_activity = delegator.getActivity(); } protected void init() { - super.init( R.layout.btinviter, - R.id.button_invite, R.id.button_rescan, + super.init( R.id.button_invite, R.id.button_rescan, R.id.button_clear, R.id.invite_desc, R.string.invite_bt_desc_fmt ); m_firstScan = true; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index 6e4540592..69b261c76 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -495,7 +495,7 @@ public class BoardDelegate extends DelegateBase public BoardDelegate( Delegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState, R.menu.board_menu ); + super( delegator, savedInstanceState, R.layout.board, R.menu.board_menu ); m_activity = delegator.getActivity(); m_delegator = delegator; } @@ -515,9 +515,6 @@ public class BoardDelegate extends DelegateBase m_utils = new BoardUtilCtxt(); m_jniu = JNIUtilsImpl.get( m_activity ); - if ( null == getContentView() ) { - setContentView( R.layout.board ); - } m_timers = new TimerRunnable[4]; // needs to be in sync with // XWTimerReason m_view = (BoardView)findViewById( R.id.board_view ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java index fd97073f7..82d6572eb 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ChatDelegate.java @@ -40,7 +40,7 @@ public class ChatDelegate extends DelegateBase public ChatDelegate( Delegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState, R.menu.chat_menu ); + super( delegator, savedInstanceState, R.layout.chat, R.menu.chat_menu ); m_activity = delegator.getActivity(); } @@ -48,9 +48,6 @@ public class ChatDelegate extends DelegateBase protected void init( Bundle savedInstanceState ) { if ( BuildConstants.CHAT_SUPPORTED ) { - - setContentView( R.layout.chat ); - m_rowid = getIntent().getLongExtra( GameUtils.INTENT_KEY_ROWID, -1 ); DBUtils.HistoryPair[] pairs = DBUtils.getChatHistory( m_activity, m_rowid ); 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 2f216c013..d392dad5f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java @@ -19,16 +19,18 @@ package org.eehouse.android.xw4; -import android.view.MenuInflater; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; import android.view.Menu; +import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; import org.eehouse.android.xw4.DlgDelegate.Action; import org.eehouse.android.xw4.loc.LocUtils; @@ -43,20 +45,23 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, private Delegator m_delegator; private Activity m_activity; private int m_optionsMenuID; + private int m_layoutID; private View m_rootView; - public DelegateBase( Delegator delegator, Bundle bundle ) + public DelegateBase( Delegator delegator, Bundle bundle, int layoutID ) { - this( delegator, bundle, R.menu.empty ); + this( delegator, bundle, layoutID, R.menu.empty ); } - public DelegateBase( Delegator delegator, Bundle bundle, int optionsMenu ) + public DelegateBase( Delegator delegator, Bundle bundle, + int layoutID, int menuID ) { - Assert.assertTrue( 0 < optionsMenu ); + Assert.assertTrue( 0 < menuID ); m_delegator = delegator; m_activity = delegator.getActivity(); m_delegate = new DlgDelegate( m_activity, this, bundle ); - m_optionsMenuID = optionsMenu; + m_layoutID = layoutID; + m_optionsMenuID = menuID; LocUtils.xlateTitle( m_activity ); } @@ -75,6 +80,17 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, protected void prepareDialog( DlgID dlgID, Dialog dialog ) {} protected void onActivityResult( int requestCode, int resultCode, Intent data ) {} + // Fragments only + protected View inflateView( LayoutInflater inflater, ViewGroup container ) + { + View view = null; + int layoutID = getLayoutID(); + if ( 0 < layoutID ) { + view = inflater.inflate( layoutID, container, false ); + setContentView( view ); + } + return view; + } public boolean onCreateOptionsMenu( Menu menu, MenuInflater inflater ) { @@ -100,6 +116,11 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, return m_activity.getIntent(); } + protected int getLayoutID() + { + return m_layoutID; + } + protected Bundle getArguments() { return m_delegator.getArguments(); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseDelegate.java index e4dc60ec7..2e958cad3 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictBrowseDelegate.java @@ -158,7 +158,7 @@ public class DictBrowseDelegate extends ListDelegateBase protected DictBrowseDelegate( ListDelegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.dict_browser ); m_activity = delegator.getActivity(); } @@ -206,8 +206,6 @@ public class DictBrowseDelegate extends ListDelegateBase m_browseState.m_maxShown = m_maxAvail; } - setContentView( R.layout.dict_browser ); - Button button = (Button)findViewById( R.id.search_button ); button.setOnClickListener( new View.OnClickListener() { public void onClick( View view ) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java index 25d22fe4f..f4eb00f2e 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java @@ -299,7 +299,8 @@ public class DictsDelegate extends ListDelegateBase protected DictsDelegate( ListDelegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState, R.menu.dicts_menu ); + super( delegator, savedInstanceState, R.layout.dict_browse, + R.menu.dicts_menu ); m_activity = delegator.getActivity(); } @@ -448,7 +449,6 @@ public class DictsDelegate extends ListDelegateBase m_locNames = getStringArray( R.array.loc_names ); m_noteNone = getString( R.string.note_none ); - setContentView( R.layout.dict_browse ); m_listView = getListView(); m_listView.setOnItemLongClickListener( this ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java index 541f9676d..d71a06b3f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DwnldDelegate.java @@ -66,7 +66,7 @@ public class DwnldDelegate extends ListDelegateBase { public DwnldDelegate( ListDelegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.import_dict ); m_activity = delegator.getActivity(); } @@ -244,7 +244,6 @@ public class DwnldDelegate extends ListDelegateBase { LinearLayout item = null; requestWindowFeature( Window.FEATURE_LEFT_ICON ); - setContentView( R.layout.import_dict ); m_activity.getWindow().setFeatureDrawableResource( Window.FEATURE_LEFT_ICON, R.drawable.icon48x48 ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigDelegate.java index 834de9eb7..dee94cd23 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfigDelegate.java @@ -123,7 +123,7 @@ public class GameConfigDelegate extends DelegateBase public GameConfigDelegate( Delegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.game_config ); m_activity = delegator.getActivity(); } @@ -408,8 +408,6 @@ public class GameConfigDelegate extends DelegateBase m_forResult = intent.getBooleanExtra( GameUtils.INTENT_FORRESULT_ROWID, false ); - setContentView( R.layout.game_config ); - m_connectSetRelay = findViewById(R.id.connect_set_relay); m_connectSetSMS = findViewById(R.id.connect_set_sms); if ( !XWApp.SMSSUPPORTED ) { diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java index 0c3b2f132..4b42731ea 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java @@ -525,7 +525,7 @@ public class GamesListDelegate extends ListDelegateBase public GamesListDelegate( GamesListDelegator delegator, Bundle sis ) { - super( delegator, sis, R.menu.games_list_menu ); + super( delegator, sis, R.layout.game_list, R.menu.games_list_menu ); m_delegator = delegator; m_activity = delegator.getActivity(); m_launchedGames = new HashSet(); @@ -761,8 +761,6 @@ public class GamesListDelegate extends ListDelegateBase m_selGroupIDs = new HashSet(); getBundledData( savedInstanceState ); - // setContentView( R.layout.game_list ); - // ListView listview = getListView(); DBUtils.setDBChangeListener( this ); boolean isUpgrade = Utils.firstBootThisVersion( m_activity ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteActivity.java index 58ff97799..9ce6d3231 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteActivity.java @@ -20,7 +20,6 @@ package org.eehouse.android.xw4; -import android.app.ListActivity; import android.os.Bundle; import android.view.Window; diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteDelegate.java index 413541cb3..120a4bf51 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/InviteDelegate.java @@ -44,17 +44,16 @@ abstract class InviteDelegate extends ListDelegateBase protected Button m_clearButton; private Activity m_activity; - public InviteDelegate( ListDelegator delegator, Bundle savedInstanceState ) + public InviteDelegate( ListDelegator delegator, Bundle savedInstanceState, + int layoutID ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, layoutID, R.menu.empty ); m_activity = delegator.getActivity(); } - protected void init( int view_id, int button_invite, int button_rescan, + protected void init( int button_invite, int button_rescan, int button_clear, int desc_id, int desc_strf ) { - setContentView( view_id ); - Intent intent = getIntent(); m_nMissing = intent.getIntExtra( INTENT_KEY_NMISSING, -1 ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ListDelegateBase.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ListDelegateBase.java index 746748b5b..5c322f40f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ListDelegateBase.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ListDelegateBase.java @@ -31,16 +31,15 @@ public class ListDelegateBase extends DelegateBase { private ListDelegator m_delegator; protected ListDelegateBase( ListDelegator delegator, Bundle savedInstanceState, - int menuID ) + int layoutID ) { - super( delegator, savedInstanceState, menuID ); - m_delegator = delegator; - m_activity = delegator.getActivity(); + this( delegator, savedInstanceState, layoutID, R.menu.empty ); } - protected ListDelegateBase( ListDelegator delegator, Bundle savedState ) + protected ListDelegateBase( ListDelegator delegator, Bundle savedInstanceState, + int layoutID, int menuID ) { - super( delegator, savedState ); + super( delegator, savedInstanceState, layoutID, menuID ); m_delegator = delegator; m_activity = delegator.getActivity(); } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameDelegate.java index 2d987e80e..a69e6bb29 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameDelegate.java @@ -70,7 +70,7 @@ public class NewGameDelegate extends DelegateBase { protected NewGameDelegate( Delegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.new_game ); m_activity = delegator.getActivity(); } @@ -80,8 +80,6 @@ public class NewGameDelegate extends DelegateBase { m_groupID = getIntent().getLongExtra( GROUPID_EXTRA, -1 ); - setContentView( R.layout.new_game ); - TextView desc = (TextView)findViewById( R.id.newgame_local_desc ); m_dict = CommonPrefs.getDefaultHumanDict( m_activity ); String lang = DictLangCache.getLangName( m_activity, m_dict ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java index 6440d6172..89dfc749e 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java @@ -43,6 +43,12 @@ public class PrefsActivity extends PreferenceActivity implements Delegator { { super.onCreate( savedInstanceState ); m_dlgt = new PrefsDelegate( this, this, savedInstanceState ); + + int layoutID = m_dlgt.getLayoutID(); + if ( 0 < layoutID ) { + m_dlgt.setContentView( layoutID ); + } + m_dlgt.init( savedInstanceState ); } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsDelegate.java index 37ec062c4..288d842af 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsDelegate.java @@ -51,7 +51,7 @@ public class PrefsDelegate extends DelegateBase public PrefsDelegate( PreferenceActivity activity, Delegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState, R.menu.board_menu ); + super( delegator, savedInstanceState, R.layout.prefs_w_buttons ); m_activity = activity; } @@ -132,7 +132,6 @@ public class PrefsDelegate extends DelegateBase { // Load the preferences from an XML resource m_activity.addPreferencesFromResource( R.xml.xwprefs ); - setContentView( R.layout.prefs_w_buttons ); m_keyLogging = getString( R.string.key_logging_on ); m_smsToasting = getString( R.string.key_show_sms ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayGameDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayGameDelegate.java index 54b52b353..4bc5a1c37 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayGameDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/RelayGameDelegate.java @@ -49,14 +49,12 @@ public class RelayGameDelegate extends DelegateBase protected RelayGameDelegate( Delegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.relay_game_config ); m_activity = delegator.getActivity(); } protected void init( Bundle savedInstanceState ) { - setContentView( R.layout.relay_game_config ); - m_rowid = getIntent().getLongExtra( GameUtils.INTENT_KEY_ROWID, -1 ); m_playButton = (Button)findViewById( R.id.play_button ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSInviteDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSInviteDelegate.java index c44419ce1..0c60b602c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSInviteDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSInviteDelegate.java @@ -67,14 +67,13 @@ public class SMSInviteDelegate extends InviteDelegate { public SMSInviteDelegate( ListDelegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.smsinviter ); m_activity = delegator.getActivity(); } protected void init( Bundle savedInstanceState ) { - super.init( R.layout.smsinviter, - R.id.button_invite, R.id.button_add, + super.init( R.id.button_invite, R.id.button_add, R.id.button_clear, R.id.invite_desc, R.string.invite_sms_desc_fmt ); getBundledData( savedInstanceState ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListDelegate.java index 9700f1de7..f6a1a2f1c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListDelegate.java @@ -70,16 +70,13 @@ public class StudyListDelegate extends ListDelegateBase protected StudyListDelegate( ListDelegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState, R.menu.studylist ); + super( delegator, savedInstanceState, R.layout.studylist, R.menu.studylist ); m_activity = delegator.getActivity(); } protected void init( Bundle savedInstanceState ) { DbgUtils.logf( "%s.init() called", getClass().getName() ); - if ( null == getContentView() ) { - setContentView( R.layout.studylist ); - } m_list = (ListView)findViewById( android.R.id.list ); m_spinner = (Spinner)findViewById( R.id.pick_lang_spinner ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListFrag.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListFrag.java index 441b29062..879e74220 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListFrag.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/StudyListFrag.java @@ -32,7 +32,7 @@ public class StudyListFrag extends XWListFragment implements ListDelegator { { DbgUtils.logf( "StudyListFrag.onCreate()" ); m_dlgt = new StudyListDelegate( this, savedInstanceState ); - super.onCreate( m_dlgt, savedInstanceState, R.layout.studylist ); + super.onCreate( m_dlgt, savedInstanceState ); } @Override diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java index f6227266f..b7787cac1 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWActivity.java @@ -34,6 +34,12 @@ public class XWActivity extends Activity implements Delegator { { super.onCreate( savedInstanceState ); m_dlgt = dlgt; + + int layoutID = m_dlgt.getLayoutID(); + if ( 0 < layoutID ) { + m_dlgt.setContentView( layoutID ); + } + dlgt.init( savedInstanceState ); } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListActivity.java index 8477889f6..cdfc6442a 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListActivity.java @@ -35,6 +35,12 @@ public class XWListActivity extends ListActivity implements ListDelegator { { super.onCreate( savedInstanceState ); m_dlgt = dlgt; + + int layoutID = m_dlgt.getLayoutID(); + if ( 0 < layoutID ) { + m_dlgt.setContentView( layoutID ); + } + dlgt.init( savedInstanceState ); } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListFragment.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListFragment.java index 101614aad..803431336 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListFragment.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/XWListFragment.java @@ -36,13 +36,6 @@ import org.eehouse.android.xw4.loc.LocUtils; public class XWListFragment extends ListFragment { private ListDelegateBase m_dlgt; - private int m_layoutID = -1; - - protected void onCreate( ListDelegateBase dlgt, Bundle sis, int layoutID ) - { - onCreate( dlgt, sis ); - m_layoutID = layoutID; - } public void onCreate( ListDelegateBase dlgt, Bundle savedInstanceState ) { @@ -55,16 +48,9 @@ public class XWListFragment extends ListFragment { Bundle savedInstanceState ) { DbgUtils.logf( "%s.onCreateView() called", this.getClass().getName() ); - View view = null; - if ( 0 < m_layoutID ) { - view = inflater.inflate( m_layoutID, container, false ); - m_dlgt.setContentView( view ); - // LocUtils.xlateView( getActivity(), view ); - } - return view; + return m_dlgt.inflateView( inflater, container ); } - @Override public void onActivityCreated( Bundle savedInstanceState ) { DbgUtils.logf( "%s.onActivityCreated() called", this.getClass().getName() ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocActivity.java index edc742c02..b4b895781 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocActivity.java @@ -35,9 +35,9 @@ public class LocActivity extends XWListActivity { super.onCreate( savedInstanceState, m_dlgt ); } // onCreate - @Override - public boolean onCreateOptionsMenu( Menu menu ) - { - return m_dlgt.onCreateOptionsMenu( menu ); - } + // @Override + // public boolean onCreateOptionsMenu( Menu menu ) + // { + // return m_dlgt.onCreateOptionsMenu( menu ); + // } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocDelegate.java index 9c981521c..dbdbeb43f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocDelegate.java @@ -53,9 +53,8 @@ public class LocDelegate extends ListDelegateBase protected LocDelegate( ListDelegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState ); + super( delegator, savedInstanceState, R.layout.loc_main ); m_activity = delegator.getActivity(); - init( savedInstanceState ); } protected boolean onBackPressed() @@ -98,8 +97,6 @@ public class LocDelegate extends ListDelegateBase protected void init( Bundle savedInstanceState ) { - setContentView( R.layout.loc_main ); - m_searchButton = (ImageButton)findViewById( R.id.loc_search_button ); m_searchButton.setOnClickListener( this ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocItemEditDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocItemEditDelegate.java index f8376cf61..bc96a4af1 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocItemEditDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/loc/LocItemEditDelegate.java @@ -56,13 +56,14 @@ public class LocItemEditDelegate extends DelegateBase implements TextWatcher { protected LocItemEditDelegate( Delegator delegator, Bundle savedInstanceState ) { - super( delegator, savedInstanceState, R.menu.loc_item_menu ); + super( delegator, savedInstanceState, R.layout.loc_item_edit, + R.menu.loc_item_menu ); m_activity = delegator.getActivity(); } protected void init( Bundle savedInstanceState ) { - setContentView( R.layout.loc_item_edit ); + // setContentView( R.layout.loc_item_edit ); String key = getIntent().getStringExtra( KEY ); m_key = key;