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

View file

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

View file

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

View file

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