mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +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 )
|
protected void checkNotAgainCheck( DlgState state, NotAgainView naView )
|
||||||
{
|
{
|
||||||
if ( null != naView && naView.getChecked() ) {
|
if ( null != naView && naView.getChecked() ) {
|
||||||
DbgUtils.logd( TAG, "is checked" );
|
|
||||||
if ( 0 != state.m_prefsKey ) {
|
if ( 0 != state.m_prefsKey ) {
|
||||||
XWPrefs.setPrefsBoolean( getActivity(), m_state.m_prefsKey,
|
XWPrefs.setPrefsBoolean( getActivity(), m_state.m_prefsKey,
|
||||||
true );
|
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 )
|
protected OnClickListener mkCallbackClickListener( final NotAgainView naView )
|
||||||
{
|
{
|
||||||
OnClickListener cbkOnClickLstnr;
|
OnClickListener cbkOnClickLstnr;
|
||||||
|
|
|
@ -49,14 +49,12 @@ public class NotAgainAlert extends DlgDelegateAlert {
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog( Bundle sis )
|
public Dialog onCreateDialog( Bundle sis )
|
||||||
{
|
{
|
||||||
final Context context = getActivity();
|
Context context = getActivity();
|
||||||
|
DlgState state = getState( sis );
|
||||||
|
|
||||||
final DlgState state = getState( sis );
|
NotAgainView naView = (NotAgainView)
|
||||||
|
|
||||||
final NotAgainView naView = (NotAgainView)
|
|
||||||
LocUtils.inflate( context, R.layout.not_again_view );
|
LocUtils.inflate( context, R.layout.not_again_view );
|
||||||
naView.setMessage( state.m_msg );
|
naView.setMessage( state.m_msg );
|
||||||
// final OnClickListener lstnr_p = mkCallbackClickListener( state, naView );
|
|
||||||
|
|
||||||
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( context )
|
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( context )
|
||||||
.setTitle( R.string.newbie_title )
|
.setTitle( R.string.newbie_title )
|
||||||
|
@ -65,17 +63,11 @@ public class NotAgainAlert extends DlgDelegateAlert {
|
||||||
mkCallbackClickListener( naView ) );
|
mkCallbackClickListener( naView ) );
|
||||||
|
|
||||||
if ( null != state.m_pair ) {
|
if ( null != state.m_pair ) {
|
||||||
final ActionPair more = state.m_pair;
|
ActionPair pair = state.m_pair;
|
||||||
OnClickListener lstnr = new OnClickListener() {
|
builder.setNegativeButton( pair.buttonStr,
|
||||||
public void onClick( DialogInterface dlg, int item ) {
|
mkCallbackClickListener( pair, naView ) );
|
||||||
checkNotAgainCheck( state, naView );
|
|
||||||
// m_clickCallback.onPosButton( more.action, more.params );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
builder.setNegativeButton( more.buttonStr, lstnr );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog dialog = builder.create();
|
return builder.create();
|
||||||
return dialog;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue