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 f7780e237..a4b514b45 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java @@ -39,6 +39,7 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, private DlgDelegate m_delegate; private Activity m_activity; private int m_optionsMenuID = 0; + private View m_rootView; public DelegateBase( Activity activity, Bundle bundle ) { @@ -64,12 +65,31 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, return handled; } - protected View setContentView( int resID ) + protected Intent getIntent() + { + return m_activity.getIntent(); + } + + protected void setContentView( int resID ) { m_activity.setContentView( resID ); - View view = Utils.getContentView( m_activity ); - LocUtils.xlateView( m_activity, view ); - return view; + m_rootView = Utils.getContentView( m_activity ); + LocUtils.xlateView( m_activity, m_rootView ); + } + + protected View findViewById( int resID ) + { + return m_rootView.findViewById( resID ); + } + + protected void setTitle( String title ) + { + m_activity.setTitle( title ); + } + + protected String getTitle() + { + return m_activity.getTitle().toString(); } protected void startActivityForResult( Intent intent, int requestCode ) @@ -77,6 +97,11 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, m_activity.startActivityForResult( intent, requestCode ); } + protected void startActivity( Intent intent ) + { + m_activity.startActivity( intent ); + } + protected void finish() { m_activity.finish(); @@ -87,6 +112,11 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, return LocUtils.getString( m_activity, resID, params ); } + protected View inflate( int resID ) + { + return LocUtils.inflate( m_activity, resID ); + } + protected void showDialog( DlgID dlgID ) { m_delegate.showDialog( dlgID ); @@ -197,6 +227,11 @@ public class DelegateBase implements DlgDelegate.DlgClickNotify, m_delegate.showInviteChoicesThen( action ); } + protected void showOKOnlyDialogThen( String msg, Action action ) + { + m_delegate.showOKOnlyDialog( msg, action ); + } + protected void startProgress( int id ) { m_delegate.startProgress( id ); 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 42913b10c..2ce067a4e 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NewGameDelegate.java @@ -83,7 +83,7 @@ public class NewGameDelegate extends DelegateBase { m_groupID = m_activity.getIntent().getLongExtra( GROUPID_EXTRA, -1 ); - m_rootView = setContentView( R.layout.new_game ); + setContentView( R.layout.new_game ); TextView desc = (TextView)findViewById( R.id.newgame_local_desc ); m_dict = CommonPrefs.getDefaultHumanDict( m_activity ); @@ -475,11 +475,6 @@ public class NewGameDelegate extends DelegateBase { } } - private View findViewById( int resID ) - { - return m_rootView.findViewById( resID ); - } - public static void startActivity( Activity parent, long groupID ) { Intent intent = new Intent( parent, NewGameActivity.class );