Skip to content

Commit

Permalink
Enable Settings command on gamepads
Browse files Browse the repository at this point in the history
  • Loading branch information
Hisanobu Tomari committed Aug 16, 2014
1 parent 89d9afe commit dc5f90b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/com/example/mooncal/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (itemId == R.id.this_month) {
pickMonth();
} else if(itemId==R.id.action_settings) {
Intent intent=new Intent(this,SettingsActivity.class);
startActivity(intent);
gotoSettings();
} else {
res=false;
}
Expand Down Expand Up @@ -271,6 +270,8 @@ public boolean onKeyDown (int keyCode, KeyEvent event) {
monthShown.add(GregorianCalendar.MONTH, -1);
} else if(keyCode==KeyEvent.KEYCODE_DPAD_RIGHT) {
monthShown.add(GregorianCalendar.MONTH, 1);
} else if(keyCode==KeyEvent.KEYCODE_BUTTON_X) {
gotoSettings();
} else if(keyCode==KeyEvent.KEYCODE_BUTTON_Y) {
pickMonth();
} else {
Expand All @@ -293,4 +294,8 @@ public void onMonthPicked(int year, int monthOfYear) {
});
monthPicker.show(getFragmentManager(), "monthPicker");
}
private void gotoSettings() {
Intent intent=new Intent(this,SettingsActivity.class);
startActivity(intent);
}
}

0 comments on commit dc5f90b

Please sign in to comment.