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()); }
@Override public void onEventNotReopened() { // Event not closed dialogCloseProgress.dismiss(); // Show a Toast notifying DialogInformation.build(this) .show(getString(R.string.generic_error), DialogInformation.ICON_ALERT); }
@Override public void onEventNotResponded() { // Hide the progress dialog dialogRespondProgress.dismiss(); // Show a Toast notifying DialogInformation.build(this) .show(getString(R.string.generic_error), DialogInformation.ICON_ALERT); // The event has not been responded setResult(Imin.RESULT_CODE_POLL_LOCATIONS_ERROR); }
@Override public void onEventReopened() { Event event = imin.getUser().getCurrentEvent(); // Set closed flag event.setClosed(false); // Event reopened dialogCloseProgress.dismiss(); // Show a Toast notifying DialogInformation.build(this) .show(getString(R.string.event_reopened), DialogInformation.ICON_INFO); }
private void dialogResponded() { dialogResponded = DialogInformation.build( this, new DialogInformation.OnClickListener() { @Override public void onClick(View view) { // Come back to the previous activity setResult(Imin.RESULT_CODE_POLL_LOCATIONS_OK); finish(); } }); dialogResponded.show(getString(R.string.poll_responded), DialogInformation.ICON_OK); }