コード例 #1
0
ファイル: Muazzin.java プロジェクト: ozbek/al-muazzin
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   short time = Schedule.today(this).nextTimeIndex();
   switch (item.getItemId()) {
     case R.id.menu_location_calculation:
       new CalculationSettingsDialog(this).show();
       break;
     case R.id.menu_previous:
       time--;
       if (time < CONSTANT.FAJR) {
         time = CONSTANT.ISHAA;
       }
       if (CONSTANT.SUNRISE == time && mPreferences.dontNotifySunrise()) {
         time = CONSTANT.FAJR;
       }
       NotificationService.notify(
           this, time, Schedule.today(this).getTimes()[time].getTimeInMillis());
       break;
     case R.id.menu_next:
       if (CONSTANT.SUNRISE == time && mPreferences.dontNotifySunrise()) {
         time = CONSTANT.DHUHR;
       }
       NotificationService.notify(
           this, time, Schedule.today(this).getTimes()[time].getTimeInMillis());
       break;
     case R.id.menu_stop:
       NotificationService.cancelAll(this);
       break;
     case R.id.menu_settings:
       startActivity(new Intent(this, SettingsActivity.class));
       break;
   }
   return super.onOptionsItemSelected(item);
 }