mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
move newbie hint about hiding newgame buttons to the buttons
themselves, and disable third button because it isn't shown on the devices I'm testing on. Not sure why. Tweak text to make sense in that context.
This commit is contained in:
parent
8044fb0fc7
commit
41a2655248
7 changed files with 78 additions and 69 deletions
|
@ -2284,11 +2284,11 @@
|
|||
<string name="set_pref">Hide buttons</string>
|
||||
|
||||
<string name="not_again_hidenewgamebuttons">Now that you have a
|
||||
few games saved you might want to hide the New Game buttons below
|
||||
to get more space. They are convenient for new players, but you
|
||||
don\'t need them because the first two items in this window\'s menu
|
||||
do the same thing.\n\n(If you hide the buttons and want them back
|
||||
you can enable them in the Appearance section of App settings.)
|
||||
few games saved you might want to hide these New Game buttons to
|
||||
get more space. They are convenient for new players, but you
|
||||
don\'t need them because the first two items in the Games List
|
||||
window\'s menu do the same thing.\n\nHide them in the Appearance
|
||||
section of App settings.
|
||||
</string>
|
||||
|
||||
<string name="invite_stays">(This dialog will stay up until all
|
||||
|
|
|
@ -1940,11 +1940,11 @@
|
|||
<string name="connection_via_label">Egnahc Etacinummoc aiv</string>
|
||||
<string name="set_pref">Edih snottub</string>
|
||||
<string name="not_again_hidenewgamebuttons">Won taht uoy evah a
|
||||
wef semag devas uoy thgim tnaw ot edih eht Wen Emag snottub woleb
|
||||
ot teg erom ecaps. Yeht era tneinevnoc rof wen ,sreyalp tub uoy
|
||||
nod\'t deen meht esuaceb eht tsrif owt smeti ni siht wodniw\'s unem
|
||||
od eht emas gniht.\n\nfI( uoy edih eht snottub dna tnaw meht kcab
|
||||
uoy nac elbane meht ni eht Ecnaraeppa noitces fo Ppa sgnittes.)
|
||||
wef semag devas uoy thgim tnaw ot edih eseht Wen Emag snottub ot
|
||||
teg erom ecaps. Yeht era tneinevnoc rof wen ,sreyalp tub uoy
|
||||
nod\'t deen meht esuaceb eht tsrif owt smeti ni eht Semag Tsil
|
||||
wodniw\'s unem od eht emas gniht.\n\nEdih meht ni eht Ecnaraeppa
|
||||
noitces fo Ppa sgnittes.
|
||||
</string>
|
||||
<string name="invite_stays">sIht( golaid lliw yats pu litnu lla
|
||||
detivni sreyalp evah detcennoc.)</string>
|
||||
|
|
|
@ -1940,11 +1940,11 @@
|
|||
<string name="connection_via_label">CHANGE COMMUNICATE VIA</string>
|
||||
<string name="set_pref">HIDE BUTTONS</string>
|
||||
<string name="not_again_hidenewgamebuttons">NOW THAT YOU HAVE A
|
||||
FEW GAMES SAVED YOU MIGHT WANT TO HIDE THE NEW GAME BUTTONS BELOW
|
||||
TO GET MORE SPACE. THEY ARE CONVENIENT FOR NEW PLAYERS, BUT YOU
|
||||
DON\'T NEED THEM BECAUSE THE FIRST TWO ITEMS IN THIS WINDOW\'S MENU
|
||||
DO THE SAME THING.\n\n(IF YOU HIDE THE BUTTONS AND WANT THEM BACK
|
||||
YOU CAN ENABLE THEM IN THE APPEARANCE SECTION OF APP SETTINGS.)
|
||||
FEW GAMES SAVED YOU MIGHT WANT TO HIDE THESE NEW GAME BUTTONS TO
|
||||
GET MORE SPACE. THEY ARE CONVENIENT FOR NEW PLAYERS, BUT YOU
|
||||
DON\'T NEED THEM BECAUSE THE FIRST TWO ITEMS IN THE GAMES LIST
|
||||
WINDOW\'S MENU DO THE SAME THING.\n\nHIDE THEM IN THE APPEARANCE
|
||||
SECTION OF APP SETTINGS.
|
||||
</string>
|
||||
<string name="invite_stays">(THIS DIALOG WILL STAY UP UNTIL ALL
|
||||
INVITED PLAYERS HAVE CONNECTED.)</string>
|
||||
|
|
|
@ -322,7 +322,7 @@ public class DelegateBase implements DlgClickNotify,
|
|||
protected void showNotAgainDlgThen( int msgID, int prefsKey,
|
||||
Action action, Object... params )
|
||||
{
|
||||
m_delegate.showNotAgainDlgThen( msgID, prefsKey, null, action, params );
|
||||
m_delegate.showNotAgainDlgThen( msgID, prefsKey, action, null, params );
|
||||
}
|
||||
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action )
|
||||
|
@ -330,15 +330,16 @@ public class DelegateBase implements DlgClickNotify,
|
|||
m_delegate.showNotAgainDlgThen( msgID, prefsKey, action );
|
||||
}
|
||||
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, ActionPair pair )
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action,
|
||||
ActionPair more )
|
||||
{
|
||||
m_delegate.showNotAgainDlgThen( msgID, prefsKey, pair );
|
||||
m_delegate.showNotAgainDlgThen( msgID, prefsKey, action, more );
|
||||
}
|
||||
|
||||
protected void showNotAgainDlgThen( String msg, int prefsKey,
|
||||
Action action )
|
||||
{
|
||||
m_delegate.showNotAgainDlgThen( msg, prefsKey, null, action, null );
|
||||
m_delegate.showNotAgainDlgThen( msg, prefsKey, action, null, null );
|
||||
}
|
||||
|
||||
protected void showNotAgainDlg( int msgID, int prefsKey )
|
||||
|
|
|
@ -55,6 +55,7 @@ public class DlgDelegate {
|
|||
OPEN_GAME,
|
||||
CLEAR_SELS,
|
||||
NEW_NET_GAME,
|
||||
NEW_GAME_PRESSED,
|
||||
SET_HIDE_NEWGAME_BUTTONS,
|
||||
|
||||
// BoardDelegate
|
||||
|
@ -246,8 +247,8 @@ public class DlgDelegate {
|
|||
showDialog( DlgID.DIALOG_ABOUT );
|
||||
}
|
||||
|
||||
public void showNotAgainDlgThen( String msg, int prefsKey,
|
||||
ActionPair pair, final Action action,
|
||||
public void showNotAgainDlgThen( String msg, int prefsKey,
|
||||
final Action action, ActionPair more,
|
||||
final Object[] params )
|
||||
{
|
||||
if ( XWPrefs.getPrefsBoolean( m_activity, prefsKey, false ) ) {
|
||||
|
@ -265,28 +266,29 @@ public class DlgDelegate {
|
|||
}
|
||||
} else {
|
||||
DlgState state =
|
||||
new DlgState( DlgID.DIALOG_NOTAGAIN, msg, prefsKey, pair, action,
|
||||
new DlgState( DlgID.DIALOG_NOTAGAIN, msg, prefsKey, action, more,
|
||||
params );
|
||||
addState( state );
|
||||
showDialog( DlgID.DIALOG_NOTAGAIN );
|
||||
}
|
||||
}
|
||||
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, ActionPair pair,
|
||||
Action action, Object[] params )
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action,
|
||||
ActionPair more, Object[] params )
|
||||
{
|
||||
showNotAgainDlgThen( getString( msgID ), prefsKey, pair, action,
|
||||
showNotAgainDlgThen( getString( msgID ), prefsKey, action, more,
|
||||
params );
|
||||
}
|
||||
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action )
|
||||
{
|
||||
showNotAgainDlgThen( msgID, prefsKey, null, action, null );
|
||||
showNotAgainDlgThen( msgID, prefsKey, action, null, null );
|
||||
}
|
||||
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, ActionPair pair )
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey, Action action,
|
||||
ActionPair more )
|
||||
{
|
||||
showNotAgainDlgThen( msgID, prefsKey, pair, Action.SKIP_CALLBACK, null );
|
||||
showNotAgainDlgThen( msgID, prefsKey, action, more, null );
|
||||
}
|
||||
|
||||
public void showNotAgainDlgThen( int msgID, int prefsKey )
|
||||
|
@ -517,17 +519,21 @@ public class DlgDelegate {
|
|||
.setMessage( state.m_msg )
|
||||
.setPositiveButton( R.string.button_ok, lstnr_p )
|
||||
.setNegativeButton( R.string.button_notagain, lstnr_n );
|
||||
if ( null != state.m_pair ) {
|
||||
final ActionPair pair = state.m_pair;
|
||||
|
||||
// Adding third button doesn't work for some reason. Either this
|
||||
// feature goes away or the "do not show again" becomes a checkbox as
|
||||
// many apps do it.
|
||||
if ( false && null != state.m_pair ) {
|
||||
final ActionPair more = state.m_pair;
|
||||
OnClickListener lstnr = new OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int item ) {
|
||||
m_clickCallback.
|
||||
dlgButtonClicked( pair.action,
|
||||
dlgButtonClicked( more.action,
|
||||
AlertDialog.BUTTON_POSITIVE,
|
||||
pair.params );
|
||||
more.params );
|
||||
}
|
||||
};
|
||||
builder.setNeutralButton( pair.buttonStr, lstnr );
|
||||
builder.setNeutralButton( more.buttonStr, lstnr );
|
||||
}
|
||||
Dialog dialog = builder.create();
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ public class DlgState implements Parcelable {
|
|||
this( dlgID, msg, R.string.button_ok, action, prefsKey );
|
||||
}
|
||||
|
||||
public DlgState( DlgID dlgID, String msg, int prefsKey, ActionPair pair,
|
||||
Action action, Object[] params )
|
||||
public DlgState( DlgID dlgID, String msg, int prefsKey, Action action,
|
||||
ActionPair more, Object[] params )
|
||||
{
|
||||
this( dlgID, msg, R.string.button_ok, action, prefsKey );
|
||||
m_params = params;
|
||||
m_pair = pair;
|
||||
m_pair = more;
|
||||
}
|
||||
|
||||
public DlgState( DlgID dlgID, String msg, int posButton,
|
||||
|
|
|
@ -126,16 +126,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
}
|
||||
}
|
||||
|
||||
int size = alist.size();
|
||||
if ( 5 <= size && !XWPrefs.getHideNewgameButtons( m_activity ) ) {
|
||||
ActionPair pair =
|
||||
new ActionPair( Action.SET_HIDE_NEWGAME_BUTTONS,
|
||||
R.string.set_pref );
|
||||
showNotAgainDlgThen( R.string.not_again_hidenewgamebuttons,
|
||||
R.string.key_notagain_hidenewgamebuttons,
|
||||
pair );
|
||||
}
|
||||
return alist.toArray( new Object[size] );
|
||||
return alist.toArray( new Object[alist.size()] );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1150,6 +1141,10 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
}
|
||||
break;
|
||||
|
||||
case NEW_GAME_PRESSED:
|
||||
showDialog( DlgID.GAMES_LIST_NEWGAME );
|
||||
break;
|
||||
|
||||
case DELETE_GROUPS:
|
||||
long[] groupIDs = (long[])params[0];
|
||||
for ( long groupID : groupIDs ) {
|
||||
|
@ -1552,31 +1547,38 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
private void setupButtons()
|
||||
{
|
||||
boolean hidden = XWPrefs.getHideNewgameButtons( m_activity );
|
||||
final Button soloButton =
|
||||
(Button)findViewById( R.id.button_newgame_solo );
|
||||
if ( hidden ) {
|
||||
soloButton.setVisibility( View.GONE );
|
||||
} else {
|
||||
soloButton.setVisibility( View.VISIBLE );
|
||||
soloButton.setOnClickListener( new View.OnClickListener() {
|
||||
public void onClick( View view ) {
|
||||
m_nextIsSolo = true;
|
||||
showDialog( DlgID.GAMES_LIST_NEWGAME );
|
||||
}
|
||||
} );
|
||||
int[] ids = { R.id.button_newgame_solo, R.id.button_newgame_multi };
|
||||
boolean[] isSolos = { true, false };
|
||||
for ( int ii = 0; ii < ids.length; ++ii ) {
|
||||
Button button = (Button)findViewById( ids[ii] );
|
||||
if ( hidden ) {
|
||||
button.setVisibility( View.GONE );
|
||||
} else {
|
||||
button.setVisibility( View.VISIBLE );
|
||||
final boolean solo = isSolos[ii];
|
||||
button.setOnClickListener( new View.OnClickListener() {
|
||||
public void onClick( View view ) {
|
||||
handleNewGameButton( solo );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
final Button netButton =
|
||||
(Button)findViewById( R.id.button_newgame_multi );
|
||||
if ( hidden ) {
|
||||
netButton.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
private void handleNewGameButton( boolean solo )
|
||||
{
|
||||
m_nextIsSolo = solo;
|
||||
|
||||
int count = m_adapter.getCount();
|
||||
boolean skipOffer = 6 > count || XWPrefs.getHideNewgameButtons( m_activity );
|
||||
if ( skipOffer ) {
|
||||
showDialog( DlgID.GAMES_LIST_NEWGAME );
|
||||
} else {
|
||||
netButton.setVisibility( View.VISIBLE );
|
||||
netButton.setOnClickListener( new View.OnClickListener() {
|
||||
public void onClick( View view ) {
|
||||
m_nextIsSolo = false;
|
||||
showDialog( DlgID.GAMES_LIST_NEWGAME );
|
||||
}
|
||||
} );
|
||||
ActionPair pair = new ActionPair( Action.SET_HIDE_NEWGAME_BUTTONS,
|
||||
R.string.set_pref );
|
||||
showNotAgainDlgThen( R.string.not_again_hidenewgamebuttons,
|
||||
R.string.key_notagain_hidenewgamebuttons,
|
||||
Action.NEW_GAME_PRESSED, pair );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue