mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
make params private so can't assign without check
All array elems must be Serializable and I want to check in Debug builds when new uses are added.
This commit is contained in:
parent
a580335fea
commit
99f0c09d06
5 changed files with 17 additions and 14 deletions
|
@ -236,7 +236,7 @@ public class DlgDelegate {
|
||||||
public void run() {
|
public void run() {
|
||||||
Log.d( TAG, "calling onPosButton()" );
|
Log.d( TAG, "calling onPosButton()" );
|
||||||
XWActivity xwact = (XWActivity)m_activity;
|
XWActivity xwact = (XWActivity)m_activity;
|
||||||
xwact.onPosButton( action, mState.m_params );
|
xwact.onPosButton( action, mState.getParams() );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class DlgDelegateAlert extends XWDialogFragment {
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if ( activity instanceof DlgClickNotify ) {
|
if ( activity instanceof DlgClickNotify ) {
|
||||||
((DlgClickNotify)activity)
|
((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 ) {
|
public void onClick( DialogInterface dlg, int button ) {
|
||||||
checkNotAgainCheck( m_state, naView );
|
checkNotAgainCheck( m_state, naView );
|
||||||
DlgClickNotify xwact = (DlgClickNotify)getActivity();
|
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;
|
DlgClickNotify notify = (DlgClickNotify)activity;
|
||||||
switch ( button ) {
|
switch ( button ) {
|
||||||
case AlertDialog.BUTTON_POSITIVE:
|
case AlertDialog.BUTTON_POSITIVE:
|
||||||
notify.onPosButton( m_state.m_action, m_state.m_params );
|
notify.onPosButton( m_state.m_action, m_state.getParams() );
|
||||||
break;
|
break;
|
||||||
case AlertDialog.BUTTON_NEGATIVE:
|
case AlertDialog.BUTTON_NEGATIVE:
|
||||||
notify.onNegButton( m_state.m_action, m_state.m_params );
|
notify.onNegButton( m_state.m_action, m_state.getParams() );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.e( TAG, "unexpected button %d", button );
|
Log.e( TAG, "unexpected button %d", button );
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class DlgState implements Parcelable {
|
||||||
public ActionPair m_pair = null;
|
public ActionPair m_pair = null;
|
||||||
public int m_prefsNAKey;
|
public int m_prefsNAKey;
|
||||||
// These can't be serialized!!!!
|
// These can't be serialized!!!!
|
||||||
public Object[] m_params;
|
private Object[] m_params;
|
||||||
public String m_title;
|
public String m_title;
|
||||||
|
|
||||||
public DlgState( DlgID dlgID )
|
public DlgState( DlgID dlgID )
|
||||||
|
@ -82,6 +82,8 @@ public class DlgState implements Parcelable {
|
||||||
public DlgState setTitle( String title )
|
public DlgState setTitle( String title )
|
||||||
{ m_title = title; return this; }
|
{ m_title = title; return this; }
|
||||||
|
|
||||||
|
public Object[] getParams() { return m_params; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class EnableSMSAlert extends DlgDelegateAlert {
|
||||||
public void onClick( DialogInterface dlg, int item ) {
|
public void onClick( DialogInterface dlg, int item ) {
|
||||||
Assert.assertTrue( 0 < mSpinner.getSelectedItemPosition() );
|
Assert.assertTrue( 0 < mSpinner.getSelectedItemPosition() );
|
||||||
XWActivity xwact = (XWActivity)getActivity();
|
XWActivity xwact = (XWActivity)getActivity();
|
||||||
xwact.onPosButton( state.m_action, state.m_params );
|
xwact.onPosButton( state.m_action, state.getParams() );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,10 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
final ArrayList<InviteMeans> means = new ArrayList<>();
|
final ArrayList<InviteMeans> means = new ArrayList<>();
|
||||||
ArrayList<String> items = new ArrayList<>();
|
ArrayList<String> items = new ArrayList<>();
|
||||||
InviteMeans lastMeans = null;
|
InviteMeans lastMeans = null;
|
||||||
if ( null != state.m_params
|
Object[] params = state.getParams();
|
||||||
&& state.m_params[0] instanceof SentInvitesInfo ) {
|
if ( null != params
|
||||||
lastMeans = ((SentInvitesInfo)state.m_params[0]).getLastMeans();
|
&& params[0] instanceof SentInvitesInfo ) {
|
||||||
|
lastMeans = ((SentInvitesInfo)params[0]).getLastMeans();
|
||||||
}
|
}
|
||||||
|
|
||||||
add( items, means, R.string.invite_choice_email, InviteMeans.EMAIL );
|
add( items, means, R.string.invite_choice_email, InviteMeans.EMAIL );
|
||||||
|
@ -142,7 +143,7 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
XWActivity activity = (XWActivity)context;
|
XWActivity activity = (XWActivity)context;
|
||||||
activity.inviteChoiceMade( state.m_action,
|
activity.inviteChoiceMade( state.m_action,
|
||||||
means.get(indx),
|
means.get(indx),
|
||||||
state.m_params );
|
state.getParams() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -156,9 +157,9 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
OnClickListener ocl = new OnClickListener() {
|
OnClickListener ocl = new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( DialogInterface dlg, int pos ) {
|
public void onClick( DialogInterface dlg, int pos ) {
|
||||||
if ( state.m_params[0] instanceof SentInvitesInfo ) {
|
Object[] params = state.getParams();
|
||||||
SentInvitesInfo sii = (SentInvitesInfo)
|
if ( params[0] instanceof SentInvitesInfo ) {
|
||||||
state.m_params[0];
|
SentInvitesInfo sii = (SentInvitesInfo)params[0];
|
||||||
sii.setRemotesRobots();
|
sii.setRemotesRobots();
|
||||||
}
|
}
|
||||||
okClicked.onClick( dlg, pos );
|
okClicked.onClick( dlg, pos );
|
||||||
|
|
Loading…
Reference in a new issue