Ejemplo n.º 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);
			}
		}
Ejemplo n.º 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);
			}
		}
Ejemplo n.º 3
0
 public override Dialog OnCreateDialog(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     // Begin building a new dialog.
     var builder = new AlertDialog.Builder(Activity);
     //Get the layout inflater
     var inflater = Activity.LayoutInflater;
     populate (listData);
     viewdlg = SetViewDelegate;
     var view = inflater.Inflate(Resource.Layout.ListCustView, null);
     listView = view.FindViewById<ListView> (Resource.Id.CustList);
     if (listView != null) {
         adapter = new GenericListAdapter<Trader> (this.Activity, listData,Resource.Layout.ListCustDtlView, viewdlg);
         listView.Adapter = adapter;
         listView.ItemClick += ListView_Click;
         txtSearch= view.FindViewById<EditText > (Resource.Id.txtSearch);
         butSearch= view.FindViewById<Button> (Resource.Id.butCustBack);
         butSearch.Text = "SEARCH";
         butSearch.SetCompoundDrawables (null, null, null, null);
         butSearch.Click+= ButSearch_Click;
         //txtSearch.TextChanged += TxtSearch_TextChanged;
         builder.SetView (view);
         builder.SetPositiveButton ("CANCEL", HandlePositiveButtonClick);
     }
     var dialog = builder.Create();
     //Now return the constructed dialog to the calling activity
     return dialog;
 }
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Build Password Dialog
            var builder = new AlertDialog.Builder(Activity);

            // Get Layout Inflater
            var inflator = Activity.LayoutInflater;

            // Inflate Layout For Password Dialog
            var dialogView = inflator.Inflate(Resource.Layout.AddReminderDialogFragment, null);

            // Initialize Properties
            ReminderEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextReminder);

            // Set Positive & Negative Buttons
            builder.SetView(dialogView);
            builder.SetPositiveButton("Add Reminder", HandlePositiveButtonClick);
            builder.SetNegativeButton("Cancel", HandleNegativeButtonClick);

            // Build And Return Dialog
            var dialog = builder.Create();
            return dialog;
        }
Ejemplo n.º 5
0
        public void AskForString(string message, string title, System.Action<string> returnString)
        {
            var activity = Mvx.Resolve<IMvxAndroidCurrentTopActivity> ().Activity;
            var builder = new AlertDialog.Builder(activity);
            builder.SetIcon(Resource.Drawable.ic_launcher);
            builder.SetTitle(title ?? string.Empty);
            builder.SetMessage(message);
            var view = View.Inflate(activity, Resource.Layout.dialog_add_member, null);
            builder.SetView(view);

            var textBoxName = view.FindViewById<EditText>(Resource.Id.name);

            builder.SetCancelable(true);
            builder.SetNegativeButton(Resource.String.cancel, delegate { });//do nothign on cancel

            builder.SetPositiveButton(Resource.String.ok, delegate
                {

                    if (string.IsNullOrWhiteSpace(textBoxName.Text))
                        return;

                returnString(textBoxName.Text.Trim());
                });

            var alertDialog = builder.Create();
            alertDialog.Show();
        }
Ejemplo n.º 6
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            var builder = new AlertDialog.Builder (Activity);
            var inflater = Activity.LayoutInflater;
            var view = inflater.Inflate (Resource.Layout.NewTournamentDialogLayout, null);

            if (view != null) {
                txtUrl = view.FindViewById<EditText> (Resource.Id.txtNewTournamentURL_Edit);
                txtSignup = view.FindViewById<EditText> (Resource.Id.txtNewTournamentSignup_Edit);
                txtSignup_Text = view.FindViewById<TextView> (Resource.Id.txtNewTournamentSignup);
                btnView = view.FindViewById<Button> (Resource.Id.btnNewTournament_View);

                txtUrl.Text = json ["tournament"] ["full_challonge_url"];

                if (json ["tournament"] ["sign_up_url"] == null) {
                    txtSignup.Visibility = ViewStates.Gone;
                    txtSignup_Text.Visibility = ViewStates.Gone;
                } else
                    txtSignup.Text = json ["tournament"] ["sign_up_url"];

                btnView.Click += BtnView_Click;

                builder.SetTitle (json ["tournament"] ["name"].ToString ());

                builder.SetView (view);
            }

            var dialog = builder.Create ();
            return dialog;
        }
Ejemplo n.º 7
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.actionNew:
                    string default_game_name = "Game";
                    AlertDialog.Builder alert1 = new AlertDialog.Builder(this.Activity);
                    EditText input = new EditText(this.Activity);
                    input.Text = default_game_name;
                    alert1.SetTitle("Game Name");
                    alert1.SetView(input);
                    alert1.SetPositiveButton("OK", delegate { AddGame(input.Text); });
                    alert1.SetNegativeButton("Cancel", (s, e) => { });
                    alert1.Show();
                    _adapter.NotifyDataSetChanged();
                    return true;

                case Resource.Id.actionRefresh:
                    GameData.Service.RefreshCache();
                    _adapter.NotifyDataSetChanged();
                    return true;

                default:
                    return base.OnOptionsItemSelected(item);
            }
        }
Ejemplo n.º 8
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);
            button = FindViewById<Button> (Resource.Id.button);

            button.Click += (o, e) =>  {
                // use an array adapter to populate a spinner item from our string array
                ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                    Android.Resource.Layout.SimpleSpinnerItem, villains);

                // create the spinner and populate it with our items
                Spinner spinner = new Spinner(this);
                spinner.LayoutParameters = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                spinner.Adapter = adapter;

                // handle item selection
                spinner.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs> (ItemSelected);

                // build the alert dialog
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.SetView(spinner);
                builder.SetNeutralButton("OK", delegate {});
                builder.Show();
            };
        }
Ejemplo n.º 9
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {

            AlertDialog.Builder dialog = new AlertDialog.Builder(Activity)
                .SetTitle(title)
                .SetPositiveButton("Got it", (sender, args) => { });

            LayoutInflater inflater = Activity.LayoutInflater;
            View view = inflater.Inflate(Resource.Layout.VideoHelpPopup, null);

            video = view.FindViewById<VideoView>(Resource.Id.helper_video);
            descriptionView = view.FindViewById<TextView>(Resource.Id.helper_explanation);
            descriptionView.SetText(description.ToCharArray(),0, description.Length);

            if (!string.IsNullOrEmpty(videoAdd))
            {
                video.Prepared += VideoPrepared;
                video.SetVideoURI(Uri.Parse(videoAdd));
                video.Touch += VideoTouched; 
                video.SetZOrderOnTop(true); // Removes dimming
            }
            else
            {
                LinearLayout holder = view.FindViewById<LinearLayout>(Resource.Id.helper_videoHolder);
                holder.Visibility = ViewStates.Gone;
            }

            dialog.SetView(view);

            return dialog.Create();
        }
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Build Set Meals Dialog
            var builder = new AlertDialog.Builder(Activity);

            // Get Layout Inflater
            var inflator = Activity.LayoutInflater;

            // Inflate Layout For Password Dialog
            var dialogView = inflator.Inflate(Resource.Layout.SetMealsDialogFragment, null);

            // Initialize Properties
            breakfastEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextBreakfast);
            lunchEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextLunch);
            dinnerEditText = dialogView.FindViewById<EditText>(Resource.Id.editTextDinner);

            // Set Text To Current Meal Values
            breakfastEditText.Text = MealItem.Breakfast;
            lunchEditText.Text = MealItem.Lunch;
            dinnerEditText.Text = MealItem.Dinner;

            // Set Positive & Negative Buttons
            builder.SetView(dialogView);
            builder.SetPositiveButton("Set Meals", HandlePositiveButtonClick);
            // builder.SetNeutralButton("Clear Meals", HandleNeutralButtonClick);
            builder.SetNegativeButton("Cancel", HandleNegativeButtonClick);

            // Build And Return Dialog
            var dialog = builder.Create();
            return dialog;
        }
Ejemplo n.º 11
0
		public void Display (string body, string title, GoalsAvailable availableGoal, string cancelButtonTitle, string acceptButtonTitle = "", Action<GoalsAvailable, int> action = null)
		{
			EditText goalTextBox = new EditText (Forms.Context);
			AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder (Forms.Context);
			alertDialogBuilder.SetTitle (title);
			alertDialogBuilder.SetMessage (body);
			alertDialogBuilder.SetView (goalTextBox);

			goalTextBox.InputType = Android.Text.InputTypes.NumberFlagSigned;

			var inputFilter = new Android.Text.InputFilterLengthFilter (7);
			var filters = new Android.Text.IInputFilter[1];

			filters [0] = inputFilter;

			goalTextBox.SetFilters (filters);
			goalTextBox.InputType = Android.Text.InputTypes.ClassNumber;

			alertDialogBuilder.SetPositiveButton ("OK", (senderAlert, args) => {
				if(action != null)
				{
					int goalValue;
					int.TryParse(goalTextBox.Text, out goalValue);
					action.Invoke(availableGoal, goalValue);
				}

			} );
			alertDialogBuilder.SetNeutralButton ("CANCEL", (senderAlert, args) => {

			} );

			alertDialogBuilder.Show ();

		}
Ejemplo n.º 12
0
        public override Dialog OnCreateDialog(Bundle bundle)
        {
            base.OnCreateDialog (bundle);

            catalogs = new CheckinShared.CatalogDB ();
            LayoutInflater inflater = Activity.LayoutInflater;
            View view = inflater.Inflate (Resource.Layout.AddCatalog, null);

            EditText textName = view.FindViewById<EditText> (Resource.Id.txtAgregarCatalogo);

            AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
            builder.SetTitle ("Crear catálogo");
            builder.SetView (view);
            builder.SetPositiveButton ("Crear", delegate (object sender, DialogClickEventArgs e) {
                Catalog catalog = new Catalog ();

                if (textName.Text.Length != 0)
                {
                    catalog.Name = textName.Text;
                    catalog.Quantity = 0;
                    catalog.UserId = AppHelper.GetCurrentUser(Activity).Id;
                    catalogs.Insert(catalog);

                    catalog.SaveToParse();

                    Console.WriteLine("ParentFragment: " + ParentFragment);

                    ((CatalogsFragment) ((MainActivity) Activity).CurrentFragment()).AddCatalog(catalog);
                }
            });
            builder.SetNegativeButton ("Salir", delegate (object sender, DialogClickEventArgs e) { });

            return builder.Create ();
        }
Ejemplo n.º 13
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 ();
		}
Ejemplo n.º 14
0
        //public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        //{
        //    _view = inflater.Inflate(Resource.Layout.SyncManualConnect, container, false);
        //    return _view;
        //}

        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(Activity, Resource.Style.DialogTheme));
            LayoutInflater inflater = Activity.LayoutInflater;
            builder.SetView(inflater.Inflate(Resource.Layout.SyncManualConnect, null));
            builder.SetTitle("Connect manually to device");
            builder.SetPositiveButton("Connect", PositiveButtonHandler);
            builder.SetNegativeButton("Cancel", NegativeButtonHandler);                          
            return builder.Create();            
        }
Ejemplo n.º 15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.MainPage);
            AppGlobalData.context = this.ApplicationContext;
            DialogService.ShowLoading("Downloading Emojis");

            GridView gridView = FindViewById<GridView>(Resource.Id.grid);
            Button button = FindViewById<Button>(Resource.Id.emojiButton);
            GridAdapter adapter = new GridAdapter(this);
            gridView.SetAdapter(adapter);
            gridView.StretchMode = StretchMode.StretchSpacingUniform;
            gridView.ItemClick += delegate (object sender, AdapterView.ItemClickEventArgs args)
            {
                int position = args.Position;
                if(GridAdapter.locks[position] == true)
                {
                    DialogService.ShowError("Loading");
                }
                else
                {
                    //                    DialogService.ShowSuccess("Good");
                    var alert = new AlertDialog.Builder(this);
                    Android.Views.View view = LayoutInflater.Inflate(Resource.Layout.MainPageGrid, null);
                    ImageView iv = view.FindViewById<ImageView>(Resource.Id.imagegrid);
                    iv.SetImageBitmap(GridAdapter.images[position]);
                    alert.SetView(view);
                    alert.Create().Show();

                }
            };

            DialogService.HideLoading();

            Button mineButton = this.FindViewById<Button>(Resource.Id.mineButton);
            Button emojiButton = this.FindViewById<Button>(Resource.Id.emojiButton);
            Button safariButton = this.FindViewById<Button>(Resource.Id.safariButton);

            emojiButton.Click += delegate
            {
                StartActivity(typeof(CameraPageActivity));
            };

            mineButton.Click += delegate
            {
                updateGridView();
            };

            safariButton.Click += delegate
            {
                DialogService.ShowError("To be continued");
            };
        }
Ejemplo n.º 16
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {

            var b = new AlertDialog.Builder(this.Activity)
                    //.setIcon(R.drawable.alert_dialog_icon)
                .SetTitle("new title")
                .SetNegativeButton("Cancel", (s,e) => {});

            b.SetView(this.GetTheView());
            return b.Create();
        }
Ejemplo n.º 17
0
 private View BuildAndShowDialog()
 {
     var modal = LayoutInflater.Inflate(Resource.Layout.Modal, null);
     var builder = new AlertDialog.Builder(this);
     builder.SetTitle("Watchu wanna add?");
     builder.SetView(modal);
     builder.SetPositiveButton("OK", OkClicked);
     builder.SetNegativeButton("Cancel", CancelClicked);
     builder.Create();
     builder.Show();
     return modal;
 }
Ejemplo n.º 18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // AlertDialog
            var alert = new AlertDialog.Builder(this);
            //var button = FindViewById<Button>(Resource.Id.submitButton);
            //button.Click += (o, e) => { alert.Create().Cancel(); };
            alert.SetView(LayoutInflater.Inflate(Resource.Layout.Modal, null));
            alert.Create().Show();

        }
Ejemplo n.º 19
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            this._view = this.Activity.LayoutInflater.Inflate (Resource.Layout.AddFeedDialog, null);

            var builder = new AlertDialog.Builder (this.Activity);

            builder.SetView (this._view)
                .SetPositiveButton ("Add Feed", AddClicked)
                .SetNegativeButton ("Cancel", CancelClicked);

            return builder.Create ();
        }
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            var builder = new AlertDialog.Builder(Activity);
            builder.SetView(Resource.Layout.nnf_dialog_folder_name)
                .SetTitle(Resource.String.nnf_new_folder)
                .SetNegativeButton(Android.Resource.String.Cancel, (s,e)=>{})
                .SetPositiveButton(Android.Resource.String.Ok, (s, e) => { });

            var dialog = builder.Create();
            dialog.SetOnShowListener(this);
            return dialog;
        }
Ejemplo n.º 21
0
 public void Filter(List<WorkshopPreview> list, LayoutInflater inflater, Activity activity)
 {
     var builder = new AlertDialog.Builder(activity);
     var dialogView = inflater.Inflate(Resource.Layout.AlertDialog_Filter, null);
     builder.SetView(dialogView);
     builder.SetTitle("Filter");
     var clickListener = new ActionClickListener(listAdapter, listView, list, this, false, isWorkshop, dialogView);
     builder.SetPositiveButton("Filter", clickListener);
     builder.SetNegativeButton("Clear", clickListener);
     SetDefaultVals(dialogView, isWorkshop);
     filterView = dialogView;
     builder.Show();
 }
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var builder = new AlertDialog.Builder(Activity);

            var inflater = Activity.LayoutInflater;

            var view = inflater.Inflate(Resource.Layout.TournamentInfoStateDialogLayout, null);

            if (view != null)
            {
                btnStart = view.FindViewById<Button>(Resource.Id.btnEditTournamentState_Start);
                btnFinalize = view.FindViewById<Button>(Resource.Id.btnEditTournamentState_Finalize);
                btnReset = view.FindViewById<Button>(Resource.Id.btnEditTournamentState_Reset);
                btnDestroy = view.FindViewById<Button>(Resource.Id.btnEditTournamentState_Destroy);

                btnStart.Enabled = false;
                btnFinalize.Enabled = false;
                btnReset.Enabled = false;
                string state = json["state"];
                switch (state)
                {
                    case "complete":
                        btnReset.Enabled = true;
                        break;
                    case "awaiting_review":
                        btnReset.Enabled = true;
                        btnFinalize.Enabled = true;
                        break;
                    case "underway":
                        btnReset.Enabled = true;
                        break;
                    case "pending":
                        btnStart.Enabled = true;
                        break;
                }

                btnStart.Click += BtnStart_Click;
                btnFinalize.Click += BtnFinalize_Click;
                btnReset.Click += BtnReset_Click;
                btnDestroy.Click += BtnDestroy_Click;

                builder.SetTitle(Resource.String.editTournamentState);

                builder.SetView(view);
            }

            var dialog = builder.Create();
            return dialog;
        }
 protected override Dialog CreateDialog(Context context)
 {
     var setting = Cell as TextSetting;
     var builder = new AlertDialog.Builder(context);
     builder.SetTitle(setting.Title);
     var input = new EditText(context);
     input.Text = setting.Value;
     input.SelectAll();
     builder.SetView(input);
     builder.SetPositiveButton("Ok", new TextApplier(input, setting));
     var dialog = builder.Create();
     dialog.Window.SetSoftInputMode(SoftInput.StateVisible);
     return dialog;
 }
        public override Dialog OnCreateDialog(Bundle savedState)
        {
            base.EnsureBindingContextSet(savedState);

            var view = this.BindingInflate(Resource.Layout.Dialog_Names, null);

            var dialog = new AlertDialog.Builder(_context);
            dialog.SetTitle("Name Dialog");
            dialog.SetView(view);
            dialog.SetNegativeButton("Cancel", (s, a) => { });
            dialog.SetPositiveButton("OK", (s, a) => 
                    Toast.MakeText(Activity.ApplicationContext, string.Format("Full name is: {0}", NamesViewModel.FullName), ToastLength.Short).Show()
                );
            return dialog.Create();
        }
Ejemplo n.º 25
0
 private AlertDialog.Builder GetAlertDialog()
 {
     var builder = new AlertDialog.Builder (this);
     builder.SetView (LayoutInflater.Inflate (Resource.Layout.Rules, null));
     builder.SetMessage (Resource.String.OpenSiteQuestionString);
     builder.SetTitle (Resource.String.GoToMosigraSite);
     builder.SetPositiveButton (GetString (Resource.String.YesString), delegate {
         var uri = Android.Net.Uri.Parse ("http://www.spb.mosigra.ru/Face/Show/ersh");
         var intent = new Intent (Intent.ActionView, uri);
         StartActivity (intent);
     });
     builder.SetNegativeButton (GetString (Resource.String.NoString), delegate {
     });
     return builder;
 }
        void Control_Click (object sender, EventArgs e)
        {
            var formsView = new CommonFormsView ();

            var nativeConverted = FormsToNativeDroid.ConvertFormsToNative (formsView, new Rectangle (0, 0, 400, 400));
            
            var builder = new AlertDialog.Builder (Forms.Context);

            builder.SetView (nativeConverted);

            builder.SetTitle ("Forms View");

            var dialog = builder.Create ();
            dialog.Show ();
        }
Ejemplo n.º 27
0
        public override Dialog OnCreateDialog(Bundle savedState)
        {
            base.EnsureBindingContextSet(savedState);

            var view = this.BindingInflate(Resource.Layout.page_followEdit_view, null);

            var dialog = new AlertDialog.Builder(Activity);
            dialog.SetTitle(((FollowEditViewModel)this.ViewModel).Station.Name);
            dialog.SetView(view);
            dialog.SetNegativeButton("Cancel", (s, a) => { });
            dialog.SetPositiveButton("Save", (s, a) =>
                (this.ViewModel as FollowEditViewModel).SaveCommand.Execute(null)
            );

            return dialog.Create();
        }
Ejemplo n.º 28
0
		private bool OnAddItemClicked (IMenuItem menuItem)
		{
			AlertDialog.Builder builder = new AlertDialog.Builder (Activity);
			builder.SetTitle ("Create Item");

			EditText nameInput = (EditText)Activity.LayoutInflater.Inflate (Resource.Layout.NameDialog, null);

			builder.SetView (nameInput);
			builder.SetPositiveButton ("Add", (sender, args) => CreateItem (nameInput.Text));
			builder.SetNegativeButton ("Cancel", (IDialogInterfaceOnClickListener)null);

			AlertDialog dialog = builder.Create();
			dialog.Show();

			return true;
		}
Ejemplo n.º 29
0
		public override Dialog OnCreateDialog (Bundle savedInstanceState)
		{
			var viewModel = ViewModel as EnterResultsViewModel;

			BindingContext = new MvxAndroidBindingContext (Activity, new MvxSimpleLayoutInflater (Activity.LayoutInflater));
			DataContext = viewModel;

			var builder = new AlertDialog.Builder (Activity);
			var view = this.BindingInflate (Resource.Layout.EnterResultsView, null);

			builder.SetView (view);
			builder.SetCancelable (true);
			builder.SetPositiveButton (StringResources.Save, new EventHandler<DialogClickEventArgs> ((s, e) => viewModel.SubmitResults ()))
					.SetNegativeButton (StringResources.Cancel, (EventHandler<DialogClickEventArgs>)null);
            
			return builder.Create ();
		}
Ejemplo n.º 30
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 ();
		}