mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
fix dispatch of extra actions
Had left out dispatch of "negative" buttons populated from an ActionPair. Tested for offer to remove redundant new game buttons at bottom of games list.
This commit is contained in:
parent
a526ec6529
commit
8e874fa45c
2 changed files with 20 additions and 16 deletions
|
@ -72,7 +72,6 @@ public class DlgDelegateAlert extends DialogFragment {
|
|||
protected void checkNotAgainCheck( DlgState state, NotAgainView naView )
|
||||
{
|
||||
if ( null != naView && naView.getChecked() ) {
|
||||
DbgUtils.logd( TAG, "is checked" );
|
||||
if ( 0 != state.m_prefsKey ) {
|
||||
XWPrefs.setPrefsBoolean( getActivity(), m_state.m_prefsKey,
|
||||
true );
|
||||
|
@ -83,6 +82,19 @@ public class DlgDelegateAlert extends DialogFragment {
|
|||
}
|
||||
}
|
||||
|
||||
protected OnClickListener mkCallbackClickListener( final ActionPair pair,
|
||||
final NotAgainView naView )
|
||||
{
|
||||
return new OnClickListener() {
|
||||
@Override
|
||||
public void onClick( DialogInterface dlg, int button ) {
|
||||
checkNotAgainCheck( m_state, naView );
|
||||
XWActivity xwact = (XWActivity)getActivity();
|
||||
xwact.onPosButton( pair.action, m_state.m_params );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected OnClickListener mkCallbackClickListener( final NotAgainView naView )
|
||||
{
|
||||
OnClickListener cbkOnClickLstnr;
|
||||
|
|
|
@ -49,14 +49,12 @@ public class NotAgainAlert extends DlgDelegateAlert {
|
|||
@Override
|
||||
public Dialog onCreateDialog( Bundle sis )
|
||||
{
|
||||
final Context context = getActivity();
|
||||
Context context = getActivity();
|
||||
DlgState state = getState( sis );
|
||||
|
||||
final DlgState state = getState( sis );
|
||||
|
||||
final NotAgainView naView = (NotAgainView)
|
||||
NotAgainView naView = (NotAgainView)
|
||||
LocUtils.inflate( context, R.layout.not_again_view );
|
||||
naView.setMessage( state.m_msg );
|
||||
// final OnClickListener lstnr_p = mkCallbackClickListener( state, naView );
|
||||
|
||||
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( context )
|
||||
.setTitle( R.string.newbie_title )
|
||||
|
@ -65,17 +63,11 @@ public class NotAgainAlert extends DlgDelegateAlert {
|
|||
mkCallbackClickListener( naView ) );
|
||||
|
||||
if ( null != state.m_pair ) {
|
||||
final ActionPair more = state.m_pair;
|
||||
OnClickListener lstnr = new OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int item ) {
|
||||
checkNotAgainCheck( state, naView );
|
||||
// m_clickCallback.onPosButton( more.action, more.params );
|
||||
}
|
||||
};
|
||||
builder.setNegativeButton( more.buttonStr, lstnr );
|
||||
ActionPair pair = state.m_pair;
|
||||
builder.setNegativeButton( pair.buttonStr,
|
||||
mkCallbackClickListener( pair, naView ) );
|
||||
}
|
||||
|
||||
Dialog dialog = builder.create();
|
||||
return dialog;
|
||||
return builder.create();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue