remove unneeded code

This commit is contained in:
Eric House 2020-06-25 12:01:44 -07:00
parent 6b2fceb468
commit 68343858d0
5 changed files with 20 additions and 40 deletions

View file

@ -123,10 +123,6 @@ public class DlgDelegate {
ASKED_PHONE_STATE,
PERMS_QUERY,
PERMS_BANNED_INFO,
// Sent when not-again checkbox checked
SET_NA_DEFAULTNAME,
SET_GOT_LANGDICT,
} // Action enum
public static class ActionPair implements Serializable {
@ -218,12 +214,6 @@ public class DlgDelegate {
return this;
}
Builder setOnNA( Action onNAAction )
{
mState.setOnNA( onNAAction );
return this;
}
public void show()
{
int naKey = mState.m_prefsNAKey;

View file

@ -162,9 +162,6 @@ public class DlgDelegateAlert extends XWDialogFragment {
if ( 0 != state.m_prefsNAKey ) {
XWPrefs.setPrefsBoolean( getActivity(), m_state.m_prefsNAKey,
true );
} else if ( null != state.m_onNAChecked ) {
DlgClickNotify notify = (DlgClickNotify)getActivity();
notify.onPosButton( m_state.m_onNAChecked );
}
}
}

View file

@ -46,7 +46,6 @@ public class DlgState implements Parcelable {
public int m_prefsNAKey;
// These can't be serialized!!!!
public Object[] m_params;
public Action m_onNAChecked;
public int m_titleId;
public DlgState( DlgID dlgID )
@ -76,8 +75,6 @@ public class DlgState implements Parcelable {
}
public DlgState setActionPair( ActionPair pair )
{ m_pair = pair; return this; }
public DlgState setOnNA( Action na )
{ m_onNAChecked = na; return this; }
public DlgState setPosButton( int id )
{ m_posButton = id; return this; }
public DlgState setNegButton( int id )
@ -88,6 +85,7 @@ public class DlgState implements Parcelable {
@Override
public String toString()
{
String result;
if ( BuildConfig.DEBUG) {
String params = "";
if ( null != m_params ) {
@ -97,14 +95,22 @@ public class DlgState implements Parcelable {
}
params = TextUtils.join( ",", strs );
}
return String.format("[id: %s; msg: %s; key: %s; action: %s; pair %s; "
+ "na: %s; pos: %d; neg: %d; title: %d; "
+ "params: %s]",
m_id, m_msg, m_prefsNAKey, m_action, m_pair, m_onNAChecked,
m_posButton, m_negButton, m_titleId, params );
result = new StringBuffer()
.append("{id: ").append(m_id)
.append(", msg: \"").append(m_msg)
.append("\", naKey: ").append(m_prefsNAKey)
.append(", action: ").append(m_action)
.append(", pair ").append(m_pair)
.append(", pos: ").append(m_posButton)
.append(", neg: ").append(m_negButton)
.append(", title: ").append(m_titleId)
.append(", params: [").append(params)
.append("]}")
.toString();
} else {
return super.toString();
result = super.toString();
}
return result;
}
// I only need this if BuildConfig.DEBUG is true...
@ -125,7 +131,6 @@ public class DlgState implements Parcelable {
&& ((null == m_pair) ? (null == other.m_pair) : m_pair.equals(other.m_pair))
&& m_prefsNAKey == other.m_prefsNAKey
&& Arrays.deepEquals( m_params, other.m_params )
&& m_onNAChecked == other.m_onNAChecked
&& m_titleId == other.m_titleId;
}
} else {
@ -159,7 +164,6 @@ public class DlgState implements Parcelable {
out.writeInt( m_negButton );
out.writeInt( null == m_action ? -1 : m_action.ordinal() );
out.writeInt( m_prefsNAKey );
out.writeInt( null == m_onNAChecked ? -1 : m_onNAChecked.ordinal() );
out.writeInt( m_titleId );
out.writeString( m_msg );
out.writeSerializable( m_params );
@ -192,8 +196,6 @@ public class DlgState implements Parcelable {
int tmp = in.readInt();
Action action = 0 > tmp ? null : Action.values()[tmp];
int prefsKey = in.readInt();
tmp = in.readInt();
Action onNA = 0 > tmp ? null : Action.values()[tmp];
int titleId = in.readInt();
String msg = in.readString();
Object[] params = (Object[])in.readSerializable();
@ -204,7 +206,6 @@ public class DlgState implements Parcelable {
.setNegButton( negButton )
.setAction( action )
.setPrefsNAKey( prefsKey )
.setOnNA( onNA )
.setTitle(titleId)
.setParams(params)
.setActionPair(pair)

View file

@ -1452,15 +1452,6 @@ public class GamesListDelegate extends ListDelegateBase
}
break;
case SET_NA_DEFAULTNAME:
XWPrefs.setPrefsBoolean( m_activity, R.string.key_notagain_dfltname,
true );
break;
case SET_GOT_LANGDICT:
XWPrefs.setPrefsBoolean( m_activity, R.string.key_got_langdict,
true );
break;
default:
handled = super.onPosButton( action, params );
}
@ -2497,7 +2488,8 @@ public class GamesListDelegate extends ListDelegateBase
xlateLang( lang ) );
makeConfirmThenBuilder( msg, Action.DWNLD_LOC_DICT )
.setPosButton( R.string.button_download )
.setOnNA( Action.SET_GOT_LANGDICT )
.setNegButton( R.string.button_no )
.setNAKey( R.string.key_got_langdict )
.setParams( lang, name )
.show();
}
@ -2754,7 +2746,7 @@ public class GamesListDelegate extends ListDelegateBase
String msg = getQuantityString( R.plurals.confirm_reset_fmt,
rowIDs.length, rowIDs.length );
makeConfirmThenBuilder( msg, Action.RESET_GAMES )
.setPosButton(R.string.button_reset)
.setPosButton( R.string.button_reset )
.setParams( rowIDs )
.show();
}
@ -2798,7 +2790,7 @@ public class GamesListDelegate extends ListDelegateBase
name2 );
makeConfirmThenBuilder( msg, Action.NEW_GAME_DFLT_NAME )
.setOnNA( Action.SET_NA_DEFAULTNAME )
.setNAKey( R.string.key_notagain_dfltname )
.setNegButton( R.string.button_later )
.setParams( name, doConfigure )
.show();

View file

@ -2058,7 +2058,7 @@
wordlists and view the ones you already have.\n\nWhat wordlists
you have installed determines:\n• What languages you can play
in\n• How smart the robot player is\n• What words are
legal.\n\nCheck the \"Show downloadable\" box at the top to see
legal\n\nCheck the \"Show downloadable\" box at the top to see
what\'s available.</string>
<string name="force_tablet_title">Use tablet (side-by-side) layout?</string>
<string name="force_tablet_default">Use default for my device</string>