private void handleDeclineDone() { CrowdGroup g = new CrowdGroup(crowd.getId(), crowd.getName(), crowd.getCreator(), null); vq.setReadState(VMessageQualification.ReadState.READ); vq.setQualState(VMessageQualification.QualificationState.REJECT); // Update message state to database; MessageBuilder.updateQualicationMessage(mContext, vq); updateView(false); }
private void updateView(boolean isInReject) { // view screen changed for rejection if (isInReject) { mBoxLy.setVisibility(View.GONE); mRejectResasonLayout.setVisibility(View.VISIBLE); mSendMsgButton.setVisibility(View.VISIBLE); mSendMsgButton.setText(R.string.crowd_invitation_reject_button_done); mButtonLayout.setVisibility(View.GONE); mTitleName.setText(R.string.crowd_invitation_reject_titile); } else { mTitleName.setText(R.string.crowd_invitation_titile); if (vq.getQualState() == VMessageQualification.QualificationState.ACCEPTED) { mButtonLayout.setVisibility(View.GONE); mNotesLayout.setVisibility(View.VISIBLE); mSendMsgButton.setVisibility(View.VISIBLE); mNotesTV.setText(R.string.crowd_invitation_accept_notes); mAcceptedLy.setVisibility(View.VISIBLE); } else if (vq.getQualState() == VMessageQualification.QualificationState.REJECT) { mButtonLayout.setVisibility(View.GONE); mNotesLayout.setVisibility(View.VISIBLE); mSendMsgButton.setVisibility(View.GONE); mNotesTV.setText(R.string.crowd_invitation_reject_notes); mAcceptedLy.setVisibility(View.GONE); } else { mSendMsgButton.setVisibility(View.GONE); mButtonLayout.setVisibility(View.VISIBLE); mAcceptedLy.setVisibility(View.GONE); } mSendMsgButton.setText(R.string.crowd_invitation_top_bar_right_button); mBoxLy.setVisibility(View.VISIBLE); mRejectResasonLayout.setVisibility(View.GONE); } if (isInRejectReasonMode != isInReject) { if (isInReject) { Animation out = AnimationUtils.loadAnimation(mContext, R.animator.left_in); mRejectResasonLayout.startAnimation(out); Animation in = AnimationUtils.loadAnimation(mContext, R.animator.left_out); mBoxLy.startAnimation(in); } else { Animation out = AnimationUtils.loadAnimation(mContext, R.animator.right_in); mBoxLy.startAnimation(out); Animation in = AnimationUtils.loadAnimation(mContext, R.animator.right_out); mRejectResasonLayout.startAnimation(in); } isInRejectReasonMode = isInReject; } }
@Override public void onClick(View view) { if (isInRejectReasonMode) { updateView(!isInRejectReasonMode); return; } if (isReturnData) { Intent intent = new Intent(CrowdInvitationActivity.this, MessageAuthenticationActivity.class); intent.putExtra("qualificationID", vq.getId()); intent.putExtra("qualState", vq.getQualState()); setResult(4, intent); } onBackPressed(); }
private void handleAcceptDone() { CrowdGroup g = new CrowdGroup(crowd.getId(), crowd.getName(), crowd.getCreator(), null); g.setBrief(crowd.getBrief()); g.setAnnouncement(crowd.getAnnounce()); GlobalHolder.getInstance().addGroupToList(GroupType.CHATING.intValue(), g); Intent i = new Intent(); i.setAction(PublicIntent.BROADCAST_NEW_CROWD_NOTIFICATION); i.addCategory(JNIService.JNI_BROADCAST_CATEGROY); i.putExtra("crowd", crowd.getId()); sendBroadcast(i); vq.setReadState(VMessageQualification.ReadState.READ); vq.setQualState(VMessageQualification.QualificationState.ACCEPTED); MessageBuilder.updateQualicationMessage(mContext, vq); updateView(false); }