Skip to content

Commit

Permalink
cleanup: Renamed some widget IDs to follow a naming convention.
Browse files Browse the repository at this point in the history
No functional changes.
  • Loading branch information
littleguy77 committed Jan 21, 2013
1 parent 6e25a62 commit 9c02855
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
38 changes: 19 additions & 19 deletions res/menu/game_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,75 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
android:id="@+id/ingameToggleSpeed"
android:id="@+id/menuItem_toggleSpeed"
android:icon="@drawable/ic_clock"
android:showAsAction="ifRoom|withText"
android:title="@string/ingameToggleSpeed_title"/>
<item
android:id="@+id/ingameSlotLoad"
android:id="@+id/menuItem_slotLoad"
android:icon="@drawable/ic_folder"
android:showAsAction="ifRoom|withText"
android:title="@string/ingameSlotLoad_title"/>
<item
android:id="@+id/ingameSlotSave"
android:id="@+id/menuItem_slotSave"
android:icon="@drawable/ic_save"
android:showAsAction="ifRoom|withText"
android:title="@string/ingameSlotSave_title"/>
<item
android:id="@+id/ingameSetSlot"
android:id="@+id/menuItem_setSlot"
android:icon="@drawable/ic_storage"
android:showAsAction="ifRoom|withText"
android:title="@string/ingameSetSlot_title">
<menu>
<group android:checkableBehavior="single" >
<item
android:id="@+id/slot0"
android:id="@+id/menuItem_slot0"
android:checked="true"
android:title="0"/>
<item
android:id="@+id/slot1"
android:id="@+id/menuItem_slot1"
android:title="1"/>
<item
android:id="@+id/slot2"
android:id="@+id/menuItem_slot2"
android:title="2"/>
<item
android:id="@+id/slot3"
android:id="@+id/menuItem_slot3"
android:title="3"/>
<item
android:id="@+id/slot4"
android:id="@+id/menuItem_slot4"
android:title="4"/>
<item
android:id="@+id/slot5"
android:id="@+id/menuItem_slot5"
android:title="5"/>
<item
android:id="@+id/slot6"
android:id="@+id/menuItem_slot6"
android:title="6"/>
<item
android:id="@+id/slot7"
android:id="@+id/menuItem_slot7"
android:title="7"/>
<item
android:id="@+id/slot8"
android:id="@+id/menuItem_slot8"
android:title="8"/>
<item
android:id="@+id/slot9"
android:id="@+id/menuItem_slot9"
android:title="9"/>
</group>
</menu>
</item>
<item
android:id="@+id/ingameFileLoad"
android:id="@+id/menuItem_fileLoad"
android:title="@string/ingameFileLoad_title"/>
<item
android:id="@+id/ingameFileSave"
android:id="@+id/menuItem_fileSave"
android:title="@string/ingameFileSave_title"/>
<item
android:id="@+id/ingameSetSpeed"
android:id="@+id/menuItem_setSpeed"
android:title="@string/ingameSetSpeed_title"/>
<item
android:id="@+id/ingameSetIme"
android:id="@+id/menuItem_setIme"
android:title="@string/ingameSetIme_title"/>
<item
android:id="@+id/ingameMainMenu"
android:id="@+id/menuItem_mainMenu"
android:title="@string/ingameMainMenu_title"/>

</menu>
6 changes: 3 additions & 3 deletions res/menu/input_map_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
android:id="@+id/menuItem_SpecialVisibility"
android:id="@+id/menuItem_specialVisibility"
android:title="@string/inputMapPreference_showSpecial"/>
<item
android:id="@+id/menuItem_ControllerInfo"
android:id="@+id/menuItem_controllerInfo"
android:title="@string/actionControllerInfo_title"/>
<item
android:id="@+id/menuItem_ControllerDiagnostics"
android:id="@+id/menuItem_controllerDiagnostics"
android:title="@string/actionControllerDiagnostics_title"/>

</menu>
40 changes: 20 additions & 20 deletions src/paulscode/android/mupen64plusae/GameMenuHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public void onCreateOptionsMenu( Menu menu )
{
// Inflate the in-game menu, record the dynamic menu items/submenus for later
mActivity.getMenuInflater().inflate( R.menu.game_activity, menu );
mSlotMenuItem = menu.findItem( R.id.ingameSetSlot );
mSlotMenuItem = menu.findItem( R.id.menuItem_setSlot );
mSlotSubMenu = mSlotMenuItem.getSubMenu();
mGameSpeedItem = menu.findItem( R.id.ingameToggleSpeed );
mGameSpeedItem = menu.findItem( R.id.menuItem_toggleSpeed );
mGameSpeedItem.setTitle( mActivity.getString( R.string.ingameToggleSpeed_title,
BASELINE_SPEED_FACTOR ) );

Expand All @@ -102,58 +102,58 @@ public void onOptionsItemSelected( MenuItem item )
{
switch( item.getItemId() )
{
case R.id.slot0:
case R.id.menuItem_slot0:
setSlot( 0, true );
break;
case R.id.slot1:
case R.id.menuItem_slot1:
setSlot( 1, true );
break;
case R.id.slot2:
case R.id.menuItem_slot2:
setSlot( 2, true );
break;
case R.id.slot3:
case R.id.menuItem_slot3:
setSlot( 3, true );
break;
case R.id.slot4:
case R.id.menuItem_slot4:
setSlot( 4, true );
break;
case R.id.slot5:
case R.id.menuItem_slot5:
setSlot( 5, true );
break;
case R.id.slot6:
case R.id.menuItem_slot6:
setSlot( 6, true );
break;
case R.id.slot7:
case R.id.menuItem_slot7:
setSlot( 7, true );
break;
case R.id.slot8:
case R.id.menuItem_slot8:
setSlot( 8, true );
break;
case R.id.slot9:
case R.id.menuItem_slot9:
setSlot( 9, true );
break;
case R.id.ingameToggleSpeed:
case R.id.menuItem_toggleSpeed:
toggleSpeed();
break;
case R.id.ingameSlotSave:
case R.id.menuItem_slotSave:
saveSlot();
break;
case R.id.ingameSlotLoad:
case R.id.menuItem_slotLoad:
loadSlot();
break;
case R.id.ingameFileSave:
case R.id.menuItem_fileSave:
saveFileFromPrompt();
break;
case R.id.ingameFileLoad:
case R.id.menuItem_fileLoad:
loadFileFromPrompt();
break;
case R.id.ingameSetSpeed:
case R.id.menuItem_setSpeed:
setSpeed();
break;
case R.id.ingameSetIme:
case R.id.menuItem_setIme:
setIme();
break;
case R.id.ingameMainMenu:
case R.id.menuItem_mainMenu:
quitToMenu();
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void setupButton( int resId, int index )
public boolean onCreateOptionsMenu( Menu menu )
{
getMenuInflater().inflate( R.menu.input_map_activity, menu );
mMenuSpecialVisibility = menu.findItem( R.id.menuItem_SpecialVisibility );
mMenuSpecialVisibility = menu.findItem( R.id.menuItem_specialVisibility );
refreshSpecialVisibility();

return super.onCreateOptionsMenu( menu );
Expand All @@ -186,17 +186,17 @@ public boolean onOptionsItemSelected( MenuItem item )
{
switch( item.getItemId() )
{
case R.id.menuItem_SpecialVisibility:
case R.id.menuItem_specialVisibility:
mUserPrefs.putSpecialVisibility( mPlayer,
!mUserPrefs.getSpecialVisibility( mPlayer ) );
refreshSpecialVisibility();
break;
case R.id.menuItem_ControllerInfo:
case R.id.menuItem_controllerInfo:
String title = getString( R.string.actionControllerInfo_title );
String message = DeviceUtil.getPeripheralInfo();
new Builder( this ).setTitle( title ).setMessage( message ).create().show();
break;
case R.id.menuItem_ControllerDiagnostics:
case R.id.menuItem_controllerDiagnostics:
startActivity( new Intent( this, DiagnosticActivity.class ) );
break;
default:
Expand Down

0 comments on commit 9c02855

Please sign in to comment.