Ejemplo n.º 1
0
  private void sendLogAndConfirm() {
    if (!sendButtonEnabled) {
      Dialogs.message(this, R.string.log_post_not_possible);
      return;
    }
    if (CalendarUtils.isFuture(date)) {
      Dialogs.message(this, R.string.log_date_future_not_allowed);
      return;
    }
    if (typeSelected.mustConfirmLog()) {
      Dialogs.confirm(
          this,
          R.string.confirm_log_title,
          res.getString(R.string.confirm_log_message, typeSelected.getL10n()),
          new OnClickListener() {

            @Override
            public void onClick(final DialogInterface dialog, final int which) {
              sendLogInternal();
            }
          });
    } else {
      sendLogInternal();
    }
  }
Ejemplo n.º 2
0
 private void setDefaultValues() {
   date = Calendar.getInstance();
   rating = GCVote.NO_RATING;
   typeSelected = cache.getDefaultLogType();
   // it this is an attended event log, use the event date by default instead of the current date
   if (cache.isEventCache()
       && CalendarUtils.isPastEvent(cache)
       && typeSelected == LogType.ATTENDED) {
     date.setTime(cache.getHiddenDate());
   }
   text = null;
   image = Image.NONE;
 }