mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
cleanup: use chaining everywhere building alerts
This commit is contained in:
parent
78c3d4c0e9
commit
f23e44c56d
1 changed files with 26 additions and 27 deletions
|
@ -621,11 +621,11 @@ public class DlgDelegate {
|
||||||
xlator.setVisibility( View.GONE );
|
xlator.setVisibility( View.GONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( m_activity );
|
return LocUtils.makeAlertBuilder( m_activity )
|
||||||
builder.setIcon( R.drawable.icon48x48 );
|
.setIcon( R.drawable.icon48x48 )
|
||||||
builder.setTitle( R.string.app_name );
|
.setTitle( R.string.app_name )
|
||||||
builder.setView( view );
|
.setView( view )
|
||||||
builder.setNegativeButton( R.string.changes_button,
|
.setNegativeButton( R.string.changes_button,
|
||||||
new OnClickListener() {
|
new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( DialogInterface dlg,
|
public void onClick( DialogInterface dlg,
|
||||||
|
@ -633,9 +633,9 @@ public class DlgDelegate {
|
||||||
{
|
{
|
||||||
FirstRunDialog.show( m_activity );
|
FirstRunDialog.show( m_activity );
|
||||||
}
|
}
|
||||||
} );
|
} )
|
||||||
builder.setPositiveButton( android.R.string.ok, null );
|
.setPositiveButton( android.R.string.ok, null )
|
||||||
return builder.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createLookupDialog()
|
private Dialog createLookupDialog()
|
||||||
|
@ -647,11 +647,11 @@ public class DlgDelegate {
|
||||||
|
|
||||||
private Dialog createOKDialog( DlgState state, DlgID dlgID )
|
private Dialog createOKDialog( DlgState state, DlgID dlgID )
|
||||||
{
|
{
|
||||||
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( m_activity );
|
Dialog dialog = LocUtils.makeAlertBuilder( m_activity )
|
||||||
builder.setTitle( R.string.info_title );
|
.setTitle( R.string.info_title )
|
||||||
builder.setMessage( state.m_msg );
|
.setMessage( state.m_msg )
|
||||||
builder.setPositiveButton( android.R.string.ok, null );
|
.setPositiveButton( android.R.string.ok, null )
|
||||||
Dialog dialog = builder.create();
|
.create();
|
||||||
dialog = setCallbackDismissListener( dialog, state, dlgID );
|
dialog = setCallbackDismissListener( dialog, state, dlgID );
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
|
@ -701,9 +701,8 @@ public class DlgDelegate {
|
||||||
.setView( naView )
|
.setView( naView )
|
||||||
.setPositiveButton( state.m_posButton, lstnr )
|
.setPositiveButton( state.m_posButton, lstnr )
|
||||||
.setNegativeButton( state.m_negButton, lstnr );
|
.setNegativeButton( state.m_negButton, lstnr );
|
||||||
Dialog dialog = builder.create();
|
|
||||||
|
|
||||||
return setCallbackDismissListener( dialog, state, dlgID );
|
return setCallbackDismissListener( builder.create(), state, dlgID );
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createInviteChoicesDialog( final DlgState state, DlgID dlgID )
|
private Dialog createInviteChoicesDialog( final DlgState state, DlgID dlgID )
|
||||||
|
@ -809,11 +808,11 @@ public class DlgDelegate {
|
||||||
|
|
||||||
private Dialog createDictGoneDialog()
|
private Dialog createDictGoneDialog()
|
||||||
{
|
{
|
||||||
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( m_activity );
|
Dialog dialog = LocUtils.makeAlertBuilder( m_activity )
|
||||||
builder.setTitle( R.string.no_dict_title );
|
.setTitle( R.string.no_dict_title )
|
||||||
builder.setMessage( R.string.no_dict_finish );
|
.setMessage( R.string.no_dict_finish )
|
||||||
builder.setPositiveButton( R.string.button_close_game, null );
|
.setPositiveButton( R.string.button_close_game, null )
|
||||||
Dialog dialog = builder.create();
|
.create();
|
||||||
|
|
||||||
dialog.setOnDismissListener( new DialogInterface.OnDismissListener() {
|
dialog.setOnDismissListener( new DialogInterface.OnDismissListener() {
|
||||||
public void onDismiss( DialogInterface di ) {
|
public void onDismiss( DialogInterface di ) {
|
||||||
|
|
Loading…
Reference in a new issue