Пример #1
0
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   // save controls state
   outState.putString("subject", edSubject.getText().toString());
   outState.putBoolean("alarm", false);
   outState.putLong("dateStart", dateStart.getTimeInMillis());
   outState.putBoolean("allday", chkAllDay.isChecked());
   outState.putInt("repeatType", iRepeatType);
   outState.putInt("repeatEvery", iRepeatEvery);
   outState.putLong("dateEndOn", dateEndOn.getTimeInMillis());
 }
Пример #2
0
 @Override
 public boolean DateValuesChanged(Bundle data) {
   super.DateValuesChanged(data);
   if (GetStartMode() == StartMode.EDIT) {
     if (dateStart.getTimeInMillis() != data.getLong("dateStart")) return true;
   }
   return false;
 }
Пример #3
0
  public void SaveData() {
    // check date if no repeat
    if ((iRepeatType == 0) && (DateBeforeNow(dateStart))) return;

    dataRow.SetSubject(edSubject.getText().toString());
    dataRow.SetStartDate(dateStart);
    dataRow.SetAllDay(false);
    dataRow.SetAlarm(false);

    // set repeat type
    RepeatData rd = dataRow.GetRepeat();
    rd.SetRepeatTypeAsInt(iRepeatType);
    rd.SetEvery(iRepeatEvery);
    rd.SetEndOnDate(dateEndOn.getTimeInMillis());

    if (SaveDataToTable(dataTable)) CloseActivity(dataTable);
  }
Пример #4
0
 private String GetRepeatInfo() {
   String s = utils.GetResStr(R.string.strRepeatTypeNone);
   String sUntil = utils.GetResStr(R.string.strRepeatInfoUntil);
   String sEndDate =
       (dateEndOn.getTimeInMillis() == 0) ? "" : " " + sUntil + " " + utils.GetLongDate(dateEndOn);
   // daily
   if (iRepeatType == 1)
     s = String.format(utils.GetResStr(R.string.strRepeatInfoDaily), iRepeatEvery, sEndDate);
   // weekly
   if (iRepeatType == 2)
     s = String.format(utils.GetResStr(R.string.strRepeatInfoWeekly), iRepeatEvery, sEndDate);
   // monthly
   if (iRepeatType == 3)
     s = String.format(utils.GetResStr(R.string.strRepeatInfoMonthly), iRepeatEvery, sEndDate);
   // monthly
   if (iRepeatType == 4)
     s = String.format(utils.GetResStr(R.string.strRepeatInfoYearly), sEndDate);
   return s;
 }