for symmetry, remove default menu title from res file and set in code

either way.
This commit is contained in:
Andy2 2011-10-05 06:14:48 -07:00
parent c5c0fbccae
commit 179560867f
3 changed files with 6 additions and 10 deletions

View file

@ -3,8 +3,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:id="@+id/group_done">
<!-- title set in BoardActivity -->
<item android:id="@+id/board_menu_done"
android:title="@string/board_menu_done"
android:alphabeticShortcut="D"
/>
<item android:id="@+id/board_menu_trade"

View file

@ -1775,6 +1775,6 @@
<string name="word_list_label">Tap word to search</string>
<string name="pick_url_titlef">Look up %s at</string>
<string name="pass">Pass</string>
<string name="board_menu_pass">Pass</string>
</resources>

View file

@ -144,7 +144,6 @@ public class BoardActivity extends XWActivity
private JNIThread m_jniThread;
private JNIThread.GameStateInfo m_gsi;
private boolean m_blockingDlgPosted = false;
private String m_doneOrigTitle = null;
private String m_room;
private String m_toastStr;
@ -607,16 +606,13 @@ public class BoardActivity extends XWActivity
if ( !inTrade ) {
MenuItem item = menu.findItem( R.id.board_menu_done );
if ( null == m_doneOrigTitle ) {
m_doneOrigTitle = item.getTitle().toString();
}
String title;
int strId;
if ( 0 >= m_view.curPending() ) {
title = getString( R.string.pass );
strId = R.string.board_menu_pass;
} else {
title = m_doneOrigTitle;
strId = R.string.board_menu_done;
}
item.setTitle( title );
item.setTitle( strId );
}
return true;