Exemplo n.º 1
0
 /**
  * 保存本地事件
  *
  * @param event 事件
  * @param cid 日历ID
  * @param calendarAccount 日历帐号
  * @return
  * @throws Exception
  */
 public FDEvent saveGo2Events(FDEvent event, FDCalendar cal) throws Exception {
   Map<String, String> params = new HashMap<String, String>();
   params.put("method", "add");
   params.put("title", event.getTitle());
   params.put("description", event.getNote());
   params.put("start", FDTimeFormatUtil.sdfAllDate.format(event.getFromDateByTimeZone()));
   params.put("timezone", event.getTimezone());
   params.put("end", FDTimeFormatUtil.sdfAllDate.format(event.getToDateByTimeZone()));
   params.put("isAllDay", event.isAllDay() ? "1" : "0");
   params.put("location", event.getLocation());
   params.put("cid", event.getCalendarId());
   params.put("recurrence", event.getRecurrence());
   params.put("recurringEventId", event.getRecurringEventId());
   params.put("status", event.getStatus() + "");
   params.put("originalStartTime", event.getOriginalStartTime());
   FDEvent receiveEvent = null;
   FDJson json = sendPOSTRequestByJson("user/privateEvent", params);
   if (json != null) {
     if (json.getStatusCode() != 1) {
       return null;
     }
     receiveEvent = new FDEvent(json.getData(), cal, FDCalendarAccount.TYPE_GO2);
   }
   return receiveEvent;
 }
 /** 初始化地址输入按钮 */
 private void initLocationButton() {
   if (etLocation == null) {
     etLocation = (EditText) findViewById(R.id.etAddEventLocation);
     etLocation.setTypeface(StringUtil.getTypeFaceByRegular(mContext));
     etLocation.setFocusable(false);
     if (event != null) {
       etLocation.setText(event.getLocation());
     }
     etLocation.setOnClickListener(new OpenInputLocationOnClick());
   }
 }