Exemplo n.º 1
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 ();
		}
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        private void DisplayModal(string message = "")
        {
            myDialog = new Dialog(this, Resource.Style.lightbox_dialog);
            myDialog.SetContentView(Resource.Layout.ModalView);
            ((TextView)myDialog.FindViewById(Resource.Id.txtMessage)).Text = message;
            var editName = myDialog.FindViewById<EditText>(Resource.Id.editName);
            var editSmell = myDialog.FindViewById<EditText>(Resource.Id.editSmell);
            var editColor = myDialog.FindViewById<EditText>(Resource.Id.editColour);
            var btnDone = myDialog.FindViewById<Button>(Resource.Id.btnDone);

            btnDone.Click += delegate
            {
                txtName.Text = editName.Text;
                txtColour.Text = editColor.Text;
                txtSmell.Text = editSmell.Text;
                myDialog.Dismiss();
            };

            RunOnUiThread(myDialog.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();
 }
Exemplo n.º 7
0
 public void Dismiss()
 {
     dialog.Dismiss();
 }
Exemplo n.º 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            SetContentView (Resource.Layout.Menu);
            iniView ();
            Button ajout = FindViewById<Button> (Resource.Id.ajouttournee);

            //TEST
            //editText = FindViewById<EditText>(Resource.Id.passwordfield);

            bodyListView = FindViewById<ListView> (Resource.Id.bodylist);
            bodyItems = new List<TablePosition> ();

            adapter = new ListViewAdapterMenu (this, bodyItems);
            bodyListView.Adapter = adapter;

            initListView ("SELECT * FROM TablePosition");

            ajout.Click += delegate {
                Dialog dialog = new Dialog (this);
                dialog.Window.RequestFeature (WindowFeatures.NoTitle);
                dialog.Window.SetBackgroundDrawableResource (Resource.Drawable.bktransbox);
                dialog.SetContentView (Resource.Layout.Boxajout);
                Button cree = dialog.FindViewById<Button> (Resource.Id.btn_cree);
                EditText codeeditText = dialog.FindViewById<EditText> (Resource.Id.codetournee);
                cree.Click += delegate {
                    ShowProgress (progress => AndHUD.Shared.Show (this, "Création... " + progress + "%", progress, MaskType.Clear));
                    Thread thread = new Thread (() => CreateVoyage (codeeditText.Text));
                    thread.Start ();
                    while (thread.IsAlive) {
                        iniView ();
                    }
                    dialog.Dismiss ();
                };
                cree.LongClick += delegate {
                    DBRepository dbr = new DBRepository ();
                    dbr.DropTableStatut ();
                    initListView("SELECT * FROM TablePosition");
                    iniView ();
                };
                dialog.SetCancelable (true);
                dialog.Show ();
            };

            //SIMULATION D'insert
            Button btntest = FindViewById<Button> (Resource.Id.nomtournee);
            btntest.Click += delegate {
                ShowProgressInsert (progress => AndHUD.Shared.Show (this, "Insertion ... " + progress + "%", progress, MaskType.Clear));
                Thread threadinsert = new Thread (() => GetPosData ("1406026994"));
                threadinsert.Start ();

                //GetPosData (stringbuilder.ToString());

            };
        }
Exemplo n.º 9
0
        public void TwitterPermissions()
        {
            if (!twitterBox.Checked)
                return;

            ISharedPreferences prefs = GetSharedPreferences(Global.PREFS_NAME, 0);
            string AccountName = prefs.GetString ("TwitterName", "");

            Dialog dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.TwitterPopup);
            EditText twitterNameBox = (EditText)dialog.FindViewById(Resource.Id.twitterNameBox);
            twitterNameBox.Text = AccountName;
            dialog.SetTitle("Twitter");
            dialog.SetCancelable(false);

            dialog.FindViewById(Resource.Id.twitterCancel).Click += delegate {
                twitterBox.Checked = false;
                dialog.Dismiss();
            };
            dialog.FindViewById(Resource.Id.twitterConfirm).Click += delegate {
                AccountName = twitterNameBox.Text;
                ISharedPreferencesEditor editor = prefs.Edit ();
                editor.PutString("TwitterName", AccountName);
                editor.Commit();
                dialog.Dismiss();
                Log.Debug ( TAG, AccountName );
            };
            dialog.Show();
        }
Exemplo n.º 10
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();;
        }
Exemplo n.º 11
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();
        }