예제 #1
0
		public void showConfirmDialog(string title, string content, string possitiveTitle, string negativeTitle){
			var confirmDeferView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);
			var tvTitle = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
			var tvConfirm = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_info_popup);
			var btnConfirmTalknow = confirmDeferView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
			var btnDecline = confirmDeferView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);

			tvTitle.Text = title;
			tvConfirm.Text = content;
			btnDecline.Text = negativeTitle;
			btnConfirmTalknow.Text = possitiveTitle;
			btnConfirmTalknow.Click += (sender, e) => {
				dialog.Dismiss ();
				actionConfirmDelegate.onOkConfirmClick ();
			};

			btnDecline.Click += (sender, e) => {
				dialog.Dismiss ();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (confirmDeferView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			try {
				dialog.Show ();
			} catch(Exception e){
				Console.WriteLine (e.Message);
			}
		}
예제 #2
0
		public void showNoticeDialog(string title, string content){
			var noticeASAPTimeView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);
			var tvTitle = noticeASAPTimeView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
			var tvNotice = noticeASAPTimeView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
			var btnOk = noticeASAPTimeView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);

			tvTitle.Text = title;
			tvNotice.Text = content;
			btnOk.Click += (sender, e) => {
				dialog.Dismiss ();
				if(noticeBeta != null){
					noticeBeta.onOK();
				}
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (noticeASAPTimeView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.SetCancelable (false);
			try {
				dialog.Show ();
			} catch(Exception e){
				Console.WriteLine (e.Message);
			}
		}
예제 #3
0
		public void showEmailDialog(Guid specId){
			var enterEmailView = LayoutInflater.Inflate (Resource.Layout.popup_enter_email, null);

			var edEnterEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_enter_email);
			var edMyEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_my_email);
			var edMessEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_enter_message);
			var btnSend = enterEmailView.FindViewById<Button> (Resource.Id.btnSendEmail);
			var btnCancel = enterEmailView.FindViewById<Button> (Resource.Id.btnCancelSendEmail);

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (enterEmailView);
			dialogEquiry = builder.Create ();
			dialogEquiry.SetCanceledOnTouchOutside(false);

			btnSend.Enabled = false;
			edMyEmail.Text = MApplication.getInstance ().sEmailAddress;
			edEnterEmail.TextChanged += (sender, e) => {
				if(edEnterEmail.Text.Count() > 0) {
					btnSend.Enabled = true;
				} else {
					btnSend.Enabled = false;
				}
			};

			btnSend.Click += (sender, e) => {
				if(edMyEmail.Text.Trim().Count() > 0) {
					if(Utils.checkValidateEmail(edMyEmail.Text.Trim())){
						if (edEnterEmail.Text.Trim().Count() <= 0) {
							btnSend.Enabled = false;
							showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.require_email_profile));
						} else {
							emails.Clear();
							emailsInvalid.Clear();

							Utils.getEmailsProfileFromString(edEnterEmail.Text.ToString(), emails, emailsInvalid);
							if(emailsInvalid.Count > 0) {
								showNoticeEmail(_activity.GetString(Resource.String.invalid_email_title), getEmailInvalidFromList(emailsInvalid));
							} else {
								dialogEquiry.Dismiss();
								actionDelegate.onSending();
								sendEmailProfileRequest(specId, edMyEmail.Text.Trim(), edMessEmail.Text.Trim());
							}
						}
					} else{
						showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.invalid_email_reset));	
					}
				} else {
					showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.email_sender_require));
				}
			};

			btnCancel.Click += (sender, e) => {
				dialogEquiry.Dismiss();
			};

			dialogEquiry.Show ();
		}
 public void SetDialogCloseWays(DialogConfig config, Android.App.Dialog dialog)
 {
     if (!config.IsCanCancel)
     {
         dialog.SetCancelable(false);
         return;
     }
     if (!config.IsCloseByTouchMask)
     {
         dialog.SetCancelable(true);
         dialog.SetCanceledOnTouchOutside(false);
     }
 }
예제 #5
0
		public void showPopupDefer(BookingInfo bookingInfo, DeferInfo deferInfo){
			var confirmDeferView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);
			var tvTitle = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
			var tvConfirm = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_info_popup);
			var btnConfirmDefer = confirmDeferView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
			var btnDecline = confirmDeferView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);

			tvConfirm.Gravity = global::Android.Views.GravityFlags.Left;
			tvTitle.SetText (Android.Resource.String.delayed_title);
			btnConfirmDefer.Text = "Accept";
			btnDecline.Text = "Decline";
			if (deferInfo.IsDefer) {
				string strMinute = ((double)bookingInfo.Deferral).ToString ("C0", new CultureInfo ("en-us")).Substring (1) + " minutes.";
				tvConfirm.TextFormatted = Html.FromHtml (String.Format (_activity.GetString (Resource.String.delay_minute_info), bookingInfo.SpecialistName, strMinute));
			} else {
				int iHours = (int)(bookingInfo.Deferral / 60);
				tvConfirm.TextFormatted = Html.FromHtml (String.Format (_activity.GetString (Resource.String.delay_day_info), bookingInfo.SpecialistName, iHours));
			}

			OnTimerSendCancelDefer (bookingInfo.Id, deferInfo, 0);

			btnConfirmDefer.Click += (sender, e) => {
				dialog.Dismiss();
				sendDeferTalkNow(bookingInfo, deferInfo);
				if(timer != null) {
					timer.Stop();
					timer = null;
				}
			};

			btnDecline.Click += (sender, e) => {
				dialog.Dismiss();
				sendCancelDeferTalkNow(bookingInfo.Id, deferInfo);
				if(timer != null) {
					timer.Stop();
					timer = null;
				}
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (confirmDeferView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside(false);
			dialog.Show ();
		}
예제 #6
0
		public void ShowStatus(int iStatusIndex){
			_iStatusIndex = iStatusIndex;

			var statusView = LayoutInflater.Inflate (Resource.Layout.popup_priority_sort, null);
			var tvTitle = statusView.FindViewById<TextView> (Resource.Id.sort_title);
			tvTitle.Text = _activity.GetString (Resource.String.availability_title);
			ListView statusLV = statusView.FindViewById<ListView>(Resource.Id.lv_priority_sort);
			StatusAdapter statusAdapter;
			statusAdapter = new StatusAdapter (_activity, _activity.Resources.GetStringArray(Resource.Array.status_expert), iStatusIndex);
			statusLV.Adapter = statusAdapter;
			statusLV.ItemClick += OnListItemClick;

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (statusView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside(false);
			dialog.Show ();
		}
예제 #7
0
		public void showPreTimeEnquiry(bool isStandard){
			var bookPreTimeRequestView = LayoutInflater.Inflate (Resource.Layout.popup_request_layout, null);
			var tvTitle = bookPreTimeRequestView.FindViewById<TextView> (Resource.Id.tv_title_request_popup);
			var editDescription = bookPreTimeRequestView.FindViewById<EditText> (Resource.Id.edit_entertext_popup);
			var btnConfirm = bookPreTimeRequestView.FindViewById<Button> (Resource.Id.btn_confirm_entertext_popup);
			var btnCancel = bookPreTimeRequestView.FindViewById<Button> (Resource.Id.btn_cancel_entertext_popup);
			var tvError = bookPreTimeRequestView.FindViewById<TextView> (Resource.Id.tv_enquiry_error);

			this.isStandardHour = isStandard;
			btnConfirm.Enabled = false;

			tvTitle.SetText (Android.Resource.String.titleTalknowRequest);
			btnConfirm.Click += (sender, e) => {
				if (editDescription.Text.Trim().Length <= 0) {
					btnConfirm.Enabled = false;
					tvError.Visibility = ViewStates.Visible;
				} else {
					strEnquiry = editDescription.Text.ToString ();
					dialog.Dismiss();

					Intent intent = new Intent(_activity, typeof(BookPreTimeActivity));
					intent.PutExtra(constants.pIsStandard, isStandardHour);
					intent.PutExtra(constants.pEnquiry, strEnquiry);
					_activity.StartActivity(intent);
				}
			};
			btnCancel.Click += (sender, e) => {
				dialog.Dismiss();
			};
			editDescription.TextChanged += (sender, e) => {
				if(editDescription.Text.Count() <= 0){
					btnConfirm.Enabled = false;
				}else{
					btnConfirm.Enabled = true;
				}
				tvError.Visibility = ViewStates.Gone;
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (bookPreTimeRequestView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.Show ();
		}
예제 #8
0
		private void showNotice(string title, string mess){
			var noticeView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);
			var tvTitle = noticeView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
			var tvNotice = noticeView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
			var btnOk = noticeView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);

			tvTitle.Text = title;
			tvNotice.Text = mess;
			btnOk.Click += (sender, e) => {
				dialog.Dismiss();
				_activity.Finish();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (noticeView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.SetOnCancelListener (new OnCancelDialogListener (_activity));
			dialog.Show ();
		}
예제 #9
0
		public void ShowTalkNowEnquiry(){
			var talknowView = LayoutInflater.Inflate (Resource.Layout.popup_request_layout, null);

			var tvTitle = talknowView.FindViewById<TextView> (Resource.Id.tv_title_request_popup);
			var editDescription = talknowView.FindViewById<EditText> (Resource.Id.edit_entertext_popup);
			var btnOK = talknowView.FindViewById<Button> (Resource.Id.btn_confirm_entertext_popup);
			var btnCancel = talknowView.FindViewById<Button> (Resource.Id.btn_cancel_entertext_popup);
			var tvError = talknowView.FindViewById<TextView> (Resource.Id.tv_enquiry_error);

			btnOK.Enabled = false;
			tvTitle.SetText (Android.Resource.String.titleTalknowRequest);
			btnOK.Click += (sender, e) => {
				if (editDescription.Text.Trim().Length <= 0) {
					btnOK.Enabled = false;
					tvError.Visibility = ViewStates.Visible;
				} else {
					strEnquiry = editDescription.Text.ToString ();
					dialog.Dismiss();
					showTalkNowConfirm();
				}
			};

			btnCancel.Click += (sender, e) => {
				dialog.Dismiss();
			};

			editDescription.TextChanged += (sender, e) => {
				if(editDescription.Text.Count() <= 0) {
					btnOK.Enabled = false;
				}else {
					btnOK.Enabled = true;
				}
				tvError.Visibility = ViewStates.Gone;
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (talknowView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside(false);
			dialog.Show ();
		}
예제 #10
0
		public void ShowProgressDialog (string message)
		{
			if (_dialog != null) {
				HideProgressDialog ();
			}

			_dialog = new Dialog(Forms.Context);
			_dialog.RequestWindowFeature((int)WindowFeatures.NoTitle);
			_dialog.SetCancelable(false);
			_dialog.SetCanceledOnTouchOutside(false);

			Window window = _dialog.Window;
			window.SetLayout(WindowManagerLayoutParams.MatchParent, WindowManagerLayoutParams.MatchParent);
			window.SetBackgroundDrawable(new ColorDrawable(Android.Graphics.Color.Transparent));

			_dialog.SetContentView (Resource.Layout.dialog);

			var textView = (TextView)_dialog.FindViewById(Resource.Id._textView);
			textView.SetTypeface (_typeFaceRegular, TypefaceStyle.Normal);
			textView.Text = message;

			_dialog.Show();
		}
예제 #11
0
		public void selectActionUpload(){
			var optionView = LayoutInflater.Inflate (Resource.Layout.popup_option_select_photo, null);

			var btnFromLibrary = optionView.FindViewById<Button> (Resource.Id.btnLibrary);
			var btnTakePhoto = optionView.FindViewById<Button> (Resource.Id.btnTakePhoto);

			btnFromLibrary.Click += (sender, e) => {
				openChooserFileUpload(false);
				dialog.Dismiss();
			};

//			btnTakePhoto.Click += (sender, e) => {
//				openChooserFileUpload(true);
//				dialog.Dismiss();
//			};

			btnTakePhoto.Click += (sender, e) => {
				TakeAPicture(sender, e);
				dialog.Dismiss();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (optionView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside(false);
			dialog.Show ();
		}
예제 #12
0
		private void showTalkNowConfirm(){
			var confirmTalknowView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);
			var tvTitle = confirmTalknowView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
			var tvConfirm = confirmTalknowView.FindViewById<TextView> (Resource.Id.tv_info_popup);
			var btnConfirmTalknow = confirmTalknowView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
			var btnDecline = confirmTalknowView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);

			tvConfirm.Gravity = GravityFlags.Left;
			tvTitle.SetText (Android.Resource.String.titleTalknowConfirm);
			tvConfirm.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.talknow_confirm), constants.specialistInfo.Account.Name, Utils.getCost((double)constants.specialistInfo.SpecialistDetail.Specializations [0].CustomerPricing.TalkNow), Utils.getCost((double)constants.specialistInfo.SpecialistDetail.Specializations [0].CustomerPricing.Minimum)));
//			if (constants.specialistInfo.SpecialistDetail.Specializations [0].IsApplyNoMinimumCharge) {
//				tvConfirm.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.talknow_confirm), constants.specialistInfo.Account.Name, Utils.getCost((double)constants.specialistInfo.SpecialistDetail.Specializations [0].CustomerPricing.TalkNow), Utils.getCost(MApplication.getInstance().systemConfig.basicFee)));
//			}
			btnConfirmTalknow.Click += (sender, e) => {
				dialog.Dismiss();
				talknowRequest (true, Guid.Empty);
			};

			btnDecline.Click += (sender, e) => {
				dialog.Dismiss();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (confirmTalknowView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.Show ();
		}
예제 #13
0
		private void showPreTimeNotice(){
			var noticePreTimeView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);
			var tvTitle = noticePreTimeView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
			var tvNotice = noticePreTimeView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
			var btnOk = noticePreTimeView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);

			tvNotice.Gravity = GravityFlags.Left;
			tvTitle.SetText(Resource.String.pre_time_notice_end_title);

			if (datetimeStart.Date == datetimeEnd.Date) {
				if (datetimeStart.Date == Utils.getDateTimeNow (MApplication.getInstance ().timezoneName).Date) {
					tvNotice.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.pre_time_notice_end1), datetimeStart.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper(), datetimeEnd.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper()));
				} else {
					tvNotice.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.pre_time_notice_end3), datetimeStart.ToString (constants.sDateFormat), datetimeStart.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper(), datetimeEnd.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper()));
				}
			} else {
				if (datetimeStart.Date == Utils.getDateTimeNow (MApplication.getInstance ().timezoneName).Date) {
					tvNotice.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.pre_time_notice_end2), datetimeStart.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper(), datetimeEnd.ToString (constants.sDateFormat) + " " + datetimeEnd.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper()));
				} else {
					tvNotice.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.pre_time_notice_end4), datetimeStart.ToString (constants.sDateFormat) + " " + datetimeStart.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper(), datetimeEnd.ToString (constants.sDateFormat) + " " + datetimeEnd.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper()));
				}
			}

			btnOk.Click += (sender, e) => {
				_activity.Finish ();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (noticePreTimeView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			try {
				dialog.Show ();
			} catch(Exception e){
				Console.WriteLine (e.Message);
			}
		}
예제 #14
0
		public void showSelectPreTime(bool isStartTime, DateTime dateTime){
			this.isStartDatepicker = isStartTime;
			if (dialogSelectTime == null) {
				var customDatetimeView = LayoutInflater.Inflate (Resource.Layout.popup_date_time_picker, null);
				datepicker = customDatetimeView.FindViewById<DatePicker> (Resource.Id.datepicker_popup);
				timepicker = customDatetimeView.FindViewById<TimePicker> (Resource.Id.timepicker_popup);
				var btnSet = customDatetimeView.FindViewById<Button> (Resource.Id.btn_set_datetime);

				btnSet.Click += (sender, e) => {
					if (isStartDatepicker) {
						datetimeStart = new DateTime (datepicker.DateTime.Year, datepicker.DateTime.Month, datepicker.DateTime.Day, (int)timepicker.CurrentHour, (int)timepicker.CurrentMinute, 0, DateTimeKind.Utc);
						actionDelegate.onSelectTime (datetimeStart);
					} else {
						datetimeEnd = new DateTime (datepicker.DateTime.Year, datepicker.DateTime.Month, datepicker.DateTime.Day, (int)timepicker.CurrentHour, (int)timepicker.CurrentMinute, 0, DateTimeKind.Utc);
						actionDelegate.onSelectTime (datetimeEnd);
					}
					dialogSelectTime.Hide();
				};

				builderSelectTime = new AlertDialog.Builder (_activity);
				builderSelectTime.SetView (customDatetimeView);
				dialogSelectTime = builderSelectTime.Create ();
				dialogSelectTime.SetCanceledOnTouchOutside (false);
			}

			// Set new date & time from User_Info API
			datepicker.UpdateDate (dateTime.Year, dateTime.Month - 1, dateTime.Day);

			datepicker.MinDate = utilsAndroid.getMinDateMilliSeconds ();

			timepicker.CurrentHour = (Java.Lang.Integer)dateTime.Hour;
			timepicker.CurrentMinute = (Java.Lang.Integer)dateTime.Minute;
			dialogSelectTime.Show ();
		}
예제 #15
0
		private void showNoticeActivation(string title, string content, bool isSuccess){
			var noticeActivationView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);
			var tvTitle = noticeActivationView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
			var tvNotice = noticeActivationView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
			var btnOk = noticeActivationView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);

			btnOk.Click += (sender, e) => {
				dialog.Dismiss ();
				if(isSuccess)
					Finish();
			};

			tvTitle.Text = title;
			tvNotice.Text = content;

			builder = new AlertDialog.Builder (this);
			builder.SetView (noticeActivationView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.SetCancelable (false);
			dialog.Show ();

		}
예제 #16
0
		public void showRatingFeedback(){
			var ratingFeebackView = LayoutInflater.Inflate (Resource.Layout.popup_rating_feedback, null);

			edFeeback = ratingFeebackView.FindViewById<EditText> (Resource.Id.edit_feedback);

			var btnSend = ratingFeebackView.FindViewById<Button> (Resource.Id.btnSendFeedback);
			var btnCancel = ratingFeebackView.FindViewById<Button> (Resource.Id.btnCancelFeeback);
			var tvError = ratingFeebackView.FindViewById<TextView> (Resource.Id.tv_error_feedback);
			var imgStar1 = ratingFeebackView.FindViewById<ImageView> (Resource.Id.imgStar1);
			var imgStar2 = ratingFeebackView.FindViewById<ImageView> (Resource.Id.imgStar2);
			var imgStar3 = ratingFeebackView.FindViewById<ImageView> (Resource.Id.imgStar3);
			var imgStar4 = ratingFeebackView.FindViewById<ImageView> (Resource.Id.imgStar4);

			tvError.SetText (Resource.String.feeback_error);
			iNumStar = 0;

			imgStar1.Click += (sender, e) => {
				tvError.Visibility = ViewStates.Gone;
				iNumStar = 1;
				imgStar1.SetImageResource(Resource.Drawable.ic_star);
				imgStar2.SetImageResource(Resource.Drawable.ic_star_disable);
				imgStar3.SetImageResource(Resource.Drawable.ic_star_disable);
				imgStar4.SetImageResource(Resource.Drawable.ic_star_disable);
			};

			imgStar2.Click += (sender, e) => {
				tvError.Visibility = ViewStates.Gone;
				iNumStar = 2;
				imgStar1.SetImageResource(Resource.Drawable.ic_star);
				imgStar2.SetImageResource(Resource.Drawable.ic_star);
				imgStar3.SetImageResource(Resource.Drawable.ic_star_disable);
				imgStar4.SetImageResource(Resource.Drawable.ic_star_disable);
			};

			imgStar3.Click += (sender, e) => {
				tvError.Visibility = ViewStates.Gone;
				iNumStar = 3;
				imgStar1.SetImageResource(Resource.Drawable.ic_star);
				imgStar2.SetImageResource(Resource.Drawable.ic_star);
				imgStar3.SetImageResource(Resource.Drawable.ic_star);
				imgStar4.SetImageResource(Resource.Drawable.ic_star_disable);
			};

			imgStar4.Click += (sender, e) => {
				tvError.Visibility = ViewStates.Gone;
				iNumStar = 4;
				imgStar1.SetImageResource(Resource.Drawable.ic_star);
				imgStar2.SetImageResource(Resource.Drawable.ic_star);
				imgStar3.SetImageResource(Resource.Drawable.ic_star);
				imgStar4.SetImageResource(Resource.Drawable.ic_star);
			};

			btnSend.Click += (sender, e) => {
				if(iNumStar == 0) {
					tvError.Visibility = ViewStates.Visible;
				} else {
					dialog.Dismiss();
					actionRatingDelegate.onSendingRating();
					sendFeedback();
				}
			};

			btnCancel.Click += (sender, e) => {
				dialog.Dismiss();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (ratingFeebackView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.Show ();
		}
예제 #17
0
		private void showNoticeEmail(string title, string content){
			var emailInvalidlView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (emailInvalidlView);

			var tvTitle = emailInvalidlView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
			var tvInfo = emailInvalidlView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
			var btnOk = emailInvalidlView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);

			tvTitle.Text = title;
			tvInfo.Text = content;

			btnOk.Click += (sender, e) => {
				dialogNotice.Dismiss();
			};

			dialogNotice = builder.Create ();
			dialogNotice.SetCanceledOnTouchOutside(false);

			try {
				dialogNotice.Show ();
			} catch(Exception e){
				Console.WriteLine (e.Message);
			}
		}
예제 #18
0
		public void showPreTimeConfirm(string strEnquiry, DateTime dtStart, DateTime dtEnd){
			var confirmPreTimeView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);
			var tvTitle = confirmPreTimeView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
			var tvConfirm = confirmPreTimeView.FindViewById<TextView> (Resource.Id.tv_info_popup);
			var btnConfirm = confirmPreTimeView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
			var btnDecline = confirmPreTimeView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);

			tvConfirm.Gravity = GravityFlags.Left;
			this.datetimeStart = dtStart;
			this.datetimeEnd = dtEnd;
			this.strEnquiry = strEnquiry;

			if (isStandardHour) {
				tvTitle.SetText (Android.Resource.String.pre_time_confirm_standard_title);
				costPerMinute = (double)constants.specialistInfo.SpecialistDetail.Specializations [0].CustomerPricing.Standard;
				ratePerMinute = (double)constants.specialistInfo.SpecialistDetail.Specializations [0].StandardRate;
			} else {
				tvTitle.SetText (Android.Resource.String.pre_time_confirm_outof_title);
				costPerMinute = (double)constants.specialistInfo.SpecialistDetail.Specializations [0].CustomerPricing.OutOfHour;
				ratePerMinute = (double)constants.specialistInfo.SpecialistDetail.Specializations [0].OutOfHourRate;
			}
			string sEndtime;
			sEndtime = datetimeEnd.ToString (constants.sDateFormat) + " " + datetimeEnd.ToString (constants.sTimeFormat, new CultureInfo("en-us")).ToUpper ();
			tvConfirm.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.pre_time_confirm),
				datetimeStart.ToString (constants.sDateFormat) + " " + datetimeStart.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper(),
				sEndtime, constants.specialistInfo.Account.Name, Utils.getCost(costPerMinute),
				Utils.getCost((double)constants.specialistInfo.SpecialistDetail.Specializations [0].CustomerPricing.Minimum)));
//			if (constants.specialistInfo.SpecialistDetail.Specializations [0].IsApplyNoMinimumCharge) {
//				tvConfirm.TextFormatted = Html.FromHtml(String.Format (_activity.GetString(Resource.String.pre_time_confirm),
//					datetimeStart.ToString (constants.sDateFormat) + " " + datetimeStart.ToString(constants.sTimeFormat, new CultureInfo("en-us")).ToUpper(),
//					sEndtime, constants.specialistInfo.Account.Name, Utils.getCost(costPerMinute),
//					Utils.getCost(MApplication.getInstance().systemConfig.basicFee)));
//			}

			btnConfirm.Click += (sender, e) => {
				actionDelegate.onSending();
				if(isStandardHour)
					bookTimeRequest ((int)Constants.TALKNOWTYPE.STANDARD);
				else
					bookTimeRequest ((int)Constants.TALKNOWTYPE.OUTOFF);
				dialog.Dismiss();
			};

			btnDecline.Click += (sender, e) => {
				dialog.Dismiss();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (confirmPreTimeView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.Show ();
		}
예제 #19
0
        void DatePicker_Dialog(object sender, EventArgs e)
        {
            dialog = new Dialog (this);
            dialog.RequestWindowFeature(1);
            dialog.SetContentView (Resource.Layout.datedialog);
            dialog.Window.SetBackgroundDrawableResource (Resource.Drawable.empty);
            dialog.Window.SetFeatureInt (WindowFeatures.NoTitle,0);
            dialog.Window.ClearFlags (WindowManagerFlags.DimBehind);
            dialog.SetCancelable (true);
            dialog.SetCanceledOnTouchOutside (true);

            // day
            var dayInput = dialog.FindViewById (Resource.Id.dayInput) as EditText;
            var dayUp = dialog.FindViewById (Resource.Id.dayUp) as Button;
            var dayDown = dialog.FindViewById (Resource.Id.dayDown) as Button;
            dayUp.Tag = Resource.Id.dayInput;
            dayDown.Tag = Resource.Id.dayInput;
            dayUp.Click += Change_Date;
            dayDown.Click += Change_Date;

            // day
            var monthInput = dialog.FindViewById (Resource.Id.monthInput) as EditText;
            var monthUp = dialog.FindViewById (Resource.Id.monthUp) as Button;
            var monthDown = dialog.FindViewById (Resource.Id.monthDown) as Button;
            monthUp.Tag = Resource.Id.monthInput;
            monthDown.Tag = Resource.Id.monthInput;
            monthUp.Click += Change_Date;
            monthDown.Click += Change_Date;

            // year
            var yearInput = dialog.FindViewById (Resource.Id.yearInput) as TextView;
            var yearUp = dialog.FindViewById (Resource.Id.yearUp) as Button;
            var yearDown = dialog.FindViewById (Resource.Id.yearDown) as Button;
            yearUp.Tag = Resource.Id.yearInput;
            yearDown.Tag = Resource.Id.yearInput;
            yearUp.Click += Change_Date;
            yearDown.Click += Change_Date;

            var date = dateLabel.Text.Split ('/');

            RunOnUiThread (() => {
                dayInput.Text = date [0];
                monthInput.Text = date [1];
                yearInput.Text = String.Format ("20{0}", date [2]);
            });

            var btnOk = (Button)dialog.FindViewById(Resource.Id.button2);
            btnOk.Click += delegate {
                RunOnUiThread (() => dateLabel.Text =
                               String.Format ("{0}/{1}/{2}", dayInput.Text, monthInput.Text, yearInput.Text.Substring (2)));
                dialog.Dismiss ();
            };

            var btnCancel = (Button)dialog.FindViewById(Resource.Id.button1);
            btnCancel.Click += delegate {
                dialog.Cancel ();
            };
            dialog.Show();
        }
예제 #20
0
        void TimePicker_Dialog(object sender, EventArgs e)
        {
            dialog = new Dialog (this);
            dialog.RequestWindowFeature(1);
            dialog.SetContentView (Resource.Layout.timedialog);
            dialog.Window.SetBackgroundDrawableResource (Resource.Drawable.empty);
            dialog.Window.SetFeatureInt (WindowFeatures.NoTitle,0);
            dialog.Window.ClearFlags (WindowManagerFlags.DimBehind);
            dialog.SetCancelable (true);
            dialog.SetCanceledOnTouchOutside (true);

            // hour
            var hourInput = dialog.FindViewById (Resource.Id.hourInput) as EditText;
            var hourUp = dialog.FindViewById (Resource.Id.hourUp) as Button;
            var hourDown = dialog.FindViewById (Resource.Id.hourDown) as Button;
            hourUp.Tag = Resource.Id.hourInput;
            hourDown.Tag = Resource.Id.hourInput;
            hourUp.Click += Change_Time;
            hourDown.Click += Change_Time;

            // minute
            var minuteInput = dialog.FindViewById (Resource.Id.minuteInput) as EditText;
            var minuteUp = dialog.FindViewById (Resource.Id.minuteUp) as Button;
            var minuteDown = dialog.FindViewById (Resource.Id.minuteDown) as Button;
            minuteUp.Tag = Resource.Id.minuteInput;
            minuteDown.Tag = Resource.Id.minuteInput;
            minuteUp.Click += Change_Time;
            minuteDown.Click += Change_Time;

            var time = timeLabel.Text.Split(':');

            RunOnUiThread (() => {
                hourInput.Text = time [0];
                minuteInput.Text = time [1];
            });

            var btnOk = (Button)dialog.FindViewById(Resource.Id.button2);
            btnOk.Click += delegate {
                RunOnUiThread (() => timeLabel.Text =
                               String.Format ("{0}:{1}", hourInput.Text, minuteInput.Text));
                dialog.Dismiss ();
            };

            var btnCancel = (Button)dialog.FindViewById(Resource.Id.button1);
            btnCancel.Click += delegate {
                dialog.Cancel ();
            };
            dialog.Show();;
        }