refactor: use builder for notAgain dialogs too

This commit is contained in:
Eric House 2016-08-15 12:10:36 -07:00
parent 7f211c6cb5
commit c36adeebbd
11 changed files with 172 additions and 138 deletions

View file

@ -296,10 +296,10 @@ public class BoardDelegate extends DelegateBase
public void onClick( DialogInterface dialog, public void onClick( DialogInterface dialog,
int whichButton ) { int whichButton ) {
curThis(). curThis().
showNotAgainDlgThen( R.string.not_again_lookup, makeNotAgainBuilder( R.string.not_again_lookup,
R.string. R.string.key_na_lookup,
key_na_lookup, Action.LOOKUP_ACTION )
Action.LOOKUP_ACTION ); .show();
} }
}; };
ab.setNegativeButton( buttonTxt, lstnr ); ab.setNegativeButton( buttonTxt, lstnr );
@ -863,9 +863,10 @@ public class BoardDelegate extends DelegateBase
int nTiles = XwJNI.model_getNumTilesInTray( m_jniGamePtr, int nTiles = XwJNI.model_getNumTilesInTray( m_jniGamePtr,
m_view.getCurPlayer() ); m_view.getCurPlayer() );
if ( XWApp.MAX_TRAY_TILES > nTiles ) { if ( XWApp.MAX_TRAY_TILES > nTiles ) {
showNotAgainDlgThen( R.string.not_again_done, makeNotAgainBuilder( R.string.not_again_done,
R.string.key_notagain_done, R.string.key_notagain_done,
Action.COMMIT_ACTION ); Action.COMMIT_ACTION )
.show();
} else { } else {
dlgButtonClicked( Action.COMMIT_ACTION, AlertDialog.BUTTON_POSITIVE, null ); dlgButtonClicked( Action.COMMIT_ACTION, AlertDialog.BUTTON_POSITIVE, null );
} }
@ -909,8 +910,9 @@ public class BoardDelegate extends DelegateBase
int strID = ABUtils.haveActionBar() ? R.string.not_again_trading_menu int strID = ABUtils.haveActionBar() ? R.string.not_again_trading_menu
: R.string.not_again_trading_buttons; : R.string.not_again_trading_buttons;
msg += getString( strID ); msg += getString( strID );
showNotAgainDlgThen( msg, R.string.key_notagain_trading, makeNotAgainBuilder( msg, R.string.key_notagain_trading,
Action.START_TRADE_ACTION ); Action.START_TRADE_ACTION )
.show();
break; break;
case R.id.board_menu_tray: case R.id.board_menu_tray:
@ -961,9 +963,10 @@ public class BoardDelegate extends DelegateBase
break; break;
case R.id.gamel_menu_checkmoves: case R.id.gamel_menu_checkmoves:
showNotAgainDlgThen( R.string.not_again_sync, makeNotAgainBuilder( R.string.not_again_sync,
R.string.key_notagain_sync, R.string.key_notagain_sync,
Action.SYNC_ACTION ); Action.SYNC_ACTION )
.show();
break; break;
case R.id.board_menu_file_prefs: case R.id.board_menu_file_prefs:
@ -1580,7 +1583,8 @@ public class BoardDelegate extends DelegateBase
dlgButtonClicked( Action.SHOW_EXPL_ACTION, dlgButtonClicked( Action.SHOW_EXPL_ACTION,
AlertDialog.BUTTON_POSITIVE, null ); AlertDialog.BUTTON_POSITIVE, null );
} else { } else {
showNotAgainDlgThen( naMsg, naKey, Action.SHOW_EXPL_ACTION ); makeNotAgainBuilder( naMsg, naKey, Action.SHOW_EXPL_ACTION )
.show();
} }
} }
@ -1761,8 +1765,9 @@ public class BoardDelegate extends DelegateBase
m_nMissing = 0; m_nMissing = 0;
post( new Runnable() { post( new Runnable() {
public void run() { public void run() {
showNotAgainDlg( R.string.not_again_turnchanged, makeNotAgainBuilder( R.string.not_again_turnchanged,
R.string.key_notagain_turnchanged ); R.string.key_notagain_turnchanged )
.show();
} }
} ); } );
handleViaThread( JNICmd.CMD_ZOOM, -8 ); handleViaThread( JNICmd.CMD_ZOOM, -8 );
@ -2645,8 +2650,9 @@ public class BoardDelegate extends DelegateBase
} else if ( 2 != gi.nPlayers ) { } else if ( 2 != gi.nPlayers ) {
Assert.assertNotNull( dlgt ); Assert.assertNotNull( dlgt );
if ( null != dlgt ) { if ( null != dlgt ) {
dlgt.showNotAgainDlg( R.string.not_again_rematch_two_only, dlgt.makeNotAgainBuilder( R.string.not_again_rematch_two_only,
R.string.key_na_rematch_two_only ); R.string.key_na_rematch_two_only )
.show();
} }
doIt = false; doIt = false;
} else { } else {

View file

@ -151,9 +151,8 @@ public class ConnViaViewLayout extends LinearLayout {
Assert.fail(); Assert.fail();
break; break;
} }
m_dlgDlgt.showNotAgainDlgThen( msgID, keyID, m_dlgDlgt.makeNotAgainBuilder( msgID, keyID )
DlgDelegate.Action.SKIP_CALLBACK ); .show();
} }
} }
} }

View file

@ -45,6 +45,7 @@ import org.eehouse.android.xw4.DlgDelegate.Action;
import org.eehouse.android.xw4.DlgDelegate.ActionPair; import org.eehouse.android.xw4.DlgDelegate.ActionPair;
import org.eehouse.android.xw4.DlgDelegate.ConfirmThenBuilder; import org.eehouse.android.xw4.DlgDelegate.ConfirmThenBuilder;
import org.eehouse.android.xw4.DlgDelegate.DlgClickNotify; import org.eehouse.android.xw4.DlgDelegate.DlgClickNotify;
import org.eehouse.android.xw4.DlgDelegate.NotAgainBuilder;
import org.eehouse.android.xw4.MultiService.MultiEvent; import org.eehouse.android.xw4.MultiService.MultiEvent;
import org.eehouse.android.xw4.loc.LocUtils; import org.eehouse.android.xw4.loc.LocUtils;
@ -472,37 +473,26 @@ public class DelegateBase implements DlgClickNotify,
Utils.setRemoveOnDismiss( m_activity, dialog, dlgID ); Utils.setRemoveOnDismiss( m_activity, dialog, dlgID );
} }
protected void showNotAgainDlgThen( int msgID, int prefsKey, public NotAgainBuilder
Action action, Object... params ) makeNotAgainBuilder( String msg, int key, Action action )
{ {
m_dlgDelegate.showNotAgainDlgThen( msgID, prefsKey, action, null, params ); return m_dlgDelegate.makeNotAgainBuilder( msg, key, action );
} }
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action ) public NotAgainBuilder
makeNotAgainBuilder( int msgId, int key, Action action )
{ {
m_dlgDelegate.showNotAgainDlgThen( msgID, prefsKey, action ); return m_dlgDelegate.makeNotAgainBuilder( msgId, key, action );
} }
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action, public NotAgainBuilder makeNotAgainBuilder( String msg, int key )
ActionPair more )
{ {
m_dlgDelegate.showNotAgainDlgThen( msgID, prefsKey, action, more ); return m_dlgDelegate.makeNotAgainBuilder( msg, key );
} }
protected void showNotAgainDlgThen( String msg, int prefsKey, public NotAgainBuilder makeNotAgainBuilder( int msgId, int key )
Action action )
{ {
m_dlgDelegate.showNotAgainDlgThen( msg, prefsKey, action, null, null ); return m_dlgDelegate.makeNotAgainBuilder( msgId, key );
}
protected void showNotAgainDlg( int msgID, int prefsKey )
{
m_dlgDelegate.showNotAgainDlgThen( msgID, prefsKey );
}
protected void showNotAgainDlgThen( int msgID, int prefsKey )
{
m_dlgDelegate.showNotAgainDlgThen( msgID, prefsKey );
} }
// It sucks that these must be duplicated here and XWActivity // It sucks that these must be duplicated here and XWActivity

View file

@ -538,7 +538,8 @@ public class DictsDelegate extends ListDelegateBase
m_origTitle = getTitle(); m_origTitle = getTitle();
showNotAgainDlg( R.string.not_again_dicts, R.string.key_na_dicts ); makeNotAgainBuilder( R.string.not_again_dicts, R.string.key_na_dicts )
.show();
} // init } // init
@Override @Override

View file

@ -152,53 +152,44 @@ public class DlgDelegate {
} }
} }
public class ConfirmThenBuilder { public abstract class DlgDelegateBuilder {
private String m_msgString; protected String m_msgString;
private NAKey m_nakey; protected NAKey m_nakey;
private Runnable m_onNA; protected Runnable m_onNA;
private int m_posButton = android.R.string.ok; protected int m_posButton = android.R.string.ok;
private int m_negButton = android.R.string.cancel; protected int m_negButton = android.R.string.cancel;
private Action m_action; protected Action m_action;
private Object[] m_params; protected Object[] m_params;
public ConfirmThenBuilder( String msg, Action action ) public DlgDelegateBuilder( String msg, Action action )
{ { m_msgString = msg; m_action = action; }
m_msgString = msg;
m_action = action;
}
public ConfirmThenBuilder( int msgId, Action action )
{
this( getString(msgId), action );
}
public ConfirmThenBuilder setNAKey( int keyId ) { public DlgDelegateBuilder( int msgId, Action action )
m_nakey = new NAKey( keyId ); { this( getString(msgId), action );}
return this;
}
public ConfirmThenBuilder setOnNA( Runnable proc ) { public DlgDelegateBuilder setNAKey( int keyId )
m_onNA = proc; { m_nakey = new NAKey( keyId ); return this; }
return this;
}
public ConfirmThenBuilder setPosButton( int id ) public DlgDelegateBuilder setOnNA( Runnable proc )
{ { m_onNA = proc; return this; }
m_posButton = id;
return this;
}
public ConfirmThenBuilder setNegButton( int id ) public DlgDelegateBuilder setPosButton( int id )
{ { m_posButton = id; return this; }
m_negButton = id;
return this;
}
public ConfirmThenBuilder setParams( Object... params ) public DlgDelegateBuilder setNegButton( int id )
{ { m_negButton = id; return this; }
m_params = params;
return this;
}
public DlgDelegateBuilder setParams( Object... params )
{ m_params = params; return this; }
abstract void show();
}
public class ConfirmThenBuilder extends DlgDelegateBuilder {
public ConfirmThenBuilder(String msg, Action action) {super(msg, action);}
public ConfirmThenBuilder(int msgId, Action action) {super(msgId, action);}
@Override
public void show() public void show()
{ {
showConfirmThen( m_nakey, m_onNA, m_msgString, m_posButton, showConfirmThen( m_nakey, m_onNA, m_msgString, m_posButton,
@ -206,13 +197,65 @@ public class DlgDelegate {
} }
} }
public ConfirmThenBuilder makeConfirmThenBuilder( String msg, Action action ) { public class NotAgainBuilder extends DlgDelegateBuilder {
private int m_prefsKey;
private ActionPair m_actionPair;
public NotAgainBuilder(String msg, int key, Action action)
{ super(msg, action); m_prefsKey = key; }
public NotAgainBuilder(int msgId, int key, Action action)
{ super(msgId, action); m_prefsKey = key; }
public NotAgainBuilder( String msg, int key )
{ super( msg, Action.SKIP_CALLBACK ); m_prefsKey = key; }
public NotAgainBuilder( int msgId, int key )
{ super( msgId, Action.SKIP_CALLBACK ); m_prefsKey = key; }
public NotAgainBuilder setActionPair( ActionPair pr )
{ m_actionPair = pr; return this; }
@Override
public void show()
{
showNotAgainDlgThen( m_msgString, m_prefsKey,
m_action, m_actionPair,
m_params );
}
}
public ConfirmThenBuilder makeConfirmThenBuilder( String msg, Action action )
{
return new ConfirmThenBuilder( msg, action ); return new ConfirmThenBuilder( msg, action );
} }
public ConfirmThenBuilder makeConfirmThenBuilder(int msgId, Action action) {
public ConfirmThenBuilder makeConfirmThenBuilder(int msgId, Action action)
{
return new ConfirmThenBuilder( msgId, action ); return new ConfirmThenBuilder( msgId, action );
} }
public NotAgainBuilder makeNotAgainBuilder( int msgId, int key,
Action action )
{
return new NotAgainBuilder( msgId, key, action );
}
public NotAgainBuilder makeNotAgainBuilder( String msg, int key,
Action action )
{
return new NotAgainBuilder( msg, key, action );
}
public NotAgainBuilder makeNotAgainBuilder( String msg, int key )
{
return new NotAgainBuilder( msg, key );
}
public NotAgainBuilder makeNotAgainBuilder( int msgId, int key ) {
return new NotAgainBuilder( msgId, key );
}
public static final int SMS_BTN = AlertDialog.BUTTON_POSITIVE; public static final int SMS_BTN = AlertDialog.BUTTON_POSITIVE;
public static final int NFC_BTN = AlertDialog.BUTTON_NEUTRAL; public static final int NFC_BTN = AlertDialog.BUTTON_NEUTRAL;
public static final int DISMISS_BUTTON = 0; public static final int DISMISS_BUTTON = 0;
@ -232,7 +275,9 @@ public class DlgDelegate {
public interface HasDlgDelegate { public interface HasDlgDelegate {
void showOKOnlyDialog( int msgID ); void showOKOnlyDialog( int msgID );
void showOKOnlyDialog( String msg ); void showOKOnlyDialog( String msg );
void showNotAgainDlgThen( int msgID, int prefsKey, Action action ); NotAgainBuilder makeNotAgainBuilder( int msgID, int prefsKey,
Action action );
NotAgainBuilder makeNotAgainBuilder( int msgID, int prefsKey );
} }
private static Map<DlgID, WeakReference<DelegateBase>> s_pendings private static Map<DlgID, WeakReference<DelegateBase>> s_pendings
@ -376,9 +421,9 @@ public class DlgDelegate {
showDialog( DlgID.DIALOG_ENABLESMS ); showDialog( DlgID.DIALOG_ENABLESMS );
} }
public void showNotAgainDlgThen( String msg, int prefsKey, private void showNotAgainDlgThen( String msg, int prefsKey,
final Action action, ActionPair more, final Action action, ActionPair more,
final Object[] params ) final Object[] params )
{ {
if ( XWPrefs.getPrefsBoolean( m_activity, prefsKey, false ) ) { if ( XWPrefs.getPrefsBoolean( m_activity, prefsKey, false ) ) {
// If it's set, do the action without bothering with the // If it's set, do the action without bothering with the
@ -402,34 +447,6 @@ public class DlgDelegate {
} }
} }
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action,
ActionPair more, Object[] params )
{
showNotAgainDlgThen( getString( msgID ), prefsKey, action, more,
params );
}
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action )
{
showNotAgainDlgThen( msgID, prefsKey, action, null, null );
}
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action,
ActionPair more )
{
showNotAgainDlgThen( msgID, prefsKey, action, more, null );
}
public void showNotAgainDlgThen( int msgID, int prefsKey )
{
showNotAgainDlgThen( msgID, prefsKey, Action.SKIP_CALLBACK );
}
private void showNotAgainDlgThen( String msg, int prefsKey )
{
showNotAgainDlgThen( msg, prefsKey, Action.SKIP_CALLBACK, null, null );
}
private void showConfirmThen( NAKey nakey, Runnable onNA, String msg, int posButton, private void showConfirmThen( NAKey nakey, Runnable onNA, String msg, int posButton,
int negButton, Action action, Object[] params ) int negButton, Action action, Object[] params )
{ {
@ -718,7 +735,8 @@ public class DlgDelegate {
String msg = String msg =
getString( R.string.not_again_clip_expl_fmt, getString( R.string.not_again_clip_expl_fmt,
getString(R.string.slmenu_copy_sel) ); getString(R.string.slmenu_copy_sel) );
showNotAgainDlgThen( msg, R.string.key_na_clip_expl ); new NotAgainBuilder( msg, R.string.key_na_clip_expl )
.show();
break; break;
case SMS: case SMS:
if ( ! XWPrefs.getSMSEnabled( m_activity ) ) { if ( ! XWPrefs.getSMSEnabled( m_activity ) ) {

View file

@ -510,9 +510,11 @@ public class GameConfigDelegate extends DelegateBase
&& !XWPrefs.getPublicRoomsEnabled( m_activity ) ) { && !XWPrefs.getPublicRoomsEnabled( m_activity ) ) {
ActionPair pair = new ActionPair( Action.SET_ENABLE_PUBLIC, ActionPair pair = new ActionPair( Action.SET_ENABLE_PUBLIC,
R.string.enable_pubroom_title ); R.string.enable_pubroom_title );
showNotAgainDlgThen( R.string.not_again_enablepublic, makeNotAgainBuilder( R.string.not_again_enablepublic,
R.string.key_notagain_enablepublic, R.string.key_notagain_enablepublic,
Action.SKIP_CALLBACK, pair ); Action.SKIP_CALLBACK )
.setActionPair(pair)
.show();
} }
} // init } // init
@ -741,9 +743,10 @@ public class GameConfigDelegate extends DelegateBase
} else if ( m_joinPublicCheck == view ) { } else if ( m_joinPublicCheck == view ) {
adjustConnectStuff(); adjustConnectStuff();
} else if ( m_gameLockedCheck == view ) { } else if ( m_gameLockedCheck == view ) {
showNotAgainDlgThen( R.string.not_again_unlock, makeNotAgainBuilder( R.string.not_again_unlock,
R.string.key_notagain_unlock, R.string.key_notagain_unlock,
Action.LOCKED_CHANGE_ACTION ); Action.LOCKED_CHANGE_ACTION )
.show();
} else if ( m_refreshRoomsButton == view ) { } else if ( m_refreshRoomsButton == view ) {
refreshNames(); refreshNames();
} else if ( m_changeConnButton == view ) { } else if ( m_changeConnButton == view ) {

View file

@ -1144,9 +1144,11 @@ public class GamesListDelegate extends ListDelegateBase
if ( clicked instanceof GameListItem ) { if ( clicked instanceof GameListItem ) {
long rowid = ((GameListItem)clicked).getRowID(); long rowid = ((GameListItem)clicked).getRowID();
if ( ! m_launchedGames.contains( rowid ) ) { if ( ! m_launchedGames.contains( rowid ) ) {
showNotAgainDlgThen( R.string.not_again_newselect, makeNotAgainBuilder( R.string.not_again_newselect,
R.string.key_notagain_newselect, R.string.key_notagain_newselect,
Action.OPEN_GAME, rowid, summary ); Action.OPEN_GAME )
.setParams( rowid, summary )
.show();
} }
} }
} }
@ -1358,9 +1360,10 @@ public class GamesListDelegate extends ListDelegateBase
{ {
boolean handled = 0 < m_selGames.size() || 0 < m_selGroupIDs.size(); boolean handled = 0 < m_selGames.size() || 0 < m_selGroupIDs.size();
if ( handled ) { if ( handled ) {
showNotAgainDlgThen( R.string.not_again_backclears, makeNotAgainBuilder( R.string.not_again_backclears,
R.string.key_notagain_backclears, R.string.key_notagain_backclears,
Action.CLEAR_SELS ); Action.CLEAR_SELS )
.show();
} }
return handled; return handled;
} }
@ -1512,9 +1515,10 @@ public class GamesListDelegate extends ListDelegateBase
break; break;
case R.id.games_menu_checkmoves: case R.id.games_menu_checkmoves:
showNotAgainDlgThen( R.string.not_again_sync, makeNotAgainBuilder( R.string.not_again_sync,
R.string.key_notagain_sync, R.string.key_notagain_sync,
Action.SYNC_MENU ); Action.SYNC_MENU )
.show();
break; break;
case R.id.games_menu_checkupdates: case R.id.games_menu_checkupdates:
@ -1747,9 +1751,11 @@ public class GamesListDelegate extends ListDelegateBase
break; break;
case R.id.games_game_new_from: case R.id.games_game_new_from:
dropSels = true; // will select the new game instead dropSels = true; // will select the new game instead
showNotAgainDlgThen( R.string.not_again_newfrom, makeNotAgainBuilder( R.string.not_again_newfrom,
R.string.key_notagain_newfrom, R.string.key_notagain_newfrom,
Action.NEW_FROM, selRowIDs[0] ); Action.NEW_FROM )
.setParams(selRowIDs[0])
.show();
break; break;
case R.id.games_game_copy: case R.id.games_game_copy:
final GameSummary smry = GameUtils.getSummary( m_activity, final GameSummary smry = GameUtils.getSummary( m_activity,
@ -1898,9 +1904,11 @@ public class GamesListDelegate extends ListDelegateBase
} else { } else {
ActionPair pair = new ActionPair( Action.SET_HIDE_NEWGAME_BUTTONS, ActionPair pair = new ActionPair( Action.SET_HIDE_NEWGAME_BUTTONS,
R.string.set_pref ); R.string.set_pref );
showNotAgainDlgThen( R.string.not_again_hidenewgamebuttons, makeNotAgainBuilder( R.string.not_again_hidenewgamebuttons,
R.string.key_notagain_hidenewgamebuttons, R.string.key_notagain_hidenewgamebuttons,
Action.NEW_GAME_PRESSED, pair ); Action.NEW_GAME_PRESSED )
.setParams(pair)
.show();
} }
} }

View file

@ -29,6 +29,7 @@ import junit.framework.Assert;
import org.eehouse.android.xw4.DlgDelegate.Action; import org.eehouse.android.xw4.DlgDelegate.Action;
import org.eehouse.android.xw4.DlgDelegate.ConfirmThenBuilder; import org.eehouse.android.xw4.DlgDelegate.ConfirmThenBuilder;
import org.eehouse.android.xw4.DlgDelegate.NotAgainBuilder;
import org.eehouse.android.xw4.loc.LocUtils; import org.eehouse.android.xw4.loc.LocUtils;
public class PrefsActivity extends PreferenceActivity public class PrefsActivity extends PreferenceActivity
@ -109,10 +110,14 @@ public class PrefsActivity extends PreferenceActivity
m_dlgt.showOKOnlyDialog( msg ); m_dlgt.showOKOnlyDialog( msg );
} }
public void showNotAgainDlgThen( int msgID, int prefsKey, public NotAgainBuilder makeNotAgainBuilder(int msgId, int key, Action action)
Action action )
{ {
m_dlgt.showNotAgainDlgThen( msgID, prefsKey, action ); return m_dlgt.makeNotAgainBuilder( msgId, key, action );
}
public NotAgainBuilder makeNotAgainBuilder( int msgId, int key )
{
return m_dlgt.makeNotAgainBuilder( msgId, key );
} }
public ConfirmThenBuilder makeConfirmThenBuilder(String msg, Action action) public ConfirmThenBuilder makeConfirmThenBuilder(String msg, Action action)

View file

@ -118,9 +118,10 @@ public class StudyListDelegate extends ListDelegateBase
boolean handled = true; boolean handled = true;
switch ( item.getItemId() ) { switch ( item.getItemId() ) {
case R.id.slmenu_copy_sel: case R.id.slmenu_copy_sel:
showNotAgainDlgThen( R.string.not_again_studycopy, makeNotAgainBuilder( R.string.not_again_studycopy,
R.string.key_na_studycopy, R.string.key_na_studycopy,
Action.SL_COPY_ACTION ); Action.SL_COPY_ACTION )
.show();
break; break;
case R.id.slmenu_clear_sel: case R.id.slmenu_clear_sel:
String msg = getQuantityString( R.plurals.confirm_studylist_clear_fmt, String msg = getQuantityString( R.plurals.confirm_studylist_clear_fmt,

View file

@ -97,7 +97,8 @@ public class Toolbar {
{ {
View.OnClickListener listener = new View.OnClickListener() { View.OnClickListener listener = new View.OnClickListener() {
public void onClick( View view ) { public void onClick( View view ) {
m_dlgDlgt.showNotAgainDlgThen( msgID, prefsKey, action ); m_dlgDlgt.makeNotAgainBuilder( msgID, prefsKey, action )
.show();
} }
}; };
setListener( index, listener ); setListener( index, listener );
@ -108,7 +109,8 @@ public class Toolbar {
{ {
View.OnLongClickListener listener = new View.OnLongClickListener() { View.OnLongClickListener listener = new View.OnLongClickListener() {
public boolean onLongClick( View view ) { public boolean onLongClick( View view ) {
m_dlgDlgt.showNotAgainDlgThen( msgID, prefsKey, action ); m_dlgDlgt.makeNotAgainBuilder( msgID, prefsKey, action )
.show();
return true; return true;
} }
}; };

View file

@ -68,8 +68,9 @@ public class LocItemEditDelegate extends DelegateBase implements TextWatcher {
TextView view = (TextView)findViewById( R.id.english_view ); TextView view = (TextView)findViewById( R.id.english_view );
m_keyFmts = getFmtSet( key, view ); m_keyFmts = getFmtSet( key, view );
if ( 0 < m_keyFmts.size() ) { if ( 0 < m_keyFmts.size() ) {
showNotAgainDlg( R.string.not_again_fmt_expl, makeNotAgainBuilder( R.string.not_again_fmt_expl,
R.string.key_na_fmt_expl ); R.string.key_na_fmt_expl )
.show();
} }
view = (TextView)findViewById( R.id.xlated_view_blessed ); view = (TextView)findViewById( R.id.xlated_view_blessed );