mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
new param to interface to allow passing closure to delayed dialog
handling. Unused, so no behavior change yet.
This commit is contained in:
parent
6a6c528d36
commit
2ec0a7ba8d
12 changed files with 22 additions and 18 deletions
|
@ -785,7 +785,7 @@ public class BoardActivity extends XWActivity
|
||||||
showNotAgainDlgThen( R.string.not_again_done,
|
showNotAgainDlgThen( R.string.not_again_done,
|
||||||
R.string.key_notagain_done, COMMIT_ACTION );
|
R.string.key_notagain_done, COMMIT_ACTION );
|
||||||
} else {
|
} else {
|
||||||
dlgButtonClicked( COMMIT_ACTION, AlertDialog.BUTTON_POSITIVE );
|
dlgButtonClicked( COMMIT_ACTION, AlertDialog.BUTTON_POSITIVE, null );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -891,7 +891,7 @@ public class BoardActivity extends XWActivity
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
@Override
|
@Override
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
if ( LAUNCH_INVITE_ACTION == id ) {
|
if ( LAUNCH_INVITE_ACTION == id ) {
|
||||||
if ( DlgDelegate.DISMISS_BUTTON != which ) {
|
if ( DlgDelegate.DISMISS_BUTTON != which ) {
|
||||||
|
@ -1302,7 +1302,7 @@ public class BoardActivity extends XWActivity
|
||||||
m_toastStr = toastStr;
|
m_toastStr = toastStr;
|
||||||
if ( naMsg == 0 ) {
|
if ( naMsg == 0 ) {
|
||||||
dlgButtonClicked( SHOW_EXPL_ACTION,
|
dlgButtonClicked( SHOW_EXPL_ACTION,
|
||||||
AlertDialog.BUTTON_POSITIVE );
|
AlertDialog.BUTTON_POSITIVE, null );
|
||||||
} else {
|
} else {
|
||||||
showNotAgainDlgThen( naMsg, naKey, SHOW_EXPL_ACTION );
|
showNotAgainDlgThen( naMsg, naKey, SHOW_EXPL_ACTION );
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class DictBrowseActivity extends XWListActivity
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
@Override
|
@Override
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
Assert.assertTrue( FINISH_ACTION == id );
|
Assert.assertTrue( FINISH_ACTION == id );
|
||||||
finish();
|
finish();
|
||||||
|
|
|
@ -644,7 +644,7 @@ public class DictsActivity extends XWExpandableListActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
switch( id ) {
|
switch( id ) {
|
||||||
case DELETE_DICT_ACTION:
|
case DELETE_DICT_ACTION:
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class DlgDelegate {
|
||||||
private static final String STATE_KEYF = "STATE_%d";
|
private static final String STATE_KEYF = "STATE_%d";
|
||||||
|
|
||||||
public interface DlgClickNotify {
|
public interface DlgClickNotify {
|
||||||
void dlgButtonClicked( int id, int button );
|
void dlgButtonClicked( int id, int button, Object[] params );
|
||||||
}
|
}
|
||||||
|
|
||||||
private Activity m_activity;
|
private Activity m_activity;
|
||||||
|
@ -164,7 +164,8 @@ public class DlgDelegate {
|
||||||
// dialog
|
// dialog
|
||||||
if ( SKIP_CALLBACK != callbackID ) {
|
if ( SKIP_CALLBACK != callbackID ) {
|
||||||
m_clickCallback.dlgButtonClicked( callbackID,
|
m_clickCallback.dlgButtonClicked( callbackID,
|
||||||
AlertDialog.BUTTON_POSITIVE );
|
AlertDialog.BUTTON_POSITIVE,
|
||||||
|
null );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String msg = m_activity.getString( msgID );
|
String msg = m_activity.getString( msgID );
|
||||||
|
@ -202,7 +203,7 @@ public class DlgDelegate {
|
||||||
} else {
|
} else {
|
||||||
post( new Runnable() {
|
post( new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
m_clickCallback.dlgButtonClicked( callbackID, EMAIL_BTN );
|
m_clickCallback.dlgButtonClicked( callbackID, EMAIL_BTN, null );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -345,7 +346,7 @@ public class DlgDelegate {
|
||||||
if ( SKIP_CALLBACK != state.m_cbckID ) {
|
if ( SKIP_CALLBACK != state.m_cbckID ) {
|
||||||
m_clickCallback.
|
m_clickCallback.
|
||||||
dlgButtonClicked( state.m_cbckID,
|
dlgButtonClicked( state.m_cbckID,
|
||||||
AlertDialog.BUTTON_POSITIVE );
|
AlertDialog.BUTTON_POSITIVE, null );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -411,7 +412,8 @@ public class DlgDelegate {
|
||||||
public void onClick( DialogInterface dlg, int button ) {
|
public void onClick( DialogInterface dlg, int button ) {
|
||||||
if ( SKIP_CALLBACK != state.m_cbckID ) {
|
if ( SKIP_CALLBACK != state.m_cbckID ) {
|
||||||
m_clickCallback.dlgButtonClicked( state.m_cbckID,
|
m_clickCallback.dlgButtonClicked( state.m_cbckID,
|
||||||
button );
|
button,
|
||||||
|
state.m_params );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -428,7 +430,8 @@ public class DlgDelegate {
|
||||||
dropState( state );
|
dropState( state );
|
||||||
if ( SKIP_CALLBACK != state.m_cbckID ) {
|
if ( SKIP_CALLBACK != state.m_cbckID ) {
|
||||||
m_clickCallback.dlgButtonClicked( state.m_cbckID,
|
m_clickCallback.dlgButtonClicked( state.m_cbckID,
|
||||||
DISMISS_BUTTON );
|
DISMISS_BUTTON,
|
||||||
|
state.m_params );
|
||||||
}
|
}
|
||||||
m_activity.removeDialog( id );
|
m_activity.removeDialog( id );
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ public class DlgState implements Parcelable {
|
||||||
public int m_posButton;
|
public int m_posButton;
|
||||||
public int m_cbckID = 0;
|
public int m_cbckID = 0;
|
||||||
public int m_prefsKey;
|
public int m_prefsKey;
|
||||||
|
public Object[] m_params;
|
||||||
|
|
||||||
public DlgState( int id, String msg, int cbckID )
|
public DlgState( int id, String msg, int cbckID )
|
||||||
{
|
{
|
||||||
|
|
|
@ -600,7 +600,7 @@ public class GameConfig extends XWActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dlgButtonClicked( int id, int button )
|
public void dlgButtonClicked( int id, int button, Object[] params )
|
||||||
{
|
{
|
||||||
switch( id ) {
|
switch( id ) {
|
||||||
case LOCKED_CHANGE_ACTION:
|
case LOCKED_CHANGE_ACTION:
|
||||||
|
|
|
@ -552,7 +552,7 @@ public class GamesList extends XWExpandableListActivity
|
||||||
|
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
@Override
|
@Override
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
if ( AlertDialog.BUTTON_POSITIVE == which ) {
|
if ( AlertDialog.BUTTON_POSITIVE == which ) {
|
||||||
switch( id ) {
|
switch( id ) {
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class NewGameActivity extends XWActivity {
|
||||||
|
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
@Override
|
@Override
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
switch( id ) {
|
switch( id ) {
|
||||||
case NEW_GAME_ACTION:
|
case NEW_GAME_ACTION:
|
||||||
|
|
|
@ -190,7 +190,7 @@ public class SMSInviteActivity extends InviteActivity {
|
||||||
|
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
@Override
|
@Override
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
switch( which ) {
|
switch( which ) {
|
||||||
case AlertDialog.BUTTON_POSITIVE:
|
case AlertDialog.BUTTON_POSITIVE:
|
||||||
|
|
|
@ -178,7 +178,7 @@ public class XWActivity extends Activity
|
||||||
}
|
}
|
||||||
|
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class XWExpandableListActivity extends ExpandableListActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class XWListActivity extends ListActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
// DlgDelegate.DlgClickNotify interface
|
// DlgDelegate.DlgClickNotify interface
|
||||||
public void dlgButtonClicked( int id, int which )
|
public void dlgButtonClicked( int id, int which, Object[] params )
|
||||||
{
|
{
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue