mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
refactor: new constructor for common case
This commit is contained in:
parent
0728d06c4d
commit
97a3c3a2d8
5 changed files with 15 additions and 14 deletions
|
@ -1213,8 +1213,8 @@ public class BoardDelegate extends DelegateBase
|
|||
RequestCode.SMS_DATA_INVITE_RESULT );
|
||||
} else if ( Perms23.anyBanned( m_activity, perms ) ) {
|
||||
makeOkOnlyBuilder( R.string.sms_banned_ok_only )
|
||||
.setActionPair(new ActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info ) )
|
||||
.setActionPair(Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info )
|
||||
.show();
|
||||
}
|
||||
break;
|
||||
|
@ -2327,9 +2327,8 @@ public class BoardDelegate extends DelegateBase
|
|||
DlgDelegate.ConfirmThenBuilder builder =
|
||||
makeConfirmThenBuilder( explID, Action.DROP_SMS_ACTION );
|
||||
if ( banned ) {
|
||||
ActionPair pr = new ActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info );
|
||||
builder.setActionPair( pr )
|
||||
builder.setActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info )
|
||||
.setNAKey( R.string.key_na_sms_banned )
|
||||
;
|
||||
}
|
||||
|
|
|
@ -174,8 +174,8 @@ public class ConnViaViewLayout extends LinearLayout {
|
|||
DlgDelegate.DlgDelegateBuilder builder = 0 != keyID
|
||||
? m_dlgDlgt.makeNotAgainBuilder( msgID, keyID )
|
||||
: m_dlgDlgt.makeOkOnlyBuilder( msgID )
|
||||
.setActionPair( new ActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info ) )
|
||||
.setActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info )
|
||||
;
|
||||
builder.show();
|
||||
}
|
||||
|
|
|
@ -197,6 +197,9 @@ public class DlgDelegate {
|
|||
public DlgDelegateBuilder setActionPair( ActionPair pr )
|
||||
{ m_actionPair = pr; return this; }
|
||||
|
||||
public DlgDelegateBuilder setActionPair( Action actn, int id )
|
||||
{ return setActionPair( new ActionPair( actn, id ) ); }
|
||||
|
||||
abstract void show();
|
||||
}
|
||||
|
||||
|
|
|
@ -1074,8 +1074,8 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
R.string.not_again_nbsGamesOnUpgrade,
|
||||
smsGameCount );
|
||||
makeNotAgainBuilder( msg, R.string.key_notagain_nbsGamesOnUpgrade )
|
||||
.setActionPair( new ActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info ) )
|
||||
.setActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info )
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
@ -1997,12 +1997,11 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
if ( skipOffer ) {
|
||||
handleNewGame( solo );
|
||||
} else {
|
||||
ActionPair pair = new ActionPair( Action.SET_HIDE_NEWGAME_BUTTONS,
|
||||
R.string.set_pref );
|
||||
makeNotAgainBuilder( R.string.not_again_hidenewgamebuttons,
|
||||
R.string.key_notagain_hidenewgamebuttons,
|
||||
Action.NEW_GAME_PRESSED )
|
||||
.setActionPair( pair )
|
||||
.setActionPair( Action.SET_HIDE_NEWGAME_BUTTONS,
|
||||
R.string.set_pref )
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,8 +120,8 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
|||
&& Perm.SEND_SMS.isBanned(activity) ) {
|
||||
activity
|
||||
.makeOkOnlyBuilder( R.string.sms_banned_ok_only )
|
||||
.setActionPair(new ActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info ) )
|
||||
.setActionPair( Action.PERMS_BANNED_INFO,
|
||||
R.string.button_more_info )
|
||||
.show();
|
||||
} else if ( ! XWPrefs.getNBSEnabled( context ) ) {
|
||||
activity
|
||||
|
|
Loading…
Reference in a new issue