Exemple #1
0
        private void BtYeNo_Click(object sender, EventArgs e)
        {
            //objeto
            AlertDialog.Builder alerta = new AlertDialog.Builder(this);
            //titulo
            alerta.SetTitle("YES NO");
            //icon
            alerta.SetIcon(Android.Resource.Drawable.IcLockLock);
            // ms
            alerta.SetMessage(" MENSAGEM");
            // EVENTOS
            alerta.SetPositiveButton("YES", (senderAlert, arg) => {
                Toast.MakeText(this, "clicou em yes",
                               ToastLength.Short).Show();
            });

            alerta.SetNegativeButton("NO", (senderAlert, arg) => {
                Toast.MakeText(this, "clicou em no",
                               ToastLength.Short).Show();
            });

            alerta.SetNeutralButton("neutro", (senderAlert, arg) => {
                Toast.MakeText(this, "clicou em neutro",
                               ToastLength.Short).Show();
            });
            //MOSTRA
            alerta.Show();
        }
        /// <summary>Alerts the user with a simple OK dialog and provides a <paramref name="message"/>.</summary>
        /// <param name="message">The message.</param>
        /// <param name="title">The title.</param>
        /// <param name="okbtnText">The okbtn text.</param>
        public void Alert(string message, string title, string okbtnText)
        {
            var top = Mvx.Resolve <IMvxAndroidCurrentTopActivity>();
            var act = top.Activity;

            var adb = new AlertDialog.Builder(act);

            adb.SetTitle(title);
            adb.SetMessage(message);
            adb.SetIcon(Resource.Drawable.icon);
            adb.SetPositiveButton(okbtnText, (sender, args) => { /* some logic */ });
            adb.Create().Show();

            //AlertDialog.Builder alert = new AlertDialog.Builder(this);

            //alert.SetTitle("Hi, how are you");

            //alert.SetPositiveButton("Good", (senderAlert, args) => {
            //    //change value write your own set of instructions
            //    //you can also create an event for the same in xamarin
            //    //instead of writing things here
            //});

            //alert.SetNegativeButton("Not doing great", (senderAlert, args) => {
            //    //perform your own task for this conditional button click
            //});
            ////run the alert in UI thread to display in the screen
            //RunOnUiThread(() => {
            //    alert.Show();
            //});
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.feedback);

            //彈出視窗解說:
            AlertDialog.Builder alert_feedback = new AlertDialog.Builder(this);  // For initial tips dialog
            if (feedback_tips == 0)
            {
                alert_feedback.SetTitle("注意事項");
                alert_feedback.SetMessage("1. 點選**顯示結果**查看測謊結果.\n2. 若想再測謊一次,請按**再次測謊**.\n3. 懇請給予我們您寶貴的體驗建議,請按**填寫回饋單**給予我們進步的空間,感謝體驗!!!");
                alert_feedback.SetIcon(Android.Resource.Drawable.IcDialogInfo);
                alert_feedback.SetPositiveButton(" ok", new EventHandler <DialogClickEventArgs>((sender, e) => { }));
                alert_feedback.Show();
                feedback_tips++;
            }

            // 跑馬燈
            TextView result_tv = FindViewById <TextView>(Resource.Id.result_textview);

            result_tv.Selected = true;

            FindViewById <Button>(Resource.Id.btn_result).Click   += Show_Result;
            FindViewById <Button>(Resource.Id.btn_feedback).Click += Go_FeedBack;
            FindViewById <Button>(Resource.Id.btn_onemore).Click  += Play_Again;
            FindViewById <Button>(Resource.Id.btn_exit).Click     += Exit_App;
        }
Exemple #4
0
        //APLICA OS EVENTOS DA INTERFACE

        public void  onDelete(string value)
        {
            // VALOR PASSADO PELO IVENTE DELETE QUE ESTA NO LISTVIEWBASEADAPTER
            //Toast.MakeText(this, value, ToastLength.Long).Show();

            // FAZER UM MENSAGEM DE ALERT
            AlertDialog.Builder alert = new AlertDialog.Builder(this);
            // TITULO
            alert.SetTitle("CRUD MYSQL");
            // ICONE
            alert.SetIcon(Android.Resource.Drawable.IcDialogAlert);
            // MENSAGEM
            alert.SetMessage("DESEJA EXCLUIR");

            //EVENTO
            alert.SetPositiveButton("OK", async(senderAlert, args) =>
            {
                //Toast.MakeText(this, value, ToastLength.Long).Show();
                DeleteRegistro(int.Parse(value));

                dado    = await Resgistro();
                adapter = new ListViewBaseAdapter(this, dado);
                adapter.SetEvento(this);
                ltv.Adapter = adapter;
            });

            alert.SetNegativeButton("NO", (senderAlert, args) =>
            {
                adapter = new ListViewBaseAdapter(this, dado);
                adapter.SetEvento(this);
                ltv.Adapter = adapter;
            });
            alert.Show();
            adapter.NotifyDataSetChanged();
        }
Exemple #5
0
        public static void DisplayAlert(string title = "Exception", string message = "", ViewStates viewStates = ViewStates.Invisible)
        {
            var inflater = LayoutInflater.From(mcontext);
            var dialog   = new AlertDialog.Builder(mcontext).Create();
            var view     = inflater.Inflate(Resource.Layout.AlertInterface, null);

            var _title     = view.FindViewById <TextView>(Resource.Id._alertTitle);
            var _message   = view.FindViewById <TextView>(Resource.Id._alertMessage);
            var _okBtn     = view.FindViewById <Button>(Resource.Id._okBtn);
            var _cancleBtn = view.FindViewById <Button>(Resource.Id._cancelBtn);

            _cancleBtn.Visibility = viewStates;

            _okBtn.Click += delegate { dialog.Dismiss(); };

            _cancleBtn.Click += delegate { dialog.Dismiss(); };

            _title.Text   = title;
            _message.Text = message;

            dialog.SetView(view);

            dialog.SetIcon(Resource.Drawable.warning_icon);

            dialog.Show();
        }
Exemple #6
0
        public Dialog FontSizeDialog(Activity activity)
        {
            ContextThemeWrapper context = new ContextThemeWrapper(activity, App.FUNCTIONS.GetDialogTheme());

            AlertDialog.Builder dialog = new AlertDialog.Builder(context);

            SeekBar seek = new SeekBar(activity);

            seek.Max      = 10;
            seek.Progress = App.STATE.SeekBarTextSize;
            seek.SetOnSeekBarChangeListener(new SeekBarListener(this));

            int size = App.FUNCTIONS.GetWebViewTextSize(App.STATE.SeekBarTextSize);

            dialog.SetIcon(Resource.Drawable.Icon);
            dialog.SetMessage("Adjust article text size:");
            dialog.SetTitle("Text Size");
            dialog.SetNeutralButton("Close",
                                    (o, args) =>
            {
                // Close dialog
            });
            dialog.SetView(seek);

            return(dialog.Create());
        }
Exemple #7
0
        static public void Alert(Context ctx, string title, string message, bool CancelButton, Action <Result> callback = null)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
            builder.SetTitle(title);
            builder.SetIcon(Resource.Drawable.Icon);
            builder.SetMessage(message);

            builder.SetPositiveButton("Ok", (sender, e) => {
                if (callback != null)
                {
                    callback(Result.Ok);
                }
            });

            if (CancelButton)
            {
                builder.SetNegativeButton("Cancel", (sender, e) => {
                    if (callback != null)
                    {
                        callback(Result.Canceled);
                    }
                });
            }

            builder.Show();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here

            SetContentView(Resource.Layout.layout_invtixscanverifyepc);

            Button btnImportInvTixBatch = FindViewById <Button>(Resource.Id.btnInvTixVerifyLoadRFIDBatch);
            Button btnBack = FindViewById <Button>(Resource.Id.btnInvTixVerifyBackScan);

            scanType = "VERIFY";
            toFrom   = "VERIFY";

            dbError = "";
            if (!db.createTable_FoxProduct(Constants.DBFilename, ref dbError))
            {
                var builder = new AlertDialog.Builder(this);
                builder.SetTitle("Database Error!");
                builder.SetIcon(Resource.Drawable.iconBang64);
                builder.SetMessage("A database error has occurred. <FoxProduct> not created. Please exit app and try again.");
                builder.SetPositiveButton("OK", (s, e2) =>
                { /* Handle 'OK' click */
                }
                                          );
                builder.Create().Show();
            }

            btnImportInvTixBatch.Click += BtnImportInvTixBatch_Click;
            btnBack.Click += BtnBack_Click;

            timer.Interval = 1000;
            timer.Elapsed += Timer_Elapsed;
        }
Exemple #9
0
        private void Tv_Subway_Click(object sender, EventArgs e)
        {
            TextView t = sender as TextView;

            if (t != null)
            {
                Android.Net.ConnectivityManager connectivityManager = (Android.Net.ConnectivityManager)GetSystemService(ConnectivityService);
                Android.Net.NetworkInfo         activeConnection    = connectivityManager.ActiveNetworkInfo;
                bool isOnline = (activeConnection != null) && activeConnection.IsConnected;

                if (isOnline)
                {
                    var second = new Intent(this, typeof(SubwayInfoActivity));
                    second.PutExtra("StationName", t.Tag.ToString().Split(',')[0]);
                    this.StartActivity(second);
                }
                else
                {
                    AlertDialog.Builder dlg = new AlertDialog.Builder(this);
                    dlg.SetTitle(GetString(Resource.String.InternetCheck));
                    dlg.SetMessage(GetString(Resource.String.InternetCheckMessage));
                    dlg.SetIcon(Resource.Drawable.AppIcon);
                    dlg.SetPositiveButton(GetString(Resource.String.confirm), (s, o) =>
                    {
                    });
                    dlg.Show();
                }
            }
        }
Exemple #10
0
 private void WaitingButton_Click(object sender, EventArgs e)
 {
     if (!KisiBilgileriTammi())
     {
         //AlertHelper.AlertGoster("Yaş ve Cinsiyet Bilgilerinizi Tamamlamadan Check-in Yapamazsınız.", this);
         AlertDialog.Builder cevap = new AlertDialog.Builder(this);
         cevap.SetIcon(Resource.Mipmap.ic_launcher_round);
         cevap.SetTitle(Spannla(Color.Black, "Buptis"));
         cevap.SetMessage(Spannla(Color.DarkGray, "Yaş ve Cinsiyet Bilgilerinizi Tamamlamadan Check-in Bekletme Yapamazsınız. Bilgilerini güncellemek ister misiniz?"));
         cevap.SetPositiveButton("Evet", delegate
         {
             cevap.Dispose();
             StartActivity(typeof(PrivateProfileTemelBilgilerActivity));
         });
         cevap.SetNegativeButton("Hayır", delegate
         {
             cevap.Dispose();
         });
         cevap.Show();
     }
     else
     {
         CheckInYap("WAITING", "Check-in Bekletme Yapılıyor...", "Check-in Bekletme Yapıldı...");
     }
 }
Exemple #11
0
        // delete
        public void onDelete(string value)
        {
            // testar para pegar o id_us do listviewbaseadapter
            Toast.MakeText(this, value, ToastLength.Short).Show();

            //Fazer uma mensagem de alert
            AlertDialog.Builder alert = new AlertDialog.Builder(this);
            //Titulo
            alert.SetTitle("CRUD MYSQL");
            //Icone
            alert.SetIcon(Android.Resource.Drawable.IcDialogDialer);
            //Mensagem
            alert.SetMessage("Deseja Excluir");
            //Evento
            alert.SetPositiveButton("OK", async(SenderAlert, args) => {
                //Toast.MakeText(this, value, ToastLength.Long).Show();
                DeleteRegistro(int.Parse(value));

                dado    = await Resgistro();
                adapter = new listViewBaseAdapter(this, dado);
                adapter.SetEvento(this);
                ltv.Adapter = adapter;
            });

            alert.SetNegativeButton("NO", (SenderAlert, args) =>
            {
                adapter = new listViewBaseAdapter(this, dado);
                adapter.SetEvento(this);
                ltv.Adapter = adapter;
            });

            alert.Show();
            adapter.NotifyDataSetChanged();
        }
Exemple #12
0
        void btInseriPedido_Click(object sender, EventArgs e)
        {
            if (lwCarrinho.Count > 0)
            {
                AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
                builder1.SetTitle("CONFIRMAÇÃO");
                builder1.SetIcon(Android.Resource.Drawable.IcDialogAlert);
                builder1.SetMessage("Oi ! Você confirma solicitação desse(s) produto(s)?");
                builder1.SetPositiveButton("Sim", delegate {
                    progressDialog = ProgressDialog.Show(this, "CONFIRMAÇÃO", "Enviando o Pedido", true);

                    new Thread(new ThreadStart(delegate {
                        enviaPedido();
                    })).Start();
                });

                builder1.SetNegativeButton("Não", delegate {
                });
                builder1.Show();
            }
            else
            {
                Toast.MakeText(this, "O carrinho esta vazio, vamos as compras!!!", ToastLength.Short).Show();
            }
        }
Exemple #13
0
        public override Dialog OnCreateDialog(Bundle savedInstanceState)
        {
            base.OnCreateDialog(savedInstanceState);
            Log.Debug(TAG, "OnCreateDialog()");

            Bundle bundle = Arguments;

            if (bundle == null)
            {
                return(null);
            }
            String message = bundle.GetString(ARG_MESSAGE);
            String title   = bundle.GetString(ARG_TITLE);
            int    icon    = bundle.GetInt(ARG_ICON);

            AlertDialog dlg =
                new AlertDialog.Builder(Activity).SetMessage(message).SetTitle(title).SetCancelable(false).Create();

            if (icon != 0)
            {
                dlg.SetIcon(icon);
            }
            dlg.SetButton("OK", (sender1, e1) =>
            {
                Log.Debug(TAG, "ClickButtonEvent()");
                Dismiss();
                if (_callback != null)
                {
                    _callback.OnDialogClosed();
                }
            });
            return(dlg);
        }
        //string pathFoto ="";
        private void BtnSiguiente_Click(object sender, EventArgs e)
        {
            try
            {
                //ValidarCamposObligatorios();



                string stIdUsuario   = Intent.GetStringExtra("idUsuario");
                string stNomCompleto = Intent.GetStringExtra("NombreCompleto");
                string stEmail       = Intent.GetStringExtra("email");
                string stNomusuario  = Intent.GetStringExtra("usuarioNombre");
                string stidRol       = Intent.GetStringExtra("idRol");

                string valorObser = txtObser.Text;

                Intent secondActivityConfNuevoRecl = new Intent(this, typeof(ActivityConfNuevoReclamo));
                secondActivityConfNuevoRecl.PutExtra("AreaServicioID", stIDAreaServicio);
                secondActivityConfNuevoRecl.PutExtra("TipoReclamoID", stIDTipoReclamo);
                secondActivityConfNuevoRecl.PutExtra("TipoReclamoNombre", stNombreTipoReclamo);
                secondActivityConfNuevoRecl.PutExtra("AreaServicioNombre", stNombreAreaServicio);

                secondActivityConfNuevoRecl.PutExtra("idCalle", idCalle);
                secondActivityConfNuevoRecl.PutExtra("idBarrio", stIdBarrio);
                secondActivityConfNuevoRecl.PutExtra("nombreBarrio", stBarrioNombre);
                secondActivityConfNuevoRecl.PutExtra("nombreCalle", stCalleNombre);
                //secondActivityConfNuevoRecl.PutExtra("obser", txtObser.Text);
                secondActivityConfNuevoRecl.PutExtra("altura", edtNro.Text);

                secondActivityConfNuevoRecl.PutExtra("foto", bitmap);
                secondActivityConfNuevoRecl.PutExtra("observaciones", valorObser);
                secondActivityConfNuevoRecl.PutExtra("idUsuario", stIdUsuario);
                secondActivityConfNuevoRecl.PutExtra("idLatitud", stLatitud);
                secondActivityConfNuevoRecl.PutExtra("idLongitud", stLongitud);
                secondActivityConfNuevoRecl.PutExtra("NombreCompleto", stNomCompleto);
                secondActivityConfNuevoRecl.PutExtra("email", stEmail);
                secondActivityConfNuevoRecl.PutExtra("usuarioNombre", stNomusuario);
                secondActivityConfNuevoRecl.PutExtra("idRol", stidRol);

                if (stIDAreaServicio != "-1" && stIdBarrio != "-1" && edtNro.Text != "" && stIDTipoReclamo != "-2" && idCalle != "-2")
                {
                    StartActivity(secondActivityConfNuevoRecl);
                    //Finish();
                }
                else
                {
                    AlertDialog ad = new AlertDialog.Builder(this).Create();
                    ad.SetTitle("Error al ingreso");
                    ad.SetIcon(Resource.Drawable.cancel);
                    ad.SetMessage("Por favor verifique si se ingresaron los datos minimos y requeridos.");
                    ad.SetButton("Ok", (g, h) => { });
                    ad.Show();
                    //ValidarCamposObligatorios();
                }
            }
            catch
            {
                Toast.MakeText(ApplicationContext, "Error en datos de ingreso", ToastLength.Long).Show();
            }
        }
Exemple #15
0
        private void btnEnviarCalificacion(object sender, DialogClickEventArgs e)
        {
            try
            {
                clsDetalleReclamo objCalifReclamo = new clsDetalleReclamo();
                objCalifReclamo.rat_IDReclamo  = idReclamo;
                objCalifReclamo.rat_comentario = edtComentario.Text;
                objCalifReclamo.rat_rating     = rbAD.Rating.ToString();
                objCalifReclamo.rat_fechaAlta  = DateTime.Now.ToString("dd/MM/yyyy");
                string stValorCalifReclamo = JsonConvert.SerializeObject(objCalifReclamo);

                HttpClient client = new HttpClient();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                string urlCalificarReclamo   = "http://DCWebApi.somee.com/api/ReclamoController/RegistrarRating?stObj=" + stValorCalifReclamo;
                HttpResponseMessage response = client.GetAsync(urlCalificarReclamo).Result;
                if (response.IsSuccessStatusCode)
                {
                    string ResultadoRating = JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result).ToString();
                    if (ResultadoRating == "1")
                    {
                        AlertDialog.Builder builderr = new AlertDialog.Builder(this);
                        builderr.SetTitle("Rating Registrado");
                        builderr.SetIcon(Resource.Drawable.check);
                        builderr.SetMessage("Rating registrado con exito");
                        builderr.SetPositiveButton("OK", BTNok);
                        AlertDialog alertdialogg = builderr.Create();
                        alertdialogg.Show();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
        void GaleridenSecMetod()
        {
            var cevap = new AlertDialog.Builder(this);

            cevap.SetCancelable(true);
            cevap.SetIcon(Resource.Mipmap.ic_launcher);
            cevap.SetTitle(Spannla(Color.Black, "Contento"));
            cevap.SetMessage(Spannla(Color.DarkGray, "Yüklemek istediğiniz medya tipini seçin"));
            cevap.SetPositiveButton("Resim", delegate
            {
                var Intent = new Intent();
                Intent.SetType("image/*");
                Intent.SetAction(Intent.ActionOpenDocument);
                StartActivityForResult(Intent.CreateChooser(Intent, "Resim Yükle"), 444);
                cevap.Dispose();
            });
            cevap.SetNegativeButton("Video", delegate
            {
                var Intent = new Intent();
                Intent.SetType("video/*");
                Intent.SetAction(Intent.ActionGetContent);
                StartActivityForResult(Intent.CreateChooser(Intent, "Video Yükle"), 555);
                cevap.Dispose();
            });
            cevap.Show();
        }
Exemple #17
0
        protected override Dialog OnCreateDialog(int id)
        {
            var customView = LayoutInflater.Inflate(Resource.Layout.wifi_dialog, null);
            var builder    = new AlertDialog.Builder(this);

            builder.SetIcon(Android.Resource.Drawable.IcMenuPreferences);
            builder.SetView(customView);
            builder.SetTitle("Set Wifi password");

            switch (id)
            {
            case WpaDialog:
            {
                builder.SetPositiveButton("OK", WpaOkClicked);
                builder.SetNegativeButton("Cancel", CancelClicked);
                return(builder.Create());
            }

            case WepDialog:
            {
                builder.SetPositiveButton("OK", WepOkClicked);
                builder.SetNegativeButton("Cancel", CancelClicked);
                return(builder.Create());
            }
            }
            return(base.OnCreateDialog(id));
        }
Exemple #18
0
        /// <summary>
        /// 多选对话框
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn3_Click(object sender, EventArgs e)
        {
            AlertDialog.Builder ad_build = new AlertDialog.Builder(this);
            string[]            array    = new string[] { "语文", "数学", "英语" };
            bool[] resultArray           = new bool[] { false, false, false };

            ad_build.SetMultiChoiceItems(array, resultArray, new EventHandler <DialogMultiChoiceClickEventArgs>((object o2, DialogMultiChoiceClickEventArgs e2) =>
            {
                resultArray[e2.Which] = e2.IsChecked;
                MessageBoxShow("你选择的是" + array[e2.Which]);
            }));
            ad_build.SetNegativeButton("确定", new System.EventHandler <DialogClickEventArgs>((object o2, DialogClickEventArgs e2) =>
            {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < resultArray.Length; i++)
                {
                    if (resultArray[i])
                    {
                        sb.Append(array[i]);
                        if (i != resultArray.Length - 1)
                        {
                            sb.Append(",");
                        }
                    }
                }
                MessageBoxShow("你最终选择的有:" + sb.ToString());
            }));
            ad_build.SetPositiveButton("取消", new System.EventHandler <DialogClickEventArgs>((object o3, DialogClickEventArgs e3) =>
            {
                MessageBoxShow("已取消");
            }));
            ad_build.SetIcon(Android.Resource.Drawable.StatSysWarning);
            ad_build.Show();
        }
        void FavoriIslemleri()
        {
            var IsFollow = FollowListID.FindAll(item => item == MesajlarIcinSecilenKullanici.Kullanici.id.ToString());

            if (IsFollow.Count > 0)//Takip Ettiklerim Arasaında
            {
                AlertDialog.Builder cevap = new AlertDialog.Builder(this);
                cevap.SetIcon(Resource.Mipmap.ic_launcher_round);
                cevap.SetTitle(Spannla(Color.Black, "Buptis"));
                cevap.SetMessage(Spannla(Color.DarkGray, MesajlarIcinSecilenKullanici.Kullanici.firstName + " adlı kullanıcıyı favorilerilerinden çıkartmak istediğini emin misiniz?"));
                cevap.SetPositiveButton("Evet", delegate
                {
                    cevap.Dispose();
                    FavoriIslemleri(MesajlarIcinSecilenKullanici.Kullanici.firstName + " favorilerinde çıkarıldı.");
                    Favori.SetBackgroundResource(Resource.Drawable.favori_pasif);
                });
                cevap.SetNegativeButton("Hayır", delegate
                {
                    cevap.Dispose();
                });
                cevap.Show();
            }
            else
            {
                FavoriIslemleri(MesajlarIcinSecilenKullanici.Kullanici.firstName + " favorilerine eklendi.");
                Favori.SetBackgroundResource(Resource.Drawable.favori_aktif);
            }
        }
        protected internal void BTSalvar_Click(object sender, EventArgs e)
        {
            AlertDialog.Builder alerta = new AlertDialog.Builder(this);

            if (dataPlanejada > DateTime.Now)
            {
                alerta.SetTitle("Atenção!");
                alerta.SetIcon(Android.Resource.Drawable.IcInputAdd);
                //define a mensagem
                alerta.SetMessage("Você está avaliando fora da data planejada. Deseja prosseguir?");
                //define o botão positivo
                alerta.SetPositiveButton("Sim", (senderAlert, args) =>
                {
                    SalvarAvaliacao();
                });
                alerta.SetNegativeButton("Não", (senderAlert, args) =>
                {
                });
                //cria o alerta e exibe
                Dialog dialog = alerta.Create();
                dialog.Show();
            }
            else
            {
                SalvarAvaliacao();
            }
        }
        void CheckLocationManager()
        {
            LocationManager lm = (LocationManager)GetSystemService(LocationService);

            if (lm.IsProviderEnabled(LocationManager.GpsProvider) == false)
            {
                var dialog = new AlertDialog.Builder(this);
                dialog.SetTitle("Bitte aktivieren Sie GPS");
                dialog.SetMessage("Ohne GPS können Sie keine Daten hochladen");
                dialog.SetCancelable(false);
                dialog.SetPositiveButton("Aktivieren", delegate {
                    StartActivity(new Intent(Android.Provider.Settings.ActionLocationSourceSettings));
                    try
                    {
                        locationManager.RequestLocationUpdates(locationProvider, 0, 0, this);
                    }
                    catch { }
                });
                dialog.SetNegativeButton("Überspringen", delegate {
                    LocationTextView.TextFormatted = Html.FromHtml("<b>GPS Deaktiviert</b>");
                });
                dialog.SetIcon(Resources.GetDrawable(Resource.Drawable.Warning));
                dialog.Show();
            }
        }
        public void preguntarsienviarorecibir(bool envio, string nombre, int posicion)
        {
            RunOnUiThread(() =>
            {
                AlertDialog.Builder ad = new AlertDialog.Builder(this);
                ad.SetCancelable(false);
                ad.SetTitle("Advertencia");
                ad.SetIcon(Resource.Drawable.warningsignonatriangularbackground);
                posx = posicion;
                if (envio)
                {
                    ad.SetMessage("Desea enviar: " + Path.GetFileNameWithoutExtension(nombre) + " al cliente solicitado");
                    ad.SetPositiveButton("Si", si);
                }
                else
                {
                    ad.SetMessage("Desea recibir: " + Path.GetFileNameWithoutExtension(nombre) + " del cliente solicidato");
                    ad.SetPositiveButton("Si", si2);
                }


                ad.SetNegativeButton("No", no);


                ad.Create();
                ad.Show();
            });
        }
        private void CheckAndMoveArticleImages()
        {
            // Nur, wenn bereits eine Datenbank vorhanden ist
            if (Android_Database.SQLiteConnection == null)
            {
                return;
            }

            var picturesToMove = Database.GetArticlesToCopyImages();

            if (picturesToMove.Count == 0)
            {
                return;
            }

            string message = string.Format(
                "Es müsen {0} Bilder übetragen werden.\n\n" +
                "Beenden Sie die App ganz, starten Sie diese neu und wählen Sie beim Starten diese Datenbank.",
                picturesToMove.Count);

            var dialog = new AlertDialog.Builder(this);

            dialog.SetMessage(message);
            dialog.SetTitle(Resource.String.App_Name);
            dialog.SetIcon(Resource.Drawable.ic_launcher);
            dialog.SetPositiveButton("OK", (s1, e1) => { });
            dialog.Create().Show();
        }
Exemple #24
0
        public override bool OnKeyDown(Keycode keycode, KeyEvent @event)
        {
            bool handled = false;

            try{
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.SetTitle("CONFIRMAÇÃO");
                builder.SetIcon(Android.Resource.Drawable.IcDialogAlert);
                builder.SetMessage("Oi ! Você deseja sair do FastDelivery?");
                builder.SetPositiveButton("Sim", delegate {
                    Finish();
                });

                builder.SetNegativeButton("Não", delegate {
                    //StartActivity (typeof(MainActivity));
                });
                builder.SetCancelable(false);
                builder.Show();

                handled = true;
            }
            catch {
                handled = false;
            }
            return(handled || base.OnKeyDown(keycode, @event));
        }
        public void LoadTimerSensor()
        {
            View viewAlert = View.Inflate(this, Resource.Layout.LayoutTimerSensor, null);

            AlertDialog.Builder Message = new AlertDialog.Builder(this);
            Message.SetTitle("زمان را برحسب دقیقه انتخاب کنید"); Message.SetView(viewAlert);
            Message.SetIcon(Resource.Drawable.Timer);
            NumberPicker np = (NumberPicker)viewAlert.FindViewById(Resource.Id.LTimerSensorNumberPickerTS);

            np.MaxValue = 25; np.MinValue = 1;
            np.SetOnClickListener(this);
            Message.SetPositiveButton("فعال کن", delegate
            {
                ValueTS = (np.Value * 60) * 10;
                TimerSensor.Start();
                Toast.MakeText(this, np.Value + " M " + "تایمر سنسور فعال شد", ToastLength.Short).Show();
                WLock = dfpowermanager.NewWakeLock(WakeLockFlags.Full, "DoNotSleep");
                WLock.Acquire();
            });
            Message.SetNegativeButton("لغو", delegate { });
            Message.SetNeutralButton("لغو تایمر", delegate
            {
                TimerSensor.Stop(); ValueTS = 0;
                Toast.MakeText(this, "تایمر سنسور غیر فعال شد", ToastLength.Short).Show();
                try
                {
                    WLock.Release();
                }
                catch { }
            });
            Message.Create(); Message.Show();
        }
        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();
        }
Exemple #27
0
        private void MesajAtButton_Click(object sender, EventArgs e)
        {
            if (!KisiBilgileriTammi())
            {
                AlertHelper.AlertGoster("Yaş ve Cinsiyet Bilgilerinizi Tamamlamadan Mesaj Gönderemezsiniz.", this);
                AlertDialog.Builder cevap = new AlertDialog.Builder(this);
                cevap.SetIcon(Resource.Mipmap.ic_launcher_round);
                cevap.SetTitle(Spannla(Color.Black, "Buptis"));
                cevap.SetMessage(Spannla(Color.DarkGray, "Yaş ve Cinsiyet bilgilerinizi tamamlamadan mesaj gönderemezsiniz. Bilgilerini güncellemek ister misiniz?"));
                cevap.SetPositiveButton("Evet", delegate
                {
                    cevap.Dispose();
                    StartActivity(typeof(PrivateProfileTemelBilgilerActivity));
                });
                cevap.SetNegativeButton("Hayır", delegate
                {
                    cevap.Dispose();
                });
                cevap.Show();
            }
            else
            {
                MesajlarIcinSecilenKullanici.Kullanici = SecilenKisi.SecilenKisiDTO;
                var mesKey = GetMessageKey(MesajlarIcinSecilenKullanici.Kullanici.id);
                MesajlarIcinSecilenKullanici.key = mesKey;

                StartActivity(typeof(ChatBaseActivity));
                this.Finish();
            }
        }
 void MesajGonderGenericMetod(string Message)
 {
     if (isInternetAvailable())
     {
         if (!string.IsNullOrEmpty(Message.Trim()))
         {
             if (!KullaniciEngellemeDurumu)
             {
                 if (!KisiBilgileriTammi())
                 {
                     AlertHelper.AlertGoster("Yaş ve Cinsiyet Bilgilerinizi Tamamlamadan Mesaj Gönderemezsiniz.", this);
                     AlertDialog.Builder cevap = new AlertDialog.Builder(this);
                     cevap.SetIcon(Resource.Mipmap.ic_launcher_round);
                     cevap.SetTitle(Spannla(Color.Black, "Buptis"));
                     cevap.SetMessage(Spannla(Color.DarkGray, "Yaş ve Cinsiyet bilgilerinizi tamamlamadan mesaj gönderemezsiniz. Bilgilerini güncellemek ister misiniz?"));
                     cevap.SetPositiveButton("Evet", delegate
                     {
                         cevap.Dispose();
                         StartActivity(typeof(PrivateProfileTemelBilgilerActivity));
                     });
                     cevap.SetNegativeButton("Hayır", delegate
                     {
                         cevap.Dispose();
                     });
                     cevap.Show();
                 }
                 else
                 {
                     ChatRecyclerViewDataModel chatRecyclerViewDataModel = new ChatRecyclerViewDataModel()
                     {
                         userId     = MeDTO.id,
                         receiverId = MesajlarIcinSecilenKullanici.Kullanici.id,
                         text       = Message,
                         key        = MesajlarIcinSecilenKullanici.key
                     };
                     WebService webService = new WebService();
                     string     jsonString = JsonConvert.SerializeObject(chatRecyclerViewDataModel);
                     var        Donus      = webService.ServisIslem("chats", jsonString);
                     if (Donus != "Hata")
                     {
                         var Icerikk = Newtonsoft.Json.JsonConvert.DeserializeObject <KeyIslemleriIcinDTO>(Donus.ToString());
                         MesajEdittext.Text = "";
                         SaveKeys(Icerikk);
                     }
                     else
                     {
                         KredisimiBitti();
                         return;
                     }
                 }
             }
         }
     }
     else
     {
         AlertHelper.AlertGoster("Lütfen internet bağlantınızı kontrol edin.", this);
         return;
     }
 }
Exemple #29
0
        protected override void OnPrepareDialogBuilder(AlertDialog.Builder builder)
        {
            base.OnPrepareDialogBuilder(builder);

            builder.SetIcon(Resource.Drawable.Icon);
            builder.SetPositiveButton("PayPal", pos_Click);
            builder.SetNegativeButton("Google Play", neg_Click);
        }
Exemple #30
0
        public void ShowErrorDialog(string title, string message, string posButtonTitle)
        {
            AlertDialog.Builder alert = CreateErrorDialog(title, message, posButtonTitle);
            alert.SetIcon(Resource.Drawable.error);
            Dialog dialog = alert.Create();

            dialog.Show();
        }