add send-invites menuitem that's at top of board menu but only visible

when game's unconnected
This commit is contained in:
Eric House 2013-11-12 18:39:13 -08:00
parent e040aa388b
commit 8704efd38e
4 changed files with 24 additions and 2 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="120"
height="120" xml:space="preserve">
<g
id="g12"
transform="matrix(1.25,0,0,-1.25,0,120)">
<g transform='translate(20.24,20.6)' id='g1090'>
<path style='fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none' d='M 0,0 5.287,24.92 38.6,27.24 38.6,27.57 5.287,29.89 0,54.81 55.52,27.4 0,0 z' id='path1092'/>
</g></g>
</svg>

After

Width:  |  Height:  |  Size: 584 B

View file

@ -4,11 +4,18 @@
<group android:id="@+id/group_done">
<!-- title set in BoardActivity -->
<item android:id="@+id/board_menu_invite"
android:title="@string/board_menu_invite"
android:showAsAction="ifRoom"
android:icon="@drawable/send__gen"
/>
<item android:id="@+id/board_menu_done"
android:alphabeticShortcut="D"
android:showAsAction="ifRoom"
android:icon="@drawable/save__gen"
/>
<item android:id="@+id/board_menu_trade"
android:title="@string/board_menu_trade"
android:alphabeticShortcut="T"

View file

@ -2168,5 +2168,5 @@
<string name="prefs_thumb_summary">Setting for game snapshots</string>
<string name="dropped_dupe">Invitation ignored: already used</string>
<string name="cur_menu_markerf">%1$s (yours)</string>
<string name="board_menu_invite">Invite</string>
</resources>

View file

@ -744,6 +744,7 @@ public class BoardActivity extends XWActivity
item.setTitle( strId );
}
Utils.setItemVisible( menu, R.id.board_menu_invite, 0 < m_missing );
Utils.setItemVisible( menu, R.id.board_menu_undo_last, !inTrade );
Utils.setItemVisible( menu, R.id.board_menu_tray, !inTrade );
@ -843,7 +844,9 @@ public class BoardActivity extends XWActivity
case R.id.board_menu_undo_last:
showConfirmThen( R.string.confirm_undo_last, UNDO_LAST_ACTION );
break;
case R.id.board_menu_invite:
showDialog( DLG_INVITE );
break;
// small devices only
case R.id.board_menu_dict:
String dictName = m_gi.dictName( m_view.getCurPlayer() );
@ -1295,6 +1298,7 @@ public class BoardActivity extends XWActivity
m_room = room;
m_missing = nMissing;
showDialog( DLG_INVITE );
Utils.invalidateOptionsMenuIf( this );
} else {
toastStr = getString( R.string.msg_relay_waiting, devOrder,
room, nMissing );