コード例 #1
0
  public static void pause() {
    ReminderSettings settings = getReminderSettings();
    if (settings == null) {
      return;
    }

    if (settings.getReminder() != null) {
      removeAlarm(settings.getReminder().getVocabularyId());
      // settings.getReminder().setTime(null);
    }

    settings.setStatus(ReminderSettings.Status.PAUSE);
    applyReminderSettings(settings);
  }
コード例 #2
0
  public static void stop() {
    setLastReminder(null);
    ReminderSettings settings = getReminderSettings();
    if (settings == null) {
      return;
    }

    if (settings.getReminder() != null) {
      removeAlarm(settings.getReminder().getVocabularyId());
    }

    settings.setStatus(ReminderSettings.Status.STOP);
    settings.setReminder(null);
    applyReminderSettings(settings);

    App.preferences.edit().putInt(SENT_WORDS_PER_DAY, 0).apply();

    Vocabularies.resetLearnedVocabularies();
  }