コード例 #1
0
  private void finishClosing() {
    if (!proposalSelected) {
      DialogInformation.build(this)
          .show(getString(R.string.tienes_que_seleccionar_un_lugar), DialogInformation.ICON_ALERT);
      return;
    }

    Event event = imin.getUser().getCurrentEvent();

    event.setFinalDateTimeProposal(imin.getUser().getSelectedDateTimeProposal());
    event.setFinalLocationProposal(imin.getUser().getSelectedLocationProposal());
    event.setFinalDateTimeProposalId(
        imin.getUser().getSelectedDateTimeProposal().getPublicProposalId());
    event.setFinalLocationProposalId(
        imin.getUser().getSelectedLocationProposal().getPublicProposalId());

    // Ask the user
    DialogProposal dialogProposal =
        DialogProposal.build(
            this,
            new DialogProposal.OnClickListener() {
              @Override
              public void onClick(Event event, boolean result) {
                if (result) {
                  // Yes button clicked
                  eventClose();
                }
              }
            });

    dialogProposal.show(imin.getUser(), imin.getUser().getCurrentEvent());
  }
コード例 #2
0
  @Override
  public void onEventClosed() {
    Event event = imin.getUser().getCurrentEvent();

    // Set closed flag
    event.setClosed(true);
    event.setFinalDateTimeProposal(imin.getUser().getSelectedDateTimeProposal());
    event.setFinalLocationProposal(imin.getUser().getSelectedLocationProposal());

    // Event closed
    dialogCloseProgress.dismiss();

    // Show information dialog
    dialogClosed();
  }