diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java index 110595663..866497397 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java @@ -236,7 +236,7 @@ public class DlgDelegate { public void run() { Log.d( TAG, "calling onPosButton()" ); XWActivity xwact = (XWActivity)m_activity; - xwact.onPosButton( action, mState.m_params ); + xwact.onPosButton( action, mState.getParams() ); } }); } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegateAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegateAlert.java index c1ffe9df9..940f93531 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegateAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegateAlert.java @@ -139,7 +139,7 @@ public class DlgDelegateAlert extends XWDialogFragment { Activity activity = getActivity(); if ( activity instanceof DlgClickNotify ) { ((DlgClickNotify)activity) - .onDismissed( m_state.m_action, m_state.m_params ); + .onDismissed( m_state.m_action, m_state.getParams() ); } } @@ -174,7 +174,7 @@ public class DlgDelegateAlert extends XWDialogFragment { public void onClick( DialogInterface dlg, int button ) { checkNotAgainCheck( m_state, naView ); DlgClickNotify xwact = (DlgClickNotify)getActivity(); - xwact.onPosButton( pair.action, m_state.m_params ); + xwact.onPosButton( pair.action, m_state.getParams() ); } }; } @@ -197,10 +197,10 @@ public class DlgDelegateAlert extends XWDialogFragment { DlgClickNotify notify = (DlgClickNotify)activity; switch ( button ) { case AlertDialog.BUTTON_POSITIVE: - notify.onPosButton( m_state.m_action, m_state.m_params ); + notify.onPosButton( m_state.m_action, m_state.getParams() ); break; case AlertDialog.BUTTON_NEGATIVE: - notify.onNegButton( m_state.m_action, m_state.m_params ); + notify.onNegButton( m_state.m_action, m_state.getParams() ); break; default: Log.e( TAG, "unexpected button %d", button ); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java index 8ad4e2795..09bfbaa3c 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java @@ -45,7 +45,7 @@ public class DlgState implements Parcelable { public ActionPair m_pair = null; public int m_prefsNAKey; // These can't be serialized!!!! - public Object[] m_params; + private Object[] m_params; public String m_title; public DlgState( DlgID dlgID ) @@ -82,6 +82,8 @@ public class DlgState implements Parcelable { public DlgState setTitle( String title ) { m_title = title; return this; } + public Object[] getParams() { return m_params; } + @Override public String toString() { diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/EnableSMSAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/EnableSMSAlert.java index bc084421a..3a1001d9d 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/EnableSMSAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/EnableSMSAlert.java @@ -68,7 +68,7 @@ public class EnableSMSAlert extends DlgDelegateAlert { public void onClick( DialogInterface dlg, int item ) { Assert.assertTrue( 0 < mSpinner.getSelectedItemPosition() ); XWActivity xwact = (XWActivity)getActivity(); - xwact.onPosButton( state.m_action, state.m_params ); + xwact.onPosButton( state.m_action, state.getParams() ); } }; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteChoicesAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteChoicesAlert.java index 41d14eb97..4722105d2 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteChoicesAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteChoicesAlert.java @@ -51,9 +51,10 @@ public class InviteChoicesAlert extends DlgDelegateAlert { final ArrayList means = new ArrayList<>(); ArrayList items = new ArrayList<>(); InviteMeans lastMeans = null; - if ( null != state.m_params - && state.m_params[0] instanceof SentInvitesInfo ) { - lastMeans = ((SentInvitesInfo)state.m_params[0]).getLastMeans(); + Object[] params = state.getParams(); + if ( null != params + && params[0] instanceof SentInvitesInfo ) { + lastMeans = ((SentInvitesInfo)params[0]).getLastMeans(); } add( items, means, R.string.invite_choice_email, InviteMeans.EMAIL ); @@ -142,7 +143,7 @@ public class InviteChoicesAlert extends DlgDelegateAlert { XWActivity activity = (XWActivity)context; activity.inviteChoiceMade( state.m_action, means.get(indx), - state.m_params ); + state.getParams() ); } } }; @@ -156,9 +157,9 @@ public class InviteChoicesAlert extends DlgDelegateAlert { OnClickListener ocl = new OnClickListener() { @Override public void onClick( DialogInterface dlg, int pos ) { - if ( state.m_params[0] instanceof SentInvitesInfo ) { - SentInvitesInfo sii = (SentInvitesInfo) - state.m_params[0]; + Object[] params = state.getParams(); + if ( params[0] instanceof SentInvitesInfo ) { + SentInvitesInfo sii = (SentInvitesInfo)params[0]; sii.setRemotesRobots(); } okClicked.onClick( dlg, pos );