private void ShowHelp()
 {
     using (global::Android.Support.V7.App.AlertDialog.Builder alert = new global::Android.Support.V7.App.AlertDialog.Builder(this))
     {
         alert.SetMessage(Resource.String.createCollectionAddActivityHelp);
         alert.SetPositiveButton(Resource.String.dialog_ok, (a, b) => { });
         alert.Show();
     }
 }
示例#2
0
        private void ShowSessionExpiredError()
        {
            global::Android.Support.V7.App.AlertDialog.Builder alert = new global::Android.Support.V7.App.AlertDialog.Builder(this);
            alert.SetTitle("Aviso");
            alert.SetMessage("Su sesión ha expirado, por favor ingrese sus credenciales nuevamente");

            Dialog dialog = alert.Create();

            dialog.Show();
        }
示例#3
0
        private void ShowErrorAlert(string message)
        {
            global::Android.Support.V7.App.AlertDialog.Builder alert = new global::Android.Support.V7.App.AlertDialog.Builder(this);
            alert.SetTitle("Error");
            alert.SetMessage(message);

            Dialog dialog = alert.Create();

            dialog.Show();
        }
示例#4
0
        private void OnEventCreated()
        {
            global::Android.Support.V7.App.AlertDialog.Builder builder = new global::Android.Support.V7.App.AlertDialog.Builder(this);
            builder.SetTitle("Aviso");
            builder.SetMessage(editMode ? "El evento ha sido editado con éxito" : "El evento ha sido creado con éxito");
            builder.SetPositiveButton("OK", OkAction);
            builder.SetCancelable(false);

            Dialog dialog = builder.Create();

            dialog.Show();
        }
示例#5
0
        private void OnFeatureModified()
        {
            global::Android.Support.V7.App.AlertDialog.Builder builder = new global::Android.Support.V7.App.AlertDialog.Builder(this);
            builder.SetTitle("Aviso");
            builder.SetMessage("No tienes guardias activas.");
            builder.SetPositiveButton("OK", OkAction);
            builder.SetCancelable(false);

            Dialog dialog = builder.Create();

            dialog.Show();
        }
        private void OnFeatureModified()
        {
            global::Android.Support.V7.App.AlertDialog.Builder builder = new global::Android.Support.V7.App.AlertDialog.Builder(this);
            builder.SetTitle("Aviso");
            builder.SetMessage("No puedes modificar una novedad de la que no eres autor.");
            builder.SetPositiveButton("OK", OkAction);
            builder.SetCancelable(false);

            Dialog dialog = builder.Create();

            dialog.Show();
        }
示例#7
0
        private void ShowErrorAlert(string message)
        {
            if (string.IsNullOrEmpty(message))
            {
                return;
            }

            global::Android.Support.V7.App.AlertDialog.Builder alert = new global::Android.Support.V7.App.AlertDialog.Builder(Activity);
            alert.SetTitle("Error");
            alert.SetMessage(message);

            Dialog dialog = alert.Create();

            dialog.Show();
        }
        private void PlaybackAcceptPopup()
        {
            View dialogLayout = LayoutInflater.Inflate(Resource.Layout.DialogButton, null);

            playBtn        = dialogLayout.FindViewById <Button>(Resource.Id.dialogBtn);
            playBtn.Text   = Resources.GetString(Resource.String.ListenBtn);
            playBtn.Click += (e, o) =>
            {
                if (player.IsPlaying)
                {
                    player.Stop();
                    player.Reset();
                    playBtn.Text = Resources.GetString(Resource.String.ListenBtn);
                }
                else
                {
                    player.SetDataSource(filePath);
                    player.Prepare();
                    player.Start();
                    playBtn.Text = Resources.GetString(Resource.String.StopBtn);
                }
            };

            global::Android.Support.V7.App.AlertDialog.Builder dialog = new global::Android.Support.V7.App.AlertDialog.Builder(this);
            dialog.SetTitle("Use this recording?");
            dialog.SetMessage("Do you want to use this recording, or try recording another clip?");
            dialog.SetView(dialogLayout);
            dialog.SetCancelable(false);
            dialog.SetNegativeButton("Record another", (s, e) =>
            {
                player.Stop();
                player.Reset();
            });
            dialog.SetPositiveButton("Use this", (s, e) =>
            {
                player.Stop();
                player.Reset();
                ReturnWithFile();
            });
            dialog.Show();
        }
        public override Dialog OnCreateDialog(global::Android.OS.Bundle savedInstanceState)
        {
            _contextWeak.TryGetTarget(out Context context);

            var alertBuilder = new global::Android.Support.V7.App.AlertDialog.Builder(context);

            alertBuilder.SetTitle(_title);

            if (_message != null)
            {
                alertBuilder.SetMessage(_message);
            }

            _textInput = new EditText(context);
            _textInput.AddTextChangedListener(this);
            alertBuilder.SetView(_textInput);

            if (_hint != null)
            {
                _textInput.Text = _hint;
                _textInput.SelectAll();
            }

            alertBuilder.SetCancelable(false);

            alertBuilder.SetNegativeButton(_cancelButton ?? "Cancel", delegate
            {
                Tcs.TrySetResult(null);
            });

            alertBuilder.SetPositiveButton(_actionButton ?? "Ok", (EventHandler <DialogClickEventArgs>)null);

            var alert = alertBuilder.Create();

            alert.SetOnShowListener(this);

            return(alert);
        }
示例#10
0
 public static global::Android.Support.V7.App.AlertDialog.Builder SetHtml(this global::Android.Support.V7.App.AlertDialog.Builder builder, string html)
 {
     return(builder.SetMessage(global::Android.OS.Build.VERSION.SdkInt > BuildVersionCodes.N ? Html.FromHtml(html, FromHtmlOptions.ModeCompact) : Html.FromHtml(html)));
 }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item?.ItemId)
            {
            case Resource.Id.menuhelp:
                using (global::Android.Support.V7.App.AlertDialog.Builder alert = new global::Android.Support.V7.App.AlertDialog.Builder(this))
                {
                    alert.SetMessage(Resource.String.createCollectionHelp);
                    alert.SetPositiveButton(Resource.String.dialog_ok, (a, b) => { });
                    alert.Show();
                }
                return(true);

            case Resource.Id.menudelete:

                using (var builder = new global::Android.Support.V7.App.AlertDialog.Builder(this))
                {
                    builder.SetTitle(Resource.String.deleteTitle)
                    .SetMessage(Resource.String.deleteMessage)
                    .SetNegativeButton(Resource.String.dialog_cancel, (a, e) =>
                    {
                    })
                    .SetPositiveButton(Resource.String.DeleteBtn, async(a, e) =>
                    {
                        if (editingSubmitted)
                        {
                            using (ProgressDialog prog = new ProgressDialog(this))
                            {
                                prog.SetMessage(Resources.GetString(Resource.String.PleaseWait));
                                prog.Show();
                                ServerResponse <string> resp = await ServerUtils.Delete <string>("/api/activitycollections?id=" + newCollection.Id).ConfigureAwait(false);
                                RunOnUiThread(() => prog.Dismiss());
                                if (resp == null)
                                {
                                    var suppress = AndroidUtils.ReturnToSignIn(this);
                                    RunOnUiThread(() => Toast.MakeText(this, Resource.String.ForceSignOut, ToastLength.Long).Show());
                                }
                                else if (resp.Success)
                                {
                                    RunOnUiThread(() => Toast.MakeText(this, Resource.String.uploadsUploadSuccessTitle, ToastLength.Long).Show());
                                    MainMyCreationsFragment.ForceRefresh = true;
                                    Finish();
                                }
                                else
                                {
                                    RunOnUiThread(() => Toast.MakeText(this, Resource.String.ConnectionError, ToastLength.Long).Show());
                                }
                            }
                        }
                        else
                        {
                            DatabaseManager db = await AndroidUtils.GetDbManager().ConfigureAwait(false);

                            var localCollections = JsonConvert.DeserializeObject <List <ActivityCollection> >(db.CurrentUser.LocalCreatedCollectionsJson);
                            localCollections.Remove(localCollections.FirstOrDefault(act => act.Id == newCollection.Id));
                            db.CurrentUser.LocalCreatedCollectionsJson = JsonConvert.SerializeObject(localCollections);
                            db.AddUser(db.CurrentUser);
                            MainMyCreationsFragment.ForceRefresh = true;
                            Finish();
                        }
                    })
                    .Show();
                }

                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }