Exemplo n.º 1
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.customer_calling_layout);

			bloaded = false;

			ActionBar.NavigationMode = ActionBarNavigationMode.Standard;
			ActionBar.SetTitle(Resource.String.calling_title);
			ActionBar.SetDisplayShowTitleEnabled (false);
			ActionBar.SetDisplayHomeAsUpEnabled(true);
			ActionBar.SetDisplayShowHomeEnabled (true);

			setHeadingTitle (Resource.String.calling_title);

			callingActivity = this;

			llProgress = FindViewById<LinearLayout> (Resource.Id.llProgressBar);
			llProgress.Visibility = ViewStates.Gone;

			tvName = FindViewById<TextView> (Resource.Id.tv_name_spec_calling);
			tvTimeDuration = FindViewById<TextView> (Resource.Id.tv_time_customer_calling);
			tvCostDuration = FindViewById<TextView> (Resource.Id.tv_cost_customer_calling);
			img_upfile = FindViewById<ImageView> (Resource.Id.img_upfile_calling);
			var avatar = FindViewById<ImageView> (Resource.Id.img_avatar_customer_calling);
			llFileAttach = FindViewById<LinearLayout> (Resource.Id.ll_file_attach_customer_calling);

			// Follow up action
			llGrFollowUpAction = FindViewById<LinearLayout> (Resource.Id.llGrFollowUpAction);
			imgRatingFollowUp = FindViewById<ImageView> (Resource.Id.imgRatingFolowUp);
			imgFavoriteFollowUp = FindViewById<ImageView> (Resource.Id.imgFavoriteFolowUp);
			imgEmailFollowUp = FindViewById<ImageView> (Resource.Id.imgEmailFollowUp);
			imgWaiveFeeFollowUp = FindViewById<ImageView> (Resource.Id.imgWaiveFeeFollowUp);
			imgTranscribeFollowUp = FindViewById<ImageView> (Resource.Id.imgTranscribeFollowUp);
			imgUpPhotoFollowUp = FindViewById<ImageView> (Resource.Id.imgUpPhotoFollowUp);
			imgReplayFollowUp = FindViewById<ImageView> (Resource.Id.imgReplayFollowUp);
			llRatingFollowUp = FindViewById<LinearLayout> (Resource.Id.llRatingFollowUp);
			llFavoriteFollowUp = FindViewById<LinearLayout> (Resource.Id.llFavoriteFollowUp);
			llEmailFollowUp = FindViewById<LinearLayout> (Resource.Id.llEmailFollowUp);
			llWaiveFollowUp = FindViewById<LinearLayout> (Resource.Id.llWaiveFeeFollowUp);
			llTransribeFollowUp = FindViewById<LinearLayout> (Resource.Id.llTranscribeFollowUp);
			llUpphotoFollowUp = FindViewById<LinearLayout> (Resource.Id.llUploadPhotoFollowUp);
			llReplayFollowUp = FindViewById<LinearLayout> (Resource.Id.llReplayFollowUp);
			tvWaiveFeeNotice = FindViewById<TextView> (Resource.Id.tv_notice_waived_calling);

			UrlImageViewHelper.UrlImageViewHelper.SetUrlDrawable (avatar, HttpConstants.BASE_URL + constants.durationInfo.AvatarPath, Resource.Drawable.special_home, constants.iTimeLoading, this);

			tvName.Text = constants.durationInfo.UserFullName;

			llGrFollowUpAction.Visibility = ViewStates.Gone;

			uploadPhoto = new UploadPhoto(this);
			uploadPhoto.actionUploadPhotoDelegate = this;

			deleteFile = new Teleconsult.Android.DeleteFile (this);
			deleteFile.deleteFileAction = this;

			// Action
			Background bgUpfile = new Background (this, Resource.Drawable.camera, Resource.Drawable.camera_pressed);
			img_upfile.SetBackgroundDrawable (bgUpfile);
			img_upfile.Click += (sender, e) => {
				if(uploadPhoto == null){
					uploadPhoto = new UploadPhoto(this);
					uploadPhoto.actionUploadPhotoDelegate = this;
				}
				uploadPhoto.selectActionUpload();
			};

			Background bgRating = new Background (this, Resource.Drawable.icon_feedback, Resource.Drawable.icon_feedback_pressed);
			imgRatingFollowUp.SetBackgroundDrawable (bgRating);
			imgRatingFollowUp.Click += (sender, e) => {
				if(isFeeback) {
					if(dialogFeedbackReview == null){
						dialogFeedbackReview = new RatingFeedbackReview(this);
					}
					dialogFeedbackReview.showFeedbackReview(iRatingNumber, sFeedBackContent);
				} else {
					if(dialogFeedback == null){
						dialogFeedback = new RatingFeedbackUI(this, callId);
						dialogFeedback.actionRatingDelegate = this;
					}
					dialogFeedback.showRatingFeedback();
				}
			};

			imgFavoriteFollowUp.Click += (sender, e) => {
				if (isFavorite) {
					if(dialogFavorite == null){
						dialogFavorite = new FavoriteUI(this);
						dialogFavorite.actionFavoriteDelegate = this;
					}
					dialogFavorite.removeFavoriteRequest(specId);
				} else {
					if(dialogFavorite == null){
						dialogFavorite = new FavoriteUI(this);
						dialogFavorite.actionFavoriteDelegate = this;
					}
					dialogFavorite.addToFavouriteRequest(specId);
				}
			};

			Background bgEmail = new Background (this, Resource.Drawable.ic_emailprofile, Resource.Drawable.ic_emailprofile_pressed);
			imgEmailFollowUp.SetBackgroundDrawable (bgEmail);
			imgEmailFollowUp.Click += (sender, e) => {
				SendEmailUI dialog = new SendEmailUI(this);
				dialog.actionDelegate = this;
				dialog.showEmailDialog(specId);
			};

			Background bgWaivefee = new Background (this, Resource.Drawable.ic_waive, Resource.Drawable.ic_waive_pressed);
			imgWaiveFeeFollowUp.SetBackgroundDrawable (bgWaivefee);
			imgWaiveFeeFollowUp.Click += (sender, e) => {
				if(dtEndWaiveFee != null && dtEndWaiveFee.AddMinutes (Constants.pTimeWaiveFee) >= Utils.getDateTimeNow (MApplication.getInstance ().timezoneName)){
					if (popupConfirm == null) {
						popupConfirm = new PopUpConfirm (this);
						popupConfirm.actionConfirmDelegate = this;
					}
					popupConfirm.showConfirmDialog (GetString(Resource.String.waive_fee_title), GetString(Resource.String.waive_fee_content), "Yes", "No");
				} else {
					popupNotice.showNoticeDialog(GetString(Resource.String.waive_fee_expired_title), GetString(Resource.String.waive_fee_expired));
					imgWaiveFeeFollowUp.Enabled = false;
					imgWaiveFeeFollowUp.SetBackgroundResource(Resource.Drawable.ic_waive_disable);
					imgWaiveFeeFollowUp.SetImageResource(Resource.Drawable.ic_waive_disable);
				}
			};

			Background bgTranscribe = new Background (this, Resource.Drawable.ic_transcribe, Resource.Drawable.ic_transcribe_pressed);
			imgTranscribeFollowUp.SetBackgroundDrawable (bgTranscribe);
			imgTranscribeFollowUp.Click += (sender, e) => {
				TranscribeRequest transcribe = new TranscribeRequest(this);
				transcribe.transcribeDelegate = this;
				transcribe.getTranscribe(callId, recordUrl);
			};

			Background bgUpphoto = new Background (this, Resource.Drawable.camera, Resource.Drawable.camera_pressed);
			imgUpPhotoFollowUp.SetBackgroundDrawable (bgUpphoto);
			imgUpPhotoFollowUp.Click += (sender, e) => {
				if(uploadPhoto == null){
					uploadPhoto = new UploadPhoto(this);
					uploadPhoto.actionUploadPhotoDelegate = this;
				}
				uploadPhoto.selectActionUpload();
			};

			Background bgReplay = new Background (this, Resource.Drawable.ic_replay, Resource.Drawable.ic_replay_pressed);
			imgReplayFollowUp.SetBackgroundDrawable (bgReplay);
			imgReplayFollowUp.Click += (sender, e) => {
				if(recordUrl != null){
					if(!recordUrl.Equals("")){
						Intent intent = new Intent(this, typeof(PlayAudioManager));
						intent.PutExtra(constants.pPathAudioFile, recordUrl);
						StartActivity(intent);
					} else {
						popupNotice.showNoticeDialog(GetString(Resource.String.title_notice), GetString(Resource.String.replay_not_exist_notice));
					}
				} else {
					popupNotice.showNoticeDialog(GetString(Resource.String.title_notice), GetString(Resource.String.replay_not_exist_notice));
				}
			};

			popupNotice = new PopupNoticeInfomation (this);
			popupNotice.noticeDelegate = this;

			updateCallStart (constants.durationInfo);
			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPostStopCall, new TCSelector (updateCallStop));
			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPostFolloUp, new TCSelector (onFollowUpAction));
			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPostUploadFileSuccess, new TCSelector (onUploadFileSuccess));
			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPostDeleteFileSuccess, new TCSelector (onDeleteFileSuccess));
		}
Exemplo n.º 2
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			RequestWindowFeature (WindowFeatures.ActionBar);
			SetContentView (Resource.Layout.pastbooking_detail);

			ActionBar.NavigationMode = ActionBarNavigationMode.Standard;
			ActionBar.Title = GetString(Resource.String.consultation_titile) + constants.bookingInfo.ReferenceNo;
			ActionBar.SetDisplayShowTitleEnabled (false);
			ActionBar.SetDisplayHomeAsUpEnabled(true);
			ActionBar.SetDisplayShowHomeEnabled (true);

			setHeadingTitle (GetString(Resource.String.consultation_titile) + constants.bookingInfo.ReferenceNo);

			var tvName = FindViewById<TextView> (Resource.Id.tv_name_past_detail);
			var avatar = FindViewById<ImageView> (Resource.Id.avatar_past_detail);
			numRating = FindViewById<ImageView> (Resource.Id.img_num_rating_pass);
			imgFavorite = FindViewById<ImageView> (Resource.Id.img_add_favorite_pass);
			imgEmailProfile = FindViewById<ImageView> (Resource.Id.img_email_profile_pass);
			imgRating = FindViewById<ImageView> (Resource.Id.img_rating_pass);

			tvExpiredNotice = FindViewById<TextView> (Resource.Id.tv_expired_notice);
			//llSoonest = FindViewById<LinearLayout> (Resource.Id.llSoonestDetail);
			//llStandard = FindViewById<LinearLayout> (Resource.Id.llStandardDetail);
			//llAnother = FindViewById<LinearLayout> (Resource.Id.llAnotherTimeDetail);
			llTalknow = FindViewById<LinearLayout> (Resource.Id.llTalkNowDetail);
			llActionBooking = FindViewById<LinearLayout> (Resource.Id.llActionBooking);

			tvDateStartCall = FindViewById<TextView> (Resource.Id.tv_start_date_past);
			tvTimeStartCall = FindViewById<TextView> (Resource.Id.tv_start_time_past);
			tvDateEndCall = FindViewById<TextView> (Resource.Id.tv_end_date_past);
			tvTimeEndCall = FindViewById<TextView> (Resource.Id.tv_end_time_past);
			tvDuration = FindViewById<TextView> (Resource.Id.tv_total_time_past);
			tvCost = FindViewById<TextView> (Resource.Id.tv_total_cost_past);
			tvFee = FindViewById<TextView> (Resource.Id.tv_total_fee_past);
			llFileAttachment = FindViewById<LinearLayout> (Resource.Id.llFileAtachment);
			llGroupFee = FindViewById<LinearLayout> (Resource.Id.llGroupFeePass);
			tvNoticeWaivedFee = FindViewById<TextView> (Resource.Id.tv_notice_waived_pass);
			tvStandardCost = FindViewById<TextView> (Resource.Id.tvDolarStandard);
			//tvAnotherCost = FindViewById<TextView> (Resource.Id.tvDolarAnotherTime);
			tvTalkNowCost = FindViewById<TextView> (Resource.Id.tvDolarTalkNow);
			llStatusPass = FindViewById<LinearLayout> (Resource.Id.llGroupStatus);
			llDetailPass = FindViewById<LinearLayout> (Resource.Id.llContentPass);
			imgIconStep2 = FindViewById<ImageView> (Resource.Id.imgIconCallingStep2);
			tvDeferInfo = FindViewById<TextView> (Resource.Id.tv_sub_waiting_call_1);
			tvDialStep2 = FindViewById<TextView> (Resource.Id.tvDialStep2);

			pastDetailActivity = this;

			popupNotice = new PopupNoticeInfomation(this);
			popupNotice.noticeDelegate = this;

			deleteFile = new DeleteFile (this);
			deleteFile.deleteFileAction = this;

			uploadPhoto = new UploadPhoto(this);
			uploadPhoto.actionUploadPhotoDelegate = this;

			transcribe = new TranscribeRequest (this);
			transcribe.transcribeDelegate = this;

			tvDeferInfo.Visibility = ViewStates.Gone;
			llStatusPass.Visibility = ViewStates.Gone;
			tvExpiredNotice.Visibility = ViewStates.Gone;

			numRating.SetImageResource(utilsAndroid.getIconRatingResource(0));
			if (MApplication.getInstance ().isConsultant) {
				progressDialogParent.Show ();
				GetBookingInfo getBookingInfo = new GetBookingInfo (this);
				getBookingInfo.actionDelegate = this;
				getBookingInfo.getBookingInfo (constants.bookingInfo.Id);
			} else {
				llActionBooking.Visibility = ViewStates.Gone;
				progressDialogParent.Show ();
				GetSpecialistProfile getSpecInfo = new GetSpecialistProfile (this);
				getSpecInfo.actionDelegate = this;
				getSpecInfo.getSpecProfile (MApplication.getInstance ().specialistID);
			}

			tvNoticeWaivedFee.Visibility = ViewStates.Gone;

			if (constants.bookingInfo.BookingDocuments != null && constants.bookingInfo.BookingDocuments.Count > 0) {
				int isize = constants.bookingInfo.BookingDocuments.Count;
				for (int i = 0; i < isize; i++) {
					bookingDocs.Add(constants.bookingInfo.BookingDocuments[i]);
				}
				utilsAndroid.addFileView (this, bookingDocs, true, addFiles, deleteFile, llFileAttachment);
			}

			if (MApplication.getInstance ().isConsultant) {
				tvName.Text = constants.bookingInfo.CustomerName;
				UrlImageViewHelper.UrlImageViewHelper.SetUrlDrawable(avatar, HttpConstants.BASE_URL + constants.bookingInfo.CustomerAvatar, Resource.Drawable.special_home, constants.iTimeLoading, this);

				imgFavorite.Visibility = ViewStates.Gone;
				imgEmailProfile.Visibility = ViewStates.Gone;
				llSoonest.Visibility = ViewStates.Gone;
				llStandard.Visibility = ViewStates.Gone;
				llAnother.Visibility = ViewStates.Gone;
				llTalknow.Visibility = ViewStates.Gone;
			} else {
				tvName.Text = constants.bookingInfo.SpecialistName;
				UrlImageViewHelper.UrlImageViewHelper.SetUrlDrawable(avatar, HttpConstants.BASE_URL + constants.bookingInfo.SpecialistAvatar, Resource.Drawable.special_home, constants.iTimeLoading, this);

				llGroupFee.Visibility = ViewStates.Gone;
			}

			tvDateStartCall.Text = Utils.getDateTimeNow (MApplication.getInstance ().timezoneName).ToString (constants.sDateFormat);
			tvTimeStartCall.Text = Utils.getDateTimeNow (MApplication.getInstance ().timezoneName).ToString (constants.sTimeFormat, new CultureInfo("en-us")).ToUpper();
			tvDateEndCall.Text = Utils.getDateTimeNow (MApplication.getInstance ().timezoneName).ToString (constants.sDateFormat);
			tvTimeEndCall.Text = Utils.getDateTimeNow (MApplication.getInstance ().timezoneName).ToString (constants.sTimeFormat, new CultureInfo("en-us")).ToUpper();

			setDataPastBookingToView ();

			setActionToView ();

			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPostUploadFileSuccess, new TCSelector (onUploadFileSuccess));
			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPostDeleteFileSuccess, new TCSelector (onDeleteFileSuccess));
		}