示例#1
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.Splash);
			new Handler ().PostDelayed (() => {
				//LoadActivity();
				var updateManager = new UpdateManager(this,true);
				if (updateManager.CheckUpdate())
				{
					var builder = new AlertDialog.Builder (this).SetTitle ("软件升级").SetMessage ("发现新版本,建议更新使用新版本").SetOnKeyListener(this).SetCancelable(false);
					builder.SetPositiveButton ("下载", (sender, e) => {
						noticeDialog.Dismiss();	
						//显示下载对话框,下载
						updateManager.ShowDownloadDialog();
					});
					builder.SetNegativeButton ("以后再说", (sender, e) => {
						noticeDialog.Dismiss();	
						LoadActivity();
					});
					noticeDialog= builder.Create ();
					noticeDialog.Show();
				}
				else
				{
					LoadActivity();
				}
			},2000);
		
			// Create your application here
		}
 public void ShowLightboxDialog(string message)
 {
     LightboxDialog = new Dialog (this, Resource.Style.lightbox_dialog);
     LightboxDialog.SetContentView (Resource.Layout.LightboxDialog);
     ((TextView)LightboxDialog.FindViewById (Resource.Id.dialogText)).Text = message;
     LightboxDialog.Show ();
 }
示例#3
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);
			}
		}
示例#4
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);
			}
		}
        private void aboutUs()
        {
            ModalPreviewDialog = new Dialog (this, Resource.Style.lightbox_dialog);
            ModalPreviewDialog.SetContentView (Resource.Layout.ModalAboutUsCompany);
            string [] company = Resources.GetStringArray (Resource.Array.aboutusTrendaAddress);
            string [] spork = Resources.GetStringArray (Resource.Array.aboutusSpork);
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany1)).Text = company [0];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany2)).Text = company [1];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany3)).Text = company [2];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany4)).Text = company [3];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop1)).Text = spork [0];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop2)).Text = spork [1];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop3)).Text = spork [2];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop4)).Text = spork [3];

            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textPublishDate)).Text = wowZapp.LaffOutOut.Singleton.Published;
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textVersion)).Text = wowZapp.LaffOutOut.Singleton.Version;

            ((Button)ModalPreviewDialog.FindViewById (Resource.Id.btnDevs)).Click += delegate {
                DismissModalPreviewDialog ();
                showDevs ();
            };
            ((Button)ModalPreviewDialog.FindViewById (Resource.Id.btnClose)).Click += delegate {
                DismissModalPreviewDialog ();
                scroller.Start ();
                wowZapp.LaffOutOut.Singleton.EnableMessageTimer ();
                wowZapp.LaffOutOut.Singleton.ReceivedMessages += AppDelegate_ReceivedMessages;
            };

            ModalPreviewDialog.Show ();
        }
示例#6
0
        public override bool OnOptionsItemSelected(global::Android.Views.IMenuItem item)
        {
            if (item.ItemId == Resource.Id.server)
            {
                var d = new Dialog(this);
                d.RequestWindowFeature((int)WindowFeatures.NoTitle);
                d.SetContentView(Resource.Layout.ServerEdit);

                var t = d.FindViewById<EditText>(Resource.Id.uri);
                t.Text = baseUri.ToString();

                var b = d.FindViewById<Button>(Resource.Id.okButton);
                b.Click += (s, a) =>
                {
                    d.Dismiss();

                    // attempt to parse uri
                    Uri uri;
                    if (Uri.TryCreate(t.Text, UriKind.Absolute, out uri))
                        baseUri = uri;

                    // recreate tabs
                    CreateTabs();
                };

                d.Show();
            }

            return base.OnOptionsItemSelected(item);
        }
示例#7
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 ();
		}
示例#8
0
        private static void LocalShowDialog(string message, Activity currentActivity)
        {
            CloseDialog(currentActivity);

            var builder = new AlertDialog.Builder(currentActivity);
            builder.SetMessage(message);

            _currentDialog = builder.Create();
            _currentDialog.Show();
        }
示例#9
0
		void TxtVersion_Click (object sender, EventArgs e)
		{
			Dialog dialog = new Dialog(this);
			dialog.SetContentView(Resource.Layout.CustomDialog);
			dialog.SetTitle("Giới thiệu");



			dialog.FindViewById<TextView> (Resource.Id.txt_d1).Text = UrlHelper.About();

			dialog.Show();
		}
        void NewElement_Clicked(object sender, EventArgs e)
        {
            var d = new Dialog(Xamarin.Forms.Forms.Context);
            d.SetTitle((this.Element as ButtonOpenDialog).TitleModal);
            var renderer = RendererFactory.GetRenderer((this.Element as ButtonOpenDialog).ContentModal);
            // TODO : à ajuster
            Android.Widget.LinearLayout.LayoutParams params1 = new Android.Widget.LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            params1.Height = 300;
            d.AddContentView(renderer.ViewGroup, params1);
            d.Show();

            this.UpdateLayout();
        }
        //        protected override void OnCreate(Bundle bundle){
        //            base.OnCreate (bundle);
        //            SetContentView (Resource.Layout.AlertDialog);
        //
        //            Button bt = FindViewById<Button> (Resource.Id.button1);
        //
        //            bt.Click += delegate {
        //                CreateAddProjectDialog ();
        //            };
        //
        //            }
        /*
         *Klasa koja otvara prikaz povijesti placenih parkiranja.
         * */
        public static void CreateListDialog(Context context,List<string> lista)
        {
            Dialog dialog = new Dialog (context);
            dialog.SetContentView (Resource.Layout.DialogList);
            ListView lv = (ListView)dialog.FindViewById (Resource.Id.dialogList);
            //List<string> lista = new List<string> ();
            lv.Adapter = new ArrayAdapter<String> (context, Android.Resource.Layout.TestListItem, lista);
            dialog.Window.SetBackgroundDrawableResource (Android.Resource.Color.BackgroundDark);
            //dialog.Window.SetLayout(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
            //dialog.Window.RequestFeature(WindowFeatures.NoTitle);

            dialog.SetCancelable(true);
            dialog.SetTitle ("Povijest poruka.");
            dialog.Show();
        }
示例#12
0
 //string[] values;
 //Dialog dialog;
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate (bundle);
     //string text = Intent.GetStringArrayListExtra ("MyData") ?? "Data not available";
     SetContentView (Resource.Layout.listview);
     FindViewById<Button> (Resource.Id.btnCreate).Click += delegate {
         Console.WriteLine("check{0}","inside btncreate");
         Dialog dialog = new Dialog(this);
         dialog.SetTitle("form");
     //				dialog.SetContentView(Resource.Layout.build);
         //var alert = new AlertDialog.Builder(Forms.Context);
     //				AlertDialog.Builder dialog= new AlertDialog.Builder(this,Android.App.AlertDialog.ThemeHoloLight);
     //				dialog.SetView (FindViewById<View> (Resource.Layout.build));
         //dialog.Create();
         dialog.Show();
     };
 }
示例#13
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 ();
		}
示例#14
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 ();
		}
示例#15
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 ();
		}
示例#16
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 ();
		}
示例#17
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 ();
		}
		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();
		}
示例#19
0
		public void showDeclineBookingConfirm(){
			var confirmDeclineView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);

			var tvTitle = confirmDeclineView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
			var tvInfo = confirmDeclineView.FindViewById<TextView> (Resource.Id.tv_info_popup);
			var btnConfirm = confirmDeclineView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
			var btnCancel = confirmDeclineView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);

			tvTitle.Text = "Confirm Cancellation";
			btnConfirm.Text = "Yes";
			btnCancel.Text = "No";

			if (MApplication.getInstance().isConsultant) {
				tvInfo.TextFormatted = Html.FromHtml (System.String.Format(_activity.GetString(Resource.String.confirm_decline_info), Utils.getCost(constants.bookingInfo.SpecialistMinCharge)));
				if (constants.bookingInfo.IsApplyNoMinimumCharge) {
					//tvInfo.TextFormatted = Html.FromHtml (System.String.Format (_activity.GetString (Resource.String.confirm_decline_info), Utils.getCost (constants.bookingInfo.CustomerMinCharge)));
					tvInfo.Text = _activity.GetString (Resource.String.confirm_decline_no_fee_expert);
				}
			} else {
				tvInfo.TextFormatted = Html.FromHtml (System.String.Format (_activity.GetString (Resource.String.confirm_decline_fee_info), Utils.getCost (constants.bookingInfo.CustomerMinCharge)));
			}

			btnConfirm.Click += (sender, e) => {
				updateBookingStatusRequest((int)Constants.STATUS.Cancel);
				dialog.Dismiss();
			};

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

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (confirmDeclineView);
			dialog = builder.Create ();
			dialog.Show ();

		}
示例#20
0
        protected void ShowConfirmDialog()
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
            alert.SetTitle(AppResources.ChangeZone);
            alert.SetMessage(AppResources.ChangeZoneConfirmMessage);
            alert.SetPositiveButton(AppResources.Yes, (senderAlert, args) =>
            {
                User entity = sqliteManager.GetUser();
                if (entity != null)
                {
                    entity.ActiveParkingId = activeParkingId;

                    sqliteManager.SaveUser(entity);
                }

                Finish();
            });
            alert.SetNegativeButton(AppResources.No, (senderAlert, args) =>
            {
            });

            Android.App.Dialog dialog = alert.Create();
            dialog.Show();
        }
        private void btnLogout_Click(object s, EventArgs e)
        {
            ModalPreviewDialog = new Dialog(this, Resource.Style.lightbox_dialog);
            ModalPreviewDialog.SetContentView(Resource.Layout.ModalLogoutModal1);

            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnTop)).Click += delegate
            {
                DismissModalPreviewDialog();
                aboutUs();
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnMiddle)).Click += delegate
            {
                DismissModalPreviewDialog();
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnBottom)).Click += delegate
            {
                DismissModalPreviewDialog();
                LogoutStep2();
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnUserProf)).Click += delegate
            {
                DismissModalPreviewDialog();
                Intent i = new Intent(this, typeof(Contacts.AboutMe));
                StartActivity(i);
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnCancel)).Click += delegate
            {
                DismissModalPreviewDialog();
                if (scroller != null)
                    scroller.Start();
                wowZapp.LaffOutOut.Singleton.EnableMessageTimer();
                wowZapp.LaffOutOut.Singleton.ReceivedMessages += AppDelegate_ReceivedMessages;
            };

            ModalPreviewDialog.Show();
        }
示例#22
0
        void ShowProxySettings ()
        {
            dialog = new Dialog (this);
            dialog.SetContentView (Resource.Layout.Proxy);
            dialog.SetTitle ("Proxy Settings"); 
            dialog.SetCancelable (true);

            dialog.CancelEvent += DialogDismissHandler;

            Button btnProxySave = (Button)dialog.FindViewById (Resource.Id.btnProxySave);
            Button btnProxyCancel = (Button)dialog.FindViewById (Resource.Id.btnProxyCancel);

            btnProxySave.Click += EnableProxy; 
            btnProxyCancel.Click += DisableProxy;
            
            proxyUsername = (EditText)dialog.FindViewById (Resource.Id.proxyUsername);
            proxyPassword = (EditText)dialog.FindViewById (Resource.Id.proxyPassword);
            proxyServer = (EditText)dialog.FindViewById (Resource.Id.proxyServer);
            proxyPort = (EditText)dialog.FindViewById (Resource.Id.proxyPort);
            
            tgProxy = (ToggleButton)dialog.FindViewById (Resource.Id.tbProxy);
            tgProxy.CheckedChange += ProxyCheckedChanged;
            tgProxy.Checked = true;

            if (proxy != null) {
                tgProxy.Checked = true;
                tvProxy.Text = SetProxyText(true);
            } else {
                tgProxy.Checked = false;

                tvProxy.Text = SetProxyText(false);
            }

            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyServer))) {
                proxyServer.Text = proxy.ProxyServer;
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyPort.ToString()))) {
                proxyPort.Text = proxy.ProxyPort.ToString();
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyUserName))) {
                proxyUsername.Text = proxy.ProxyUserName;
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyPassword))) {
                proxyPassword.Text = proxy.ProxyPassword;
            }

            dialog.Show();
        }
 private void StrokeJoinDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Join");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner)dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_joins));
    
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var cap = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition).ToString();
             switch (cap)
             {
                 case "round":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Round;
                     break;
                 case "miter":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Miter;
                     break;
                 case "bevel":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Bevel;
                     break;
             }
             dialog.Dismiss();
         };
     dialog.Show();
 }
 private void StrokeStyleDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Style");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner)dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_styles));
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var cap = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition).ToString();
             switch (cap)
             {
                 case "stroke":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.Stroke;
                     break;
                 case "fill":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.Fill;
                     break;
                 case "fill+stroke":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.FillAndStroke;
                     break;
             }
             dialog.Dismiss();
         };
     dialog.Show();
 }
 private void StrokeWidthDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Width");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner) dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_widths));
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var strokeWidth = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition);
             m_SignatureCapture.StrokeWidth = int.Parse(strokeWidth.ToString());
             dialog.Dismiss();
         };
     dialog.Show();
 }
示例#26
0
文件: UpdateGame.cs 项目: i-1213/Game
 /// <summary>
 /// 显示软件下载对话框
 /// </summary>
 private void ShowDownloadDialog()
 {
     // 构造软件下载对话框
     AlertDialog.Builder builder = new AlertDialog.Builder(context);
     builder.SetTitle("正在更新");
     // 给下载对话框增加进度条
     LayoutInflater inflater = LayoutInflater.From(context);
     View v = inflater.Inflate(Resource.Layout.downloadProgress, null);
     mProgress = v.FindViewById<ProgressBar>(Resource.Id.update_progress);
     builder.SetView(v);
     // 取消更新
     builder.SetNegativeButton("取消更新", delegate
     {
         mDownloadDialog.Dismiss();
     });
     mDownloadDialog = builder.Create();
     mDownloadDialog.Show();
 }
示例#27
0
文件: UpdateGame.cs 项目: i-1213/Game
 /// <summary>
 /// 显示提示对话框
 /// </summary>
 private void ShowNoticeDialog()
 {
     // 构造对话框
     AlertDialog.Builder builder = new AlertDialog.Builder(context);
     builder.SetTitle("软件更新");
     builder.SetMessage("检测到新版本,理解更新吗?");
     // 更新
     builder.SetPositiveButton("更新", delegate
     {
         noticeDialog.Dismiss();
         // 显示下载对话框
         ShowDownloadDialog();
     });
     // 稍后更新
     builder.SetNegativeButton("稍后更新", delegate
     {
         noticeDialog.Dismiss();
     });
     noticeDialog = builder.Create();
     noticeDialog.Show();
 }
示例#28
0
文件: AndHUD.cs 项目: skela/AndHUD
		void SetupDialog(Context context, MaskType maskType, Action cancelCallback, Func<Context, Dialog, MaskType, View> customSetup)
		{
			Application.SynchronizationContext.Send(state => {

				CurrentDialog = new Dialog(context);

				CurrentDialog.RequestWindowFeature((int)WindowFeatures.NoTitle);

				if (maskType != MaskType.Black)
					CurrentDialog.Window.ClearFlags(WindowManagerFlags.DimBehind);

				if (maskType == MaskType.None)
					CurrentDialog.Window.SetFlags(WindowManagerFlags.NotTouchModal, WindowManagerFlags.NotTouchModal);

				CurrentDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent));

				var customView = customSetup(context, CurrentDialog, maskType);

				CurrentDialog.SetContentView (customView);

				CurrentDialog.SetCancelable (cancelCallback != null);	
				if (cancelCallback != null)
					CurrentDialog.CancelEvent += (sender, e) => cancelCallback();

				CurrentDialog.Show ();

			}, null);
		}
示例#29
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 ();
		}
        private void showParticipants(object s, EventArgs e, List<UserDB> contacts)
        {
            contactsDialog = new Dialog (this, Resource.Style.lightbox_dialog);
            contactsDialog.SetContentView (Resource.Layout.ModalContactsConversation);
            LinearLayout mainLayout = ((LinearLayout)contactsDialog.FindViewById (Resource.Id.contactMainLayout));
            Context localContext = mainLayout.Context;
            List<Guid> profilePicsToBeGrabbed = new List<Guid> ();
            RunOnUiThread (delegate {
                for (int n = 0; n < contacts.Count; n++) {
                    LinearLayout layout = new LinearLayout (context);
                    layout.Orientation = Android.Widget.Orientation.Horizontal;
                    layout.LayoutParameters = new ViewGroup.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent);
                    layout.SetPadding ((int)ImageHelper.convertDpToPixel (20f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), (int)ImageHelper.convertDpToPixel (10f, context));

                    ImageView profilepic = new ImageView (context);
                    profilepic.LayoutParameters = new ViewGroup.LayoutParams ((int)ImageHelper.convertDpToPixel (60f, context), (int)ImageHelper.convertDpToPixel (60f, context));
                    profilepic.Tag = new Java.Lang.String ("profilepic_" + contacts [n].AccountID);
                    if (contacts [n].HasProfileImage == true && contacts [n].Picture.Length == 0) {
                        profilePicsToBeGrabbed.Add (contacts [n].AccountID);
                    } else {
                        if (contacts [n].Picture.Length > 0)
                            LoadUserImage (contacts [n], profilepic);
                        else
                            profilepic.SetImageDrawable (Application.Context.Resources.GetDrawable (Resource.Drawable.defaultuserimage));
                    }
                    layout.AddView (profilepic);

                    TextView text = new TextView (context);
                    text.LayoutParameters = new ViewGroup.LayoutParams ((int)ImageHelper.convertDpToPixel (235f, context), (int)ImageHelper.convertDpToPixel (40f, context));
                    text.SetPadding ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0);
                    text.Gravity = GravityFlags.CenterVertical;
                    text.TextSize = 16f;
                    text.SetTextColor (Android.Graphics.Color.White);
                    if (contacts [n].FirstName != "" || contacts [n].LastName != "") {
                        text.Text = contacts [n].FirstName + " " + contacts [n].LastName;
                    } else {
                        text.Text = contacts [n].EmailAddress;
                    }
                    layout.AddView (text);

                    mainLayout.AddView (layout);
                }
            });
            ((Button)contactsDialog.FindViewById (Resource.Id.btnCancel)).Click += delegate {
                DismissModalPreviewDialog ();
            };

            if (profilePicsToBeGrabbed.Count > 0) {
                cpUI = 0;
                LOLConnectClient service = new LOLConnectClient (LOLConstants.DefaultHttpBinding, LOLConstants.LOLConnectEndpoint);
                service.UserGetImageDataCompleted += Service_UserGetImageDataCompleted;
                service.UserGetImageDataAsync (AndroidData.CurrentUser.AccountID, profilePicsToBeGrabbed [0], new Guid (AndroidData.ServiceAuthToken));
            }

            contactsDialog.Show ();
        }
        private void doTheAdding(List<User>contacts)
        {
            foreach (User user in contacts) {
                RunOnUiThread (delegate {
                    ModalNewContact = new Dialog (this, Resource.Style.lightbox_dialog);
                    ModalNewContact.SetContentView (Resource.Layout.ModalNewContact);

                    ((Button)ModalNewContact.FindViewById (Resource.Id.btnAccept)).Click += delegate {
                        if (user.Picture.Length > 0) {
                            Contacts.ContactsUtil.contactFilenames.Add (user.AccountID.ToString ());
                            File.WriteAllBytes (System.IO.Path.Combine (wowZapp.LaffOutOut.Singleton.ImageDirectory, user.AccountID.ToString ()), user.Picture);
                        }
                        dbm.InsertOrUpdateUser (user);
                        DismissModalDialog ();
                    };
                    ((Button)ModalNewContact.FindViewById (Resource.Id.btnDecline)).Click += delegate {
                        DismissModalDialog ();
                    };
                    ((TextView)ModalNewContact.FindViewById (Resource.Id.txtContactName)).Text = user.FirstName + " " + user.LastName;
                    ImageView image = ((ImageView)ModalNewContact.FindViewById (Resource.Id.imgContact));
                    if (user.Picture.Length == 0)
                        image.SetBackgroundResource (Resource.Drawable.defaultuserimage);
                    else {
                        Bitmap bm = BitmapFactory.DecodeResource (this.Resources, Resource.Drawable.defaultuserimage);
                        MemoryStream ms = new MemoryStream ();
                        bm.Compress (Bitmap.CompressFormat.Jpeg, 80, ms);
                        byte[] img = ms.ToArray ();
                        displayImage (img, image);
                    }

                    ModalNewContact.Show ();
                });
            }

            DismissModalDialog ();
        }
示例#32
0
        private void SelectItem(int position)
        {
            Android.Support.V4.App.Fragment fragment = null;
            string tag = "";

            switch (position)
            {
            case 0:
                fragment = new HomeFragment();
                tag      = "home";
                break;

            case 1:
                fragment = new InviteContacts();
                tag      = "invite";
                break;

            case 2:
                fragment = new SettingFragment();
                tag      = "setting";

                break;
            //case 4:
            //    fragment = new ChangePasswordFragment();
            //    tag = "setting";

            //    break;
            case 4:
                drawerLayout.CloseDrawers();
                Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                alert.SetInverseBackgroundForced(true);
                alert.SetTitle("Logout");
                alert.SetMessage("Are you sure?");
                alert.SetPositiveButton("YES", (senderAlert, args) =>
                {
                    new LogOutFromWeClip(this).Execute();
                });

                alert.SetNegativeButton("No", (s, e) => { alert.Dispose(); });
                Android.App.Dialog dialog = alert.Create();
                dialog.Show();
                break;

            default:
                fragment = new InviteContacts();
                break;
            }

            if (fragment != null)
            {
                Android.Support.V4.App.Fragment containerFragment = SupportFragmentManager.FindFragmentById(Resource.Id.content_frame);
                if (containerFragment.Class.Name.Equals(fragment.Class.Name))
                {
                    drawerLayout.CloseDrawers();
                    return;
                }

                Android.Support.V4.App.Fragment        itemFragement   = fragment;
                Android.Support.V4.App.FragmentManager fragmentManager = SupportFragmentManager;
                fragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, itemFragement, tag).AddToBackStack("my_fragment").Commit();
                drawerLayout.CloseDrawers();
            }
        }
示例#33
0
        protected override void OnPostExecute(Java.Lang.Object result)
        {
            base.OnPostExecute(result);
            //    progressDialog.Dismiss();
            if (result != null && authentication != null && authentication.access_token != null && authentication.Success == true)
            {
                GlobalClass.AccessToken = authentication.access_token;
                GlobalClass.UserEmail   = authentication.EmailID;
                GlobalClass.UserID      = authentication.UserID.ToString();
                Log.Debug("AccessToken", GlobalClass.AccessToken);
                Log.Debug("AccessTokenExpiresIn", authentication.expires_in.ToString());
                var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                var prefEditor = prefs.Edit();
                prefEditor.PutString("Password", password);
                prefEditor.PutString("LoginUserName", authentication.LoginUserName);
                prefEditor.PutString("EmailID", authentication.EmailID);
                prefEditor.PutString("Access_Token", authentication.access_token);
                prefEditor.PutString("UserID", authentication.UserID.ToString());
                prefEditor.PutString("ProfilePic", authentication.ProfilePic.ToString());
                prefEditor.PutString("UserName", authentication.UserName.ToString());
                prefEditor.PutString("IsNotificationEnable", authentication.IsNotificationEnable == null ? "false" : authentication.IsNotificationEnable.ToString());
                prefEditor.PutBoolean("IsPublic", Convert.ToBoolean(authentication.IsPublic));
                prefEditor.PutString("PhoneNumber", authentication.PhoneNumber);
                prefEditor.PutString("Bio", authentication.Bio);
                prefEditor.PutInt("MaxImageForWeClip", authentication.MaxImageForWeClip);
                prefEditor.PutLong("MaxVideoDuration", authentication.MaxVideoDurationInMinute);
                prefEditor.PutInt("MaxVideoForWeclip", authentication.MaxVideoForWeclip);
                prefEditor.PutLong("MaxVideoSize", authentication.MaxVideoSize);

                prefEditor.PutBoolean("RegisterEmail", false);
                prefEditor.PutBoolean("RegisterPhone", false);

                if (authentication.DOB != null)
                {
                    prefEditor.PutString("DOB", string.Format("{0: dd MMM yyyy}", authentication.DOB));
                }
                else
                {
                    prefEditor.PutString("DOB", "N/A");
                }
                prefEditor.Commit();

                var intent = new Intent(context, typeof(GCMRegistrationService));
                context.StartService(intent);

                context.StartActivity(typeof(MainActivity));
                context.Finish();
            }
            else
            {
                if (result != null && authentication != null && authentication.Success == false)
                {
                    if (authentication.status == "verify_account")
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(context);
                        alert.SetInverseBackgroundForced(true);
                        alert.SetTitle("Verify account");
                        alert.SetMessage(authentication.Message);
                        alert.SetPositiveButton("YES", (senderAlert, args) =>
                        {
                            var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                            var prefEditor = prefs.Edit();
                            prefEditor.PutString("LoginUserName", userName);
                            prefEditor.Commit();
                            context.StartActivity(new Intent(Application.Context, typeof(AddUserName)));
                            context.Finish();
                        });

                        alert.SetNegativeButton("NO", (senderAlert, args) =>
                        {
                            alert.Dispose();
                        });
                        Android.App.Dialog dialog = alert.Create();
                        dialog.Show();
                    }
                    else
                    {
                        AlertBox.Create("Error", authentication.Message, context);
                        var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                        var prefEditor = prefs.Edit();
                        prefEditor.Clear();
                        prefEditor.Commit();
                    }
                }
                else
                {
                    AlertBox.Create("Error", "Error occured", context);
                    var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                    var prefEditor = prefs.Edit();
                    prefEditor.Clear();
                    prefEditor.Commit();
                }
            }
        }